Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Add instructions to the README about how to use the Docker container to do a CLI build #16

Open
DeflateAwning opened this issue Nov 20, 2023 · 6 comments

Comments

@DeflateAwning
Copy link
Contributor

I'm hoping that one of the containers that exists allows me to run something like:

docker run -v /host_path/to/scad-files:/src openscad/openscad openscad /src/file.scad -o /src/file.stl

Does this exist? Would it be possible to add it to the README if it does?

@t-paul
Copy link
Member

t-paul commented Nov 21, 2023

Hmm, I wrote documentation on using the containers on docker hub, but I can't find that anymore. Maybe that got lost when the account moved to an official open source account or when the github repo got a README.md 😞.

Generate STL/3MF etc, does not need an internal X display, so the simple command line is fine

docker run \
    -it \
    --rm \
    -v $(pwd):/openscad \
    -u $(id -u ${USER}):$(id -g ${USER}) \
    openscad/openscad:latest \
    openscad -o CSG.3mf CSG.scad

For PNG the current build still needs the X display, that limitation can go away soon due to the built-in EGL support. So this needs --init and run via xvfb-run

docker run \
    -it \
    --rm \
    --init \
    -v $(pwd):/openscad \
    -u $(id -u ${USER}):$(id -g ${USER}) \
    openscad/openscad:latest \
    xvfb-run -a openscad -o CSG.png CSG.scad

@DeflateAwning
Copy link
Contributor Author

This is great stuff! Can you add it to the README also? Would be very very helpful

@t-paul
Copy link
Member

t-paul commented Nov 21, 2023

Sure, that's why I did not close the issue. I just don't have the time right now and I want to get the builds updated first, so we can get rid of the special case :egl docker build as that is now supported by main line OpenSCAD. That removes the need for that separate xvfb-run wrapper.

@DeflateAwning
Copy link
Contributor Author

You seem busy! Just threw these instructions in the README :)

@t-paul
Copy link
Member

t-paul commented Nov 21, 2023

Initial update via #19. Keeping this open as reminder when the (snapshot) images are updated to EGL support.

@DeflateAwning
Copy link
Contributor Author

It appears that this PR is reflected in the README here, but not on the Docker Hub page: https://hub.docker.com/r/openscad/openscad

Wonder if there's a button you have to turn on to make it sync it or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants