GIMP! Running Applications Outside of a Docker Container.

Steven Rescigno
The Startup
Published in
3 min readAug 31, 2020

--

GIMP! Running from a docker container using XQuartz

Making GIMP, a graphic editor program made in 1996 run from a Docker Container using nothing but Debian run on a MacBook Pro Operating System.

FROM debian:buster-slim

RUN apt-get update && apt-get install -y \
gimp \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT [ "gimp" ]

Compile into a built image.

docker build -t gimp . 

Let's write a Docker run command for starting our application.

docker run \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
--net=host \
-v $(PWD)/Pictures:/root/Pictures \
gimp:latest

If you run this command, you would see. An error: cannot open display.

$ docker run \
> -v /tmp/.X11-unix:/tmp/.X11-unix \
> -e DISPLAY=unix$DISPLAY \
> --net=host \
> -v $(PWD)/Pictures:/root/Pictures \
> gimp:latest
Cannot open display:

Before running these commands, ensure x11 is installed or available on your machine. PC and Mac will differ when installing.

Depending on your device you may have (x11) or xQuartz already installed.

Visit https://www.xquartz.org/ direct website for more information. This software is required to run an application from your host machine using…

--

--