diff --git a/.dockerignore b/.dockerignore index d0c628b4..19b11d07 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,6 @@ .gitignore Dockerfile README.md -docker-compose.yml +data +install.sh +build.sh diff --git a/README.md b/README.md index 0b2b7c0c..2a880e6b 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,15 @@ PID="$!" xhost local:root -sudo docker run -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp/.virgl_test:/tmp/.virgl_test -v ~/.minecraft-pi:/root/.minecraft -p 4711:4711/tcp -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 --network host -e DISPLAY=unix${DISPLAY} thebrokenrail/minecraft-pi kill "${PID}" ``` +## Installation +```sh +./install.sh +``` + ## Tweaks The included version of Minecraft: Pi Ediiton is slightly modified to use the touchscreen UI. diff --git a/data/usr/bin/minecraft-pi b/data/usr/bin/minecraft-pi new file mode 100755 index 00000000..a8463ed4 --- /dev/null +++ b/data/usr/bin/minecraft-pi @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +virgl_test_server & +PID="$!" + +xhost local:root + +DOCKER_COMPOSE="docker-compose -f /usr/share/minecraft-pi/docker-compose.yml" + +${DOCKER_COMPOSE} up +${DOCKER_COMPOSE} down + +kill "${PID}" diff --git a/data/usr/share/applications/minecraft-pi.desktop b/data/usr/share/applications/minecraft-pi.desktop new file mode 100755 index 00000000..74b5afc9 --- /dev/null +++ b/data/usr/share/applications/minecraft-pi.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Minecraft: Pi Edition +Comment=Fun with Blocks +Icon=/usr/share/pixmaps/minecraft-pi.png +StartupNotify=false +StartupWMClass=minecraft-pi +Exec=/usr/bin/minecraft-pi +Terminal=false +Type=Application +Categories=Application;Game; diff --git a/docker-compose.yml b/data/usr/share/minecraft-pi/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to data/usr/share/minecraft-pi/docker-compose.yml diff --git a/data/usr/share/pixmaps/minecraft-pi.png b/data/usr/share/pixmaps/minecraft-pi.png new file mode 100644 index 00000000..a4174bf0 Binary files /dev/null and b/data/usr/share/pixmaps/minecraft-pi.png differ diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..db3ac529 --- /dev/null +++ b/install.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +sudo adduser "$(whoami)" docker || : + +sudo cp -r data/. / diff --git a/run.sh b/run.sh deleted file mode 100755 index 1c12cb55..00000000 --- a/run.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -set -e - -virgl_test_server & -PID="$!" - -xhost local:root - -sudo docker-compose up -sudo docker-compose down - -kill "${PID}"