Skip to content

Containers (docker / podman)

Copy files from / into a running container

Source

Note

In these examples, $container_id can be found using podman ps.

From

podman cp $container_id:/$path $file

Into

podman cp $file $container_id:/$path

Running GUI apps in containers

docker and podman can be invoked with certain arguments to allow it to render GUI applications in the OS that the container is invoked in.

X11

Source

podman run \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    $image

Wayland

Source

docker run \
    -e XDG_RUNTIME_DIR=/tmp \
    -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY  \
    --user=$(id -u):$(id -g) \
    $image