Only tested for Mac
- docker
- xquartz
docker build -t IMAGE_NAME .
e.g. docker build -t prism .
Open the setting in Xquartz and check the box that says "Allow connections from network clients". Then in terminal 1
xhost + 127.0.0.1
In terminal 2, run the following command to create a single use container
docker run -it --rm -p 22:22 -v $PWD/configs/prism/:/prism/configs/ -v $PWD/configs/prism-games/:/prism-games/configs/ IMAGE_NAME
e.g. docker run -it --rm -p 22:22 -v $PWD/configs/prism/:/prism/configs/ -v $PWD/configs/prism-games/:/prism-games/configs/ prism
To create a persistent container, run the following command (no rm
tag)
docker run -it -p 22:22 -v $PWD/configs/prism/:/prism/configs/ -v $PWD/configs/prism-games/:/prism-games/configs/ --name CONTAINER_NAME IMAGE_NAME
In docker, to run prism
,
cd /prism/prism/bin && ./prism
OR to run prism GUI
cd /prism/prism/bin && ./xprism
To run prism-games
cd /prism-games/prism/bin && ./prism
OR to run prism-games GUI
cd /prism-games/prism/bin && ./xprism
The ssh server is running in the container by default. You can login by connecting to localhost(127.0.0.1) using the username prism
and password prism
. By default, the host's internal port 22
is mapped to container's ssh port 22
. You can change these ports while creating the container in Step 2
.
To check if everything worked, you can try the following inside the container (the second one will only work if PPL was successfully installed):
cd /prism-games/prism
make PPL_DIR=/usr/local/lib
make test testppl
The test should ultimately display: "Testing result: PASS"