Run an OpenGL-based graphical application in a Docker container.
10K+
A docker image that supports rendering graphical applications, including OpenGL apps.
.. image:: https://circleci.com/gh/thewtex/docker-opengl.svg?style=svg :target: https://circleci.com/gh/thewtex/docker-opengl
.. image:: https://images.microbadger.com/badges/image/thewtex/opengl.svg :target: https://microbadger.com/images/thewtex/opengl
This Docker image supports portable, CPU-based graphical application
rendering, including rendering OpenGL-based applications. An X session is
running on display :0 and can be viewed through HTML5 viewer on any device
with a modern web browser (Mac OSX, Windows, Linux, Android, iOS, ChromeOS,
...). It can be used to expose a graphical interface from a Docker container
or to run continuous integration tests that require a graphical environment.
Execute the run.sh script.
By default, the run.sh start up the graphical session and points the user to
a URL on the local host where they can view and interact with the session. On
application exit, the run.sh will print the application's console output and
exit with the application's return code.
The session runs Openbox <http://openbox.org>_ as a non-root user, user
that has password-less sudo privileges. The browser view is an HTML5 viewer
that talks over websockets to a VNC Server. The VNC Server displays a running
Xdummy session.
To customize the Docker image for your graphical application, set the APP
environmental variable to the shell command required to start the application.
For example::
ENV APP /usr/bin/my-gui-app
The run.sh script can be used to drive start-up. It is customizable with
flags::
Usage: run.sh [-h] [-q] [-c CONTAINER] [-i IMAGE] [-p PORT] [-r DOCKER_RUN_FLAGS]
This script is a convenience script to run Docker images based on thewtex/opengl. It:
Options:
-h Display this help and exit.
-c Container name to use (default opengl).
-i Image name (default thewtex/opengl).
-p Port to expose HTTP server (default 6080). If an empty
string, the port is not exposed.
-r Extra arguments to pass to 'docker run'. E.g.
--env="APP=glxgears"
-q Do not output informational messages.
See the example directory for a derived image and run.sh script that runs the
glxgears OpenGL demo program.
This configuration was largely inspired by the dit4c project <https://dit4c.github.io>_.
Content type
Image
Digest
sha256:5f8e018a8…
Size
404 MB
Last updated
over 8 years ago
docker pull thewtex/opengl