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

Error with Command Line .png export in a Docker container #3983

Closed
ilya-pro opened this issue Nov 21, 2021 · 3 comments
Closed

Error with Command Line .png export in a Docker container #3983

ilya-pro opened this issue Nov 21, 2021 · 3 comments

Comments

@ilya-pro
Copy link

I've been tried different configurations to render .scad to .png in a Docker container, but get the same error:

Unable to open a connection to the X server.
DISPLAY=
Can't create OpenGL OffscreenView. Code: -1.

Dockerfile:

FROM ubuntu:20.04

RUN apt-get update --fix-missing -qq
RUN apt-get -y -qq install ca-certificates xvfb imagemagick unzip
RUN apt-get -y install openscad

Build: docker build -t openscad:ubuntu20.04xvfbExt .
Run command on Windows:
docker run -v C:/imgUbuntuX11/src:/openscadVol openscad:ubuntu20.04xvfbExt openscad -o /openscadVol/snowflake.png /openscadVol/snowflake.scad

Export to .svg and .stl works fine.

@Scopeuk
Copy link
Contributor

Scopeuk commented Nov 21, 2021

This is a known limitation, the png render (and other image files) rely on rendering into the frame buffer and then exporting to file.
see https://github.com/openscad/openscad/blob/master/tests/virtualfb.sh for details on how the test environment works around this (it appears you have installed the perquisites)

@ilya-pro
Copy link
Author

@Scopeuk Thank for your explain. So, should I run such script (virtualfb.sh) in the container after it start and before run openscad command?

@t-paul
Copy link
Member

t-paul commented Feb 19, 2022

Docker images are at https://hub.docker.com/r/openscad/openscad now.

@t-paul t-paul closed this as completed Feb 19, 2022
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

3 participants