mtoensing / Docker-Minecraft-PaperMC-Server

Starts a Minecraft PaperMC server
https://hub.docker.com/r/marctv/minecraft-papermc-server
MIT License
246 stars 92 forks source link

Server files are unwriteable in rootless mode #102

Closed TippyLion28 closed 8 months ago

TippyLion28 commented 11 months ago

Hi,

My compose file looks like this:

version: '3'

services:
  mcserver:
    image: marctv/minecraft-papermc-server:1.20
    container_name: mcserver
    environment:
      - MEMORYSIZE=1G
      - PUID=1000
      - PGID=1000
    volumes:
      - ./server:/data:rw
    ports:
      - "25565:25565"
    stdin_open: true
    tty: true
    restart: unless-stopped

I am running the container in rootless mode. The server files get created under a UID of 100999:

$ ls -la
total 44
drwxr-xr-x  9 100999 100999 4096 Dec 17 14:37 .
drwxr-xr-x  3 scott  109000 4096 Dec 17 14:37 ..
drwxr-xr-x  2 100999 100999 4096 Dec 17 14:37 cache
drwxr-xr-x  2 100999 100999 4096 Dec 17 14:37 config
-rw-r--r--  1 100999 100999  158 Dec 17 14:37 eula.txt
drwxr-xr-x 11 100999 100999 4096 Dec 17 14:37 libraries
drwxr-xr-x  2 100999 100999 4096 Dec 17 14:37 logs
drwxr-xr-x  2 100999 100999 4096 Dec 17 14:37 plugins
-rw-r--r--  1 100999 100999 1297 Dec 17 14:37 server.properties
drwxr-xr-x  3 100999 100999 4096 Dec 17 14:37 versions
drwxr-xr-x  3 100999 100999 4096 Dec 17 14:37 world

I can't write to these files without root. Is this expected? Am I doing something wrong? Hope somebody can help me here :)

Really nice project! Makes setting up papermc servers so fast and simple especially with compose :)))

mtoensing commented 8 months ago

I think you have to add the environment variable from the "Skip permission change step" in the read me https://github.com/mtoensing/Docker-Minecraft-PaperMC-Server/blob/latest/README.md#skip-permission-change-step

TippyLion28 commented 8 months ago

It was a while since I looked at this, but I remember trying the environment variable and that did not work - The server did not start due to permission issues.