From bc9afcd6590da612c6a4b81900c783c34716efd1 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 3 Jan 2015 14:17:05 +0000 Subject: [PATCH] [minecraft-server] Issue #9: explicitly adding user in container with UID=1000 --- minecraft-server/.dockerignore | 1 + minecraft-server/Dockerfile | 2 +- minecraft-server/README.md | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 minecraft-server/.dockerignore diff --git a/minecraft-server/.dockerignore b/minecraft-server/.dockerignore new file mode 100644 index 00000000..3af0ccb6 --- /dev/null +++ b/minecraft-server/.dockerignore @@ -0,0 +1 @@ +/data diff --git a/minecraft-server/Dockerfile b/minecraft-server/Dockerfile index a109efe1..a041f803 100644 --- a/minecraft-server/Dockerfile +++ b/minecraft-server/Dockerfile @@ -7,7 +7,7 @@ RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100 RUN wget -O /usr/bin/jsawk https://github.com/micha/jsawk/raw/master/jsawk RUN chmod +x /usr/bin/jsawk -RUN useradd -M -s /bin/false minecraft \ +RUN useradd -M -s /bin/false --uid 1000 minecraft \ && mkdir /data \ && chown minecraft:minecraft /data diff --git a/minecraft-server/README.md b/minecraft-server/README.md index 4b4f9c9d..9c8d87d1 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -44,7 +44,11 @@ to map a directory on your host machine to the container's `/data` directory, su docker run -d -v /path/on/host:/data ... -When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host` and start the server again with `docker start CONTAINERID` to pick up the new configuration. +When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host` +and start the server again with `docker start CONTAINERID` to pick up the new configuration. + +**NOTE**: The files in the attached directory will be owned by the host user with UID of 1000. Be sure +to create that user (such as `adduser --uid 1000 ...` if you don't already have one. ## Versions