/x11-with-docker

A simple example in how to use the X Window System (X11) with Docker containers

Primary LanguageDockerfile

Running GUI applications in Docker containers

Repository with example Dockerfiles and info to run GUI applications in Docker containers.

Requirements

Usage

First build any of the example Docker images using the Dockerfiles in the root director.

Our goal here is not to implement all the best practices for writing Dockerfiles, and are kept simple for its example purposes.

# Building an Xeyes Docker image
docker build -t xeyes -f xeyes.Dockerfile .

Then run the Docker container, making sure to add the required parameters.

# Build infrastructure
docker run -d --rm \
  -e DISPLAY=$DISPLAY \
  --network host \
  --volume="$HOME/.Xauthority:/root/.Xauthority:rw" \
  xeyes