Dockerized headless version of Draw.io Desktop v22.1.11
Draw.io Desktop exposes a command-line client to allow us to create, check or export diagrams.
Since Draw.io Desktop is a GUI application, we need a GUI environment to run it. And this prevents us to use it for automation in non-GUI environments such as CI tools.
This docker image enables us to run the command-line client in a headless mode by using a configurable X server.
Other minor additions are available
-
Add timeout capability since the application can hang sometimes (due to user action needed in GUI mode)
-
Clear the output log from Electron Security Warning
-
Disable auto-update functionality to avoid unnecessary log
-
Multiple fonts from
Note
|
Want a new font package, modify the Dockerfile to install the missing package.
|
docker run -it -w /data -v $(pwd):/data rlespinasse/drawio-desktop-headless
Environment Variable | Description | Default Value |
---|---|---|
DRAWIO_DESKTOP_COMMAND_TIMEOUT |
To prevent Draw.io Desktop process to hang indefinitely. The value is a floating point number with an optional suffix: 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days. A duration of 0 disables the associated timeout. |
|
XVFB_DISPLAY |
Screen Display setup for XVFB |
|
XVFB_OPTIONS |
Options for Xvfb |
|
ELECTRON_DISABLE_SECURITY_WARNINGS |
Avoid printing electron warning |
|
DRAWIO_DISABLE_UPDATE |
Disable auto-update of Draw.io Desktop |
|
This docker image can be used as the base image to build a higher-level tool upon it.
In addition to running configuration, you have access to
-
DRAWIO_DESKTOP_EXECUTABLE_PATH
to have access to the executable path of Draw.io Desktop. -
DRAWIO_DESKTOP_RUNNER_COMMAND_LINE
to run your script instead of the default one.
-
Docker image rlespinasse/drawio-export which enhance export capabilities of the Draw.io Desktop Headless docker image,
-
And GitHub Action rlespinasse/drawio-export-action which is build on top of drawio-export docker image.
-
Thanks for the community about the workaround docker-image based on Draw.io Desktop.