docker-minecraft-server: Corrupted world on Windows 11

Describe the problem

After server restart, the server world files are corrupted. Everything works well while running pure Paper server without docker and also running same container on macOS or Linux. Recreating container doesn’t help anything, after server restart I’m getting the same errors.

Container definition

version: "3.8"

services:
  mc:
    image: itzg/minecraft-server:java16
    ports:
      - "25565:25565"
    environment:
      TYPE: PAPER
      VERSION: 1.17.1
      EULA: "TRUE"
      ONLINE_MODE: "FALSE"
      COPY_CONFIG_DEST: /data
    volumes:
      - ./data/mc:/data
      - ./mc:/config

Container logs

Full server log is available here https://teksusik.pl/docker.log

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 37 (14 by maintainers)

Most upvoted comments

I think I got it. It’s because the volumes are stored in the windows filesystem rather than the linux filesystem. When using a WSL2 backend with files stored in the linux filesystem there are no issues. Ps. windows 11 is awesome!

Pretty sure this was the case. For some reason, every time I installed Docker Desktop on my Windows computer, with a single WSL OS installed, it never automatically enabled Docker support for such OS. My recommendation to anyone having this issue is to use Docker from a WSL OS directly.

If you are new to Docker on Windows 11:

  • install Docker Desktop
  • if you get a prompt saying WSL isn’t enabled on your system, you can enable it on the most recent versions of Windows 11 by looking for the ‘WSL 2’ app on the Microsoft Store; if that doesn’t work, follow the guide linked by the prompt on the Docker Desktop installation
  • install any distro of your liking, for example Debian or Ubuntu; you can find these on the Microsoft Store
  • after installing and configuring your distro (simply search for the distro name and open it as you would do with any other application), go to Docker Desktop > Settings > Resources > WSL Integration, and enable the integration for the distro you just installed
  • when running commands, you can open your distro, or open the newly released Terminal app on Windows 11, making sure you select a docker-enabled distro when opening a tab.
  • you can find your files by going to /mnt/c/. If you want to be able to access the files from windows directly, make sure to use a volume pointing to a folder within /mnt/c/

Small note if you are transitioning to Windows 11 and are worried about your privacy (@itzg ✌️). There is no straight forward way of creating a local account while installing Windows 11 anymore, you’ll have to enter a@a.com as your email when the setup asks you to login with your Microsoft Account, you should get an error and then be allowed to create a local account. When installing apps from the Microsoft Store, if you get a prompt asking you to login, just close it, the apps should install nevertheless. Happy holidays everyone!🎅

Verified this is working fine:

https://user-images.githubusercontent.com/12534357/209533668-6ea46ebf-fdf8-48d0-90e4-89d2ba0e941d.mp4

Luckily my PC doesn’t have compatible hardware to run Windows 11 😉

Agreed, I’m surprised they haven’t resolved this issue by now since it seems like quite a fundamental issue.

Same issue but only for minecraft version 1.18.1

docker-file `version: “3”

services: mc: image: itzg/minecraft-server:latest ports: - 25565:25565 environment: EULA: “TRUE” VERSION: 1.18.1 TYPE: “BUKKIT” MEMORY: “10G” tty: true stdin_open: true restart: unless-stopped volumes: - ./server:/data

attach a directory relative to`

I’m sorry I misunderstood your comment:

I also probably know what’s wrong.

In any case, this is not a problem with the image. It’s either something external or the PaperMC software itself. We can leave this issue open for others to find, but there’s nothing I can do to fix it.