From 88a796bb442879fade4c265448e16a3d74d33a93 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 26 Jan 2015 03:29:35 +0000 Subject: [PATCH] Issue #9: performing usermod to allow for -e provided uid of the minecraft server process * corrected .dockerignore to allow for a $(pwd)/data for local testing of -v --- minecraft-server/.dockerignore | 2 +- minecraft-server/Dockerfile | 4 ++-- minecraft-server/start.sh | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/minecraft-server/.dockerignore b/minecraft-server/.dockerignore index 3af0ccb6..1269488f 100644 --- a/minecraft-server/.dockerignore +++ b/minecraft-server/.dockerignore @@ -1 +1 @@ -/data +data diff --git a/minecraft-server/Dockerfile b/minecraft-server/Dockerfile index a041f803..ef686025 100644 --- a/minecraft-server/Dockerfile +++ b/minecraft-server/Dockerfile @@ -16,13 +16,13 @@ EXPOSE 25565 ADD start.sh /start ADD start-minecraft.sh /start-minecraft -USER minecraft VOLUME ['/data'] ADD server.properties /tmp/server.properties WORKDIR /data -CMD [ "/start-minecraft" ] +CMD [ "/start" ] +ENV UID 1000 ENV MOTD A Minecraft Server Powered by Docker ENV LEVEL world ENV JVM_OPTS -Xmx1024M -Xms1024M diff --git a/minecraft-server/start.sh b/minecraft-server/start.sh index 6ea5976e..62644d28 100755 --- a/minecraft-server/start.sh +++ b/minecraft-server/start.sh @@ -1,4 +1,6 @@ #!/bin/sh + set -e -chown -R minecraft:minecraft /data /start-minecraft +usermod --uid $UID minecraft +chown -R minecraft /data /start-minecraft exec su -s /bin/bash -c /start-minecraft minecraft