factoriotools / factorio-docker

Factorio headless server in a Docker container
https://hub.docker.com/r/factoriotools/factorio/
MIT License
1.08k stars 241 forks source link

Docker for Windows Permissions Issues #501

Open Skyl3lazer opened 1 month ago

Skyl3lazer commented 1 month ago

Good morning,

I'm trying to get this to run through docker for windows. This is my docker compose.

version: '3'
services:
    factorio:
      image: factoriotools/factorio
      restart: unless-stopped
      container_name: factorio
      ports:
        - "34197:34197/udp"
        - "27015:27015/tcp"
      volumes:
       - factorio_volume:/factorio:Z
       - W:\docker\factorio\server-settings.json:/server-settings.json
      environment:
        - INSTANCE_NAME=SkyFactorio
        - INSTANCE_DESC=Skyl3lazer's Factorio Server
        - LOAD_LATEST_SAVE=true
      entrypoint: /bin/sh -c "mkdir -p /factorio/config && envsubst < /server-settings.json > /factorio/config/server-settings.json && exec /docker-entrypoint.sh"
volumes:
    factorio_volume:
        driver: local
        driver_opts:
          o: bind
          type: none
          device: W:\docker\factorio\game

When I run this unfortunately I get a spam of permissions errors which I imagine is related to permissions differences between windows and linux, but I can't figure out why. Docker should give the volume 0777. I see the dockerfile runs the necessary chown commands, what else has to happen on my end?

Here's a sample of the sort of stuff I see.


factorio  |    0.495 Error FileUtil.cpp:467: Couldn't remove /factorio/temp/currently-playing/locale/de: Permission denied
factorio  |    0.499 Warning FileUtil.cpp:444: Permission denied trying to remove /factorio/temp/currently-playing/locale/el. Will set write permissions and try again
factorio  |    0.501 Error FileUtil.cpp:467: Couldn't remove /factorio/temp/currently-playing/locale/el: Permission denied
factorio  |    0.504 Warning FileUtil.cpp:444: Permission denied trying to remove /factorio/temp/currently-playing/locale/en. Will set write permissions and try again
factorio  |    0.506 Error FileUtil.cpp:467: Couldn't remove /factorio/temp/currently-playing/locale/en: Permission denied```
Skyl3lazer commented 1 month ago

I've also updated the permissions on the shared volume, and confirm I can see them if I attach to the container. Note that the factorio folder is correctly owned by the factorio user.

image