mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 06:14:14 +00:00
[minecraft-server] Issue #9: explicitly adding user in container with UID=1000
This commit is contained in:
parent
052f80d849
commit
bc9afcd659
3 changed files with 7 additions and 2 deletions
1
minecraft-server/.dockerignore
Normal file
1
minecraft-server/.dockerignore
Normal file
|
@ -0,0 +1 @@
|
|||
/data
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue