A Docker image based on crux for building application that depend on with GTK.
This image is setup with an entrypoint such that it will automatically create a user account if -e USER is passed to docker run so that your Dockerized app will run as a regular non-root user.
Dockerfile:
FROM crux/gtk
# ...
Create these steps as a script or shell function::
export XSOCK=/tmp/.X11-unix export XAUTH=/tmp/.docker.xauth
touch $XAUTH xauth nlist :0 | sed -e "s/^..../ffff/" | xauth -f $XAUTH nmerge -
docker run -i -t -e DISPLAY -e USER -e XAUTHORITY=$XAUTH -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH --net=host <app>
Example Bash function:
dkx() {
export XSOCK=/tmp/.X11-unix
export XAUTH=/tmp/.docker.xauth
if [ ! -f $XAUTH ]; then
touch $XAUTH
xauth nlist :0 | sed -e "s/^..../ffff/" | xauth -f $XAUTH nmerge -
fi
docker run -i -t -e DISPLAY -e USER -e XAUTHORITY=$XAUTH -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH \
--net=host $@
}
Usage:
dkx <app>
Content type
Image
Digest
sha256:e2a140dd0…
Size
506.6 MB
Last updated
about 7 years ago
docker pull crux/gtk