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
This commit is contained in:
Geoff Bourne 2015-01-26 03:29:35 +00:00
parent a8c3afbe88
commit 88a796bb44
3 changed files with 6 additions and 4 deletions

View File

@ -1 +1 @@
/data data

View File

@ -16,13 +16,13 @@ EXPOSE 25565
ADD start.sh /start ADD start.sh /start
ADD start-minecraft.sh /start-minecraft ADD start-minecraft.sh /start-minecraft
USER minecraft
VOLUME ['/data'] VOLUME ['/data']
ADD server.properties /tmp/server.properties ADD server.properties /tmp/server.properties
WORKDIR /data WORKDIR /data
CMD [ "/start-minecraft" ] CMD [ "/start" ]
ENV UID 1000
ENV MOTD A Minecraft Server Powered by Docker ENV MOTD A Minecraft Server Powered by Docker
ENV LEVEL world ENV LEVEL world
ENV JVM_OPTS -Xmx1024M -Xms1024M ENV JVM_OPTS -Xmx1024M -Xms1024M

View File

@ -1,4 +1,6 @@
#!/bin/sh #!/bin/sh
set -e 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 exec su -s /bin/bash -c /start-minecraft minecraft