{"id":15652125,"url":"https://github.com/rlespinasse/docker-drawio-desktop-headless","last_synced_at":"2026-04-02T11:24:11.054Z","repository":{"id":41424391,"uuid":"333220963","full_name":"rlespinasse/docker-drawio-desktop-headless","owner":"rlespinasse","description":"Headless version of drawio-desktop","archived":false,"fork":false,"pushed_at":"2024-10-27T11:00:33.000Z","size":277,"stargazers_count":39,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"v1.x","last_synced_at":"2024-10-29T21:10:25.080Z","etag":null,"topics":["docker-base-image","docker-image","drawio","drawio-tools","hacktoberfest","headless"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/rlespinasse/drawio-desktop-headless","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rlespinasse.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"rlespinasse"}},"created_at":"2021-01-26T21:23:02.000Z","updated_at":"2024-10-27T10:35:43.000Z","dependencies_parsed_at":"2023-10-22T03:24:04.915Z","dependency_job_id":"c008d27a-4edf-4ae8-b5aa-d287c4d9e014","html_url":"https://github.com/rlespinasse/docker-drawio-desktop-headless","commit_stats":{"total_commits":95,"total_committers":4,"mean_commits":23.75,"dds":"0.18947368421052635","last_synced_commit":"a56304223197eb3c40be7931a7e6c5e3545c3727"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlespinasse%2Fdocker-drawio-desktop-headless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlespinasse%2Fdocker-drawio-desktop-headless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlespinasse%2Fdocker-drawio-desktop-headless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlespinasse%2Fdocker-drawio-desktop-headless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rlespinasse","download_url":"https://codeload.github.com/rlespinasse/docker-drawio-desktop-headless/tar.gz/refs/heads/v1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230527875,"owners_count":18240052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-base-image","docker-image","drawio","drawio-tools","hacktoberfest","headless"],"created_at":"2024-10-03T12:41:25.741Z","updated_at":"2026-04-02T11:24:11.049Z","avatar_url":"https://github.com/rlespinasse.png","language":"Shell","funding_links":["https://github.com/sponsors/rlespinasse"],"categories":[],"sub_categories":[],"readme":"= Draw.io Desktop Headless docker image\n\nDockerized headless version of https://github.com/jgraph/drawio-desktop[Draw.io Desktop v29.6.6]\n\n== What it does\n\nDraw.io Desktop exposes a command-line client to allow us to create, check or export diagrams.\n\nSince Draw.io Desktop is a GUI application, we need a GUI environment to run it.\nAnd this prevents us to use it for automation in non-GUI environments such as CI tools.\n\nThis docker image enables us to run the command-line client in a headless mode by using a configurable **X** server.\n\nOther minor additions are available\n\n* Add timeout capability since the application can hang sometimes (due to user action needed in GUI mode)\n* Clear the output log from Electron Security Warning\n* Disable auto-update functionality to avoid unnecessary log\n* Font support via two image variants (see \u003c\u003cImage Variants\u003e\u003e)\n\n== Getting Started\n\nRun the docker image with your current directory mounted as `/data`:\n\n[source,console]\n----\n$ docker run -it -w /data -v $(pwd):/data rlespinasse/drawio-desktop-headless\nUsage: drawio [options] [input file/folder]\n...\n----\n\nExport a Draw.io file to PNG:\n\n[source,console]\n----\n$ docker run -it -w /data -v $(pwd):/data rlespinasse/drawio-desktop-headless \\\n      -x -f png my-diagram.drawio\n----\n\n== How-to Guides\n\n=== Run as non-root user\n\n[source,console]\n----\n$ docker run -it \\\n          -u $(id -u):$(id -g) \\ \u003c1\u003e\n          -e HOME=/data/home -w /data \\ \u003c2\u003e\n          -v /etc/passwd:/etc/passwd \\ \u003c3\u003e\n          -v $(pwd):/data rlespinasse/drawio-desktop-headless\nUsage: drawio [options] [input file/folder]\n...\n----\n\u003c1\u003e Enable non-root user\n\u003c2\u003e env HOME need to contains the path of the working directory (can be the same)\n\u003c3\u003e Needed to run drawio as non-root since v24.4.6\n\n.What if env HOME is not set properly?\n[%collapsible]\n====\n[,console]\n----\nFontconfig error: No writable cache directories\nA JavaScript error occurred in the main process\nUncaught Exception:\nError: Failed to get 'userData' path\n    at initDataListener (/opt/drawio/resources/app.asar/node_modules/electron-store/index.js:15:19)\n    at new ElectronStore (/opt/drawio/resources/app.asar/node_modules/electron-store/index.js:48:32)\n    at Object.\u003canonymous\u003e (/opt/drawio/resources/app.asar/src/main/electron.js:15:15)\n    at Module._compile (node:internal/modules/cjs/loader:1271:14)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1326:10)\n    at Module.load (node:internal/modules/cjs/loader:1126:32)\n    at Module._load (node:internal/modules/cjs/loader:967:12)\n    at l._load (node:electron/js2c/asar_bundle:2:13642)\n    at node:electron/js2c/browser_init:2:120247\n    at node:electron/js2c/browser_init:2:120456\n/opt/drawio-desktop/runner.sh: line 4:    15 Trace/breakpoint trap   (core dumped) \"${DRAWIO_DESKTOP_EXECUTABLE_PATH:?}\" \"$@\" --no-sandbox --disable-gpu\n----\n====\n\n.What if this volume is not set properly?\n[%collapsible]\n====\n[,console]\n----\nA JavaScript error occurred in the main process\nUncaught Exception:\nSystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_get_passwd returned ENOENT (no such file or directory)\n    at new SystemError (node:internal/errors:259:5)\n    at new NodeError (node:internal/errors:370:7)\n    at Object.userInfo (node:os:365:11)\n    at file:///opt/drawio/resources/app.asar/node_modules/atomically/dist/constants.js:10:29\n    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)\n    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)\n    at async node:electron/js2c/browser_init:2:125628\n    at async loadESM (node:internal/process/esm_loader:28:7)\n----\n====\n\n=== Use custom fonts\n\nTo use your own fonts (e.g., proprietary or brand fonts), mount a volume to the custom fonts directory:\n\n[source,console]\n----\n$ docker run -it -w /data \\\n      -v $(pwd):/data \\\n      -v /path/to/my/fonts:/usr/local/share/fonts/custom \\\n      rlespinasse/drawio-desktop-headless\n----\n\nThis works with both the `full` and `minimal` variants.\n\nNOTE: Want to add a system font package instead? Modify the `Dockerfile` to install the missing package.\n\n=== Choose an image variant\n\nThe docker image is available in two font variants to balance image size and language coverage.\n\n* Use **`full`** (tag: `latest`) if your diagrams contain Chinese, Japanese, Korean, or other non-Latin scripts.\n* Use **`minimal`** (tag: `minimal`) for Latin-script diagrams only — significantly smaller image.\n\n[source,console]\n----\n$ docker pull rlespinasse/drawio-desktop-headless:latest\n$ docker pull rlespinasse/drawio-desktop-headless:minimal\n----\n\nSee \u003c\u003cImage Variants\u003e\u003e for the full list of included font packages.\n\n=== Use as docker base image\n\nThis docker image can be used as the base image to build a higher-level tool upon it.\n\nIn addition to running configuration, you have access to\n\n- `DRAWIO_DESKTOP_EXECUTABLE_PATH` to have access to the executable path of Draw.io Desktop.\n- `DRAWIO_DESKTOP_RUNNER_COMMAND_LINE` to run your script instead of the default one.\n\n==== Used by\n\n* Docker image https://github.com/rlespinasse/drawio-export[**rlespinasse/drawio-export**] which enhance export capabilities of the **Draw.io Desktop Headless** docker image,\n** And GitHub Action https://github.com/rlespinasse/drawio-export-action[**rlespinasse/drawio-export-action**] which is build on top of **drawio-export** docker image.\n\n== Reference\n\n=== Image Variants\n\n==== `full` (default) — tag: `latest`\n\nBroad Unicode and CJK coverage.\n\nIncluded font packages:\n\n* https://packages.debian.org/trixie/fonts-liberation[fonts-liberation] — Helvetica/Arial/Times/Courier compatible\n* https://packages.debian.org/trixie/fonts-dejavu-core[fonts-dejavu-core] — broad Unicode fallback\n* https://packages.debian.org/trixie/fonts-noto-core[fonts-noto-core] — Latin, Cyrillic, Greek, Arabic, Devanagari, and more\n* https://packages.debian.org/trixie/fonts-noto-cjk[fonts-noto-cjk] — Chinese, Japanese, Korean\n* https://packages.debian.org/trixie/fonts-arphic-ukai[fonts-arphic-ukai] — Chinese serif\n* https://packages.debian.org/trixie/fonts-arphic-uming[fonts-arphic-uming] — Chinese sans-serif\n* https://packages.debian.org/trixie/fonts-ipafont-mincho[fonts-ipafont-mincho] — Japanese serif\n* https://packages.debian.org/trixie/fonts-ipafont-gothic[fonts-ipafont-gothic] — Japanese sans-serif\n* https://packages.debian.org/trixie/fonts-unfonts-core[fonts-unfonts-core] — Korean\n\n==== `minimal` — tag: `minimal`\n\nWestern fonts only. Significantly smaller image.\n\nIncluded font packages:\n\n* https://packages.debian.org/trixie/fonts-liberation[fonts-liberation] — Helvetica/Arial/Times/Courier compatible\n* https://packages.debian.org/trixie/fonts-dejavu-core[fonts-dejavu-core] — broad Unicode fallback\n\n=== Configuration\n\n[cols=\"2a,3a,1a\",options=\"header\"]\n|===\n\n| Environment Variable\n| Description\n| Default Value\n\n| **DRAWIO_DESKTOP_COMMAND_TIMEOUT**\n| To prevent Draw.io Desktop process to hang indefinitely.\n\nThe value is a floating point number with an optional suffix: 's'\nfor seconds (the default), 'm' for minutes, 'h' for hours or 'd'\nfor days.  A duration of 0 disables the associated timeout.\n| `10s`\n\n| **XVFB_DISPLAY**\n| Screen Display setup for XVFB\n| `:42`\n\n| **XVFB_OPTIONS**\n| Options for Xvfb\n| `-nolisten unix` (enable non-root run)\n\n| **ELECTRON_DISABLE_SECURITY_WARNINGS**\n| Avoid printing https://github.com/electron/electron/blob/master/docs/tutorial/security.md#electron-security-warnings[electron warning]\n| `true`\n\n| **DRAWIO_DISABLE_UPDATE**\n| Disable auto-update of Draw.io Desktop\n| `true`\n\n| **SCRIPT_DEBUG_MODE**\n| Enable `set -x` in internal scripts for debugging purpose\n| `false`\n\n|===\n\n== Thanks to\n\nThanks for the community about https://github.com/jgraph/drawio-desktop/issues/127[the workaround docker-image based on Draw.io Desktop].\n\n== Contributing\n\nPull requests are welcome.\nFor major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlespinasse%2Fdocker-drawio-desktop-headless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frlespinasse%2Fdocker-drawio-desktop-headless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlespinasse%2Fdocker-drawio-desktop-headless/lists"}