Skip to content

Instantly share code, notes, and snippets.

@ShannonScott
Last active April 1, 2020 15:21
Show Gist options
  • Save ShannonScott/29f9c88ce48014f25f756acf8a6cea62 to your computer and use it in GitHub Desktop.
Save ShannonScott/29f9c88ce48014f25f756acf8a6cea62 to your computer and use it in GitHub Desktop.
[PCGen on Docker] Run the D&D character generator PCGen on Docker on a Mac. #tags: mac, docker, games, D&D, java

Run PCGen on Docker on a Mac

Docker Build

Follow the build instructions here: PelkaRepo/pcgen-docker

Running the Image

Follow the instructions here: Running GUI’s with Docker on Mac OS X

In a terminal:

socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

In another terminal:

docker run -it --rm -e DISPLAY=10.0.1.118:0 -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/pcgen:/home/pcgen/export --name pcgen pcgen:latest

NOTE: Volume Mounting Issue

There is an problem with the data volume mount point above. The docker image stores the pcgen code in /home/pcgen/pcgen. So, if we mount that directory to an empty directory on the host, we are missing the pcgen code.

In this situation, you will see the error: Error: Unable to access jarfile pcgen.jar.

A work-around is to mount our local directory as a folder in the pcgen directory. This works, mostly, but requires us to remember to save everything in the export folder.

Super-Hacky Work-Around

There is another (hacky) option. You download a local copy of the pcgen code (say, to ~/pcgen). Then you can run the local code in the docker image directly:

docker run -it --rm -e DISPLAY=10.0.1.118:0 -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/pcgen:/home/pcgen/pcgen --name pcgen pcgen:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment