This project is fully inspired of Marc Douchement's docker-zoom-us, which in turn was inspired by sameersbn Skype's containerization.
Dockerfile
to create a Docker container image with Draw.io desktop for Linux.
The image uses X11 unix domain socket on the host to enable display of the Draw.io desktop app. These components are available out of the box on pretty much any modern linux distribution.
If you find this image useful here's how you can help:
- Send a pull request with your awesome features and bug fixes
- Help users resolve their issues.
Automated builds of the image are available on Dockerhub and is the recommended method of installation.
docker pull olberger/docker-drawio-desktop-linux:latest
Alternatively you can build the image yourself.
docker build -t olberger/docker-drawio-desktop-linux github.com/olberger/docker-drawio-desktop-linux
With the image locally available, install the wrapper scripts by running the following as root:
docker run -it --rm \
--volume /usr/local/bin:/target \
olberger/docker-drawio-desktop-linux:latest install
This will install a wrapper script to launch drawio
.
Launch the drawio-wrapper script to enter a shell inside the Docker container
drawio-wrapper bash
Then the prompt should be displayed like:
Adding user `drawio' to group `sudo' ...
Adding user drawio to group sudo
Done.
bash
launch draw.io by invoking 'drawio' at the bash prompt:
drawio@0b2fefbf45d2:~$
then type drawio
.
Note
If Draw.io is installed on the the host then the host binary is launched instead of starting a Docker container. To force the launch of Draw.io in a container use the
drawio-wrapper
script. For example,drawio-wrapper teams
will launch Draw.io inside a Docker container regardless of whether it is installed on the host or not.
The wrapper scripts volume mount the X11 socket in the launcher container. The X11 socket allows for the user interface display on the host.
When the image is launched the following directories are mounted as volumes
${HOME}/.config/draw.io
- the
${PWD}/diagrams-from-host/
subdir, i.e. a subdir of the current directory
This makes sure that the configuration of the tool are stored on the host and files saved are preserved in the current suddir, if places inside the special 'diagrams-from-host/' directory.
Don't want to expose host's folders to Draw.io application?
Add DRAWIO_HOME
environment variable to namespace all draw.io folders:
export DRAWIO_HOME=${HOME}/draw.io
To upgrade to newer releases:
- Download the updated Docker image:
docker pull olberger/docker-drawio-desktop-linux:latest
- Run
install
to make sure the host scripts are updated.
docker run -it --rm \
--volume /usr/local/bin:/target \
olberger/docker-drawio-desktop-linux:latest install
docker run -it --rm \
--volume /usr/local/bin:/target \
olberger/docker-drawio-desktop-linux:latest uninstall