{"id":27772303,"url":"https://github.com/dmotte/docker-xfwd","last_synced_at":"2026-04-28T18:03:29.146Z","repository":{"id":290205041,"uuid":"973656816","full_name":"dmotte/docker-xfwd","owner":"dmotte","description":"🐳 Run graphical applications in a Docker container","archived":false,"fork":false,"pushed_at":"2025-04-27T16:41:12.000Z","size":146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-29T23:58:24.857Z","etag":null,"topics":["container","containerized","display","docker","forward","forwarding","graphical","gui","gui-application","podman","rootless","socat","socket","unix","unprivileged","x","x11","xauth","xauthority","xhost"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/dmotte/xfwd","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/dmotte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-27T13:13:25.000Z","updated_at":"2025-04-27T16:41:06.000Z","dependencies_parsed_at":"2025-04-27T15:41:50.070Z","dependency_job_id":null,"html_url":"https://github.com/dmotte/docker-xfwd","commit_stats":null,"previous_names":["dmotte/docker-xfwd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-xfwd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-xfwd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-xfwd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-xfwd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmotte","download_url":"https://codeload.github.com/dmotte/docker-xfwd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251602817,"owners_count":21615963,"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":["container","containerized","display","docker","forward","forwarding","graphical","gui","gui-application","podman","rootless","socat","socket","unix","unprivileged","x","x11","xauth","xauthority","xhost"],"created_at":"2025-04-29T23:58:27.871Z","updated_at":"2026-04-28T18:03:29.140Z","avatar_url":"https://github.com/dmotte.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-xfwd\n\n[![GitHub main workflow](https://img.shields.io/github/actions/workflow/status/dmotte/docker-xfwd/main.yml?branch=main\u0026logo=github\u0026label=main\u0026style=flat-square)](https://github.com/dmotte/docker-xfwd/actions)\n[![Docker Pulls](https://img.shields.io/docker/pulls/dmotte/xfwd?logo=docker\u0026style=flat-square)](https://hub.docker.com/r/dmotte/xfwd)\n\n:whale: Run **graphical applications** in a Docker container.\n\n\u003e :package: This image is also on **Docker Hub** as [`dmotte/xfwd`](https://hub.docker.com/r/dmotte/xfwd) and runs on **several architectures** (e.g. amd64, arm64, ...). To see the full list of supported platforms, please refer to the [`.github/workflows/main.yml`](.github/workflows/main.yml) file. If you need an architecture that is currently unsupported, feel free to open an issue.\n\n## Simple usage\n\nThe simplest way to try this image is:\n\n```bash\ndocker run -d --name=xfwd01 -v/tmp/.X11-unix/X0:/opt/xfwd/host.sock:ro -v\"${XAUTHORITY:?}:/opt/xfwd/host.xauth:ro\" dmotte/xfwd\n```\n\nThen you can install and run some **graphical application** inside the container:\n\n```bash\ndocker exec -it xfwd01 bash -ec 'apt-get update; apt-get install -y x11-apps'\ndocker exec -it -{u,eUSER=}mainuser -{eHOME=,w}/home/mainuser xfwd01 xclock\n```\n\n![Screenshot](screen-01.png)\n\n## Standard usage\n\nThe [`docker-compose.yml`](docker-compose.yml) file contains a complete usage example for this image. Feel free to simplify it and adapt it to your needs. Unless you want to build the image from scratch, comment out the `build: build` line to use the pre-built one from _Docker Hub_ instead.\n\nTo start the Docker-Compose stack in daemon (detached) mode:\n\n```bash\ndocker-compose up -d\n```\n\nThen you can view the logs using this command:\n\n```bash\ndocker-compose logs -ft\n```\n\nThen you can install and run some **graphical application** inside the container:\n\n```bash\ndocker-compose exec main bash -ec 'apt-get update; apt-get install -y x11-apps'\ndocker-compose exec -{u,eUSER=}mainuser -{eHOME=,w}/home/mainuser main xclock\n```\n\nThis image supports **running commands at container startup** by mounting custom scripts at `/opt/startup-early/*.sh` and `/opt/startup-late/*.sh`. This is the same approach used by [dmotte/desktainer](https://github.com/dmotte/desktainer).\n\n## Environment variables\n\nList of supported **environment variables**:\n\n| Variable              | Required               | Description                                                               |\n| --------------------- | ---------------------- | ------------------------------------------------------------------------- |\n| `MAINUSER_NAME`       | No (default: mainuser) | Name of the main user                                                     |\n| `MAINUSER_NOPASSWORD` | No (default: `false`)  | Whether or not the main user should be allowed to `sudo` without password |\n\n## Development\n\nIf you want to contribute to this project, you can use the following one-liner to **rebuild the image** and bring up the **Docker-Compose stack** every time you make a change to the code:\n\n```bash\ndocker-compose down \u0026\u0026 docker-compose up --build\n```\n\n\u003e **Note**: I know that this Docker image has many **layers**, but this shouldn't be a problem in most cases. If you want to reduce its number of layers, there are several techniques out there, e.g. see [this](https://stackoverflow.com/questions/39695031/how-make-docker-layer-to-single-layer)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmotte%2Fdocker-xfwd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmotte%2Fdocker-xfwd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmotte%2Fdocker-xfwd/lists"}