From 82b9edcefc8ce17c29872af34c91d1c0925b30ce Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 25 Sep 2020 12:58:37 -0400 Subject: [PATCH] Add Docker Compose --- .dockerignore | 1 + README.md | 2 +- docker-compose.yml | 10 ++++++++++ run.sh | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore index 26df17589..d0c628b46 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ .gitignore Dockerfile README.md +docker-compose.yml diff --git a/README.md b/README.md index dd322882f..902581aa9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ PID="$!" xhost local:root -sudo docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp/.virgl_test:/tmp/.virgl_test -v ~/.minecraft-pi:/root/.minecraft -e DISPLAY=unix${DISPLAY} thebrokenrail/minecraft-pi +sudo docker run -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp/.virgl_test:/tmp/.virgl_test -v ~/.minecraft-pi:/root/.minecraft -e DISPLAY=unix${DISPLAY} thebrokenrail/minecraft-pi kill "${PID}" ``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..493089516 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.7' +services: + minecraft-pi: + image: thebrokenrail/minecraft-pi + volumes: + - '/tmp/.X11-unix:/tmp/.X11-unix' + - '/tmp/.virgl_test:/tmp/.virgl_test' + - '~/.minecraft-pi:/root/.minecraft' + environment: + - 'DISPLAY=unix${DISPLAY}' diff --git a/run.sh b/run.sh index 7fdc95c20..7bf984a25 100755 --- a/run.sh +++ b/run.sh @@ -7,6 +7,6 @@ PID="$!" xhost local:root -sudo docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp/.virgl_test:/tmp/.virgl_test -v ~/.minecraft-pi:/root/.minecraft -e DISPLAY=unix${DISPLAY} thebrokenrail/minecraft-pi +sudo docker-compose up kill "${PID}"