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

+3 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(


commented Mar 15, 2023 by evantill (480 points)
Do you think of some plantuml CLI wrapper ?

Like running it from the command line "like" if it where installed locally ?

2 Answers

0 votes
answered Apr 11, 2020 by plantuml (295,000 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!
0 votes
answered Mar 12, 2023 by Sébastien Barbieri

I did just publish an how to add graphviz inside a jetty server to host a plantuml service.

Feel free to comment, I'll update accordingly.

The idea is to start from a jetty docker service already configured, it's the easiest.

commented Mar 15, 2023 by plantuml (295,000 points)
Hey, that's very nice and interesting!

Would you mind if we copy your page to in some markdown file (given your credit for it)?

I think it would give a better visibility to your post.

You can even provide a PR yourself if you want, but if you have to time to that, we'll do it for you.
commented Jun 1 by Sébastien Barbieri
Just saw your message :-)

Feel free to integrate everything in plant-UML README if needed.