Can you please publish an official Docker image that supports GUI & headless operation?

0 votes
asked Apr 11, 2020 in Wanted features by matthewadams12 (240 points)

The requirement of java & graphviz is a bit onerous and unnecessary in the world of Docker.

There are many unofficial plantuml Docker images out there:

Can you please publish an official plantuml Docker image that allow for GUI operation?  You can steal from any of the existing Docker images found in the search above, or start with:

FROM openjdk:14-buster


  apt update && \
  apt install -yy --no-install-recommends \
    graphviz wget ca-certificates fonts-dejavu-core fontconfig xorg libgl1-mesa-glx && \
  apt clean

RUN wget "${PLANTUML_VERSION}/plantuml.${PLANTUML_VERSION}.jar" -O plantuml.jar

RUN ["java", "-jar", "plantuml.jar", "-version"]
RUN ["dot", "-version"]

ENTRYPOINT ["java", "-jar", "/plantuml.jar"]
CMD ["-help"]

Save the above to a file called Dockerfile, then run

docker build -f Dockerfile -t plantuml .

in the directory containing Dockerfile.  I run it with the following script ('nix only):

#!/usr/bin/env sh

THIS_DIR="$(cd "$(dirname "$0")"; pwd)"
PLANTUML_ARGS=${*:--gui -tsvg -o .}

docker run --rm -i \
  -v "$THIS_DIR":/cwd -w /cwd \
  -e DISPLAY="$(ifconfig $IF | egrep '^\s*inet ' | cut -d' ' -f2):0" \
  --entrypoint "java" \

It launches the file open dialog ok, but when I double-click on an entry, nothing happens, and when I use the down arrow then enter to open one, I get the error at the end of this message.

It would be great if y'all could finish this up.


Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

at java.desktop/javax.swing.ImageIcon.<init>(

at java.desktop/javax.swing.ImageIcon.<init>(

at net.sourceforge.plantuml.swing.ImageWindow2.buildScrollablePicture(


1 Answer

0 votes
answered Apr 11, 2020 by plantuml (247,300 points)
Unfortunately, we have little knowledge about Docker, so we probably need help here...

(Anyone can create pull request of new Dockerfiles to )

The error message seems related to missing graphical ressource (see question about X11 in ) But I'm not sure how to fix it. Sorry about that!