screepers / screeps-launcher

Launcher for the Screeps Private Server
MIT License
129 stars 34 forks source link

Docker image does not allow mounting config file #19

Closed mattiekat closed 3 years ago

mattiekat commented 3 years ago

Everything seems to work if I manually put the file where it belongs, but if I follow the docker-compose example and use the volume /path/to/screeps-config.yml:/screeps/config.yml it does not work.

From my reading this is an issue of not creating the file in the docker container itself: https://stackoverflow.com/a/47099098/4404257

To test, use:

version: '3'
services:
  screeps:
    image: screepers/screeps-launcher
    volumes:
      - /path/to/data/screeps:/screeps
      - /path/to/config/screeps-config.yml:/screeps/config.yml
    ports:
      - 21025:21025/tcp
    restart: unless-stopped

And the config:

steamKey: A_VALID_KEY
version: latest
mods:
- screepsmod-admin-utils
- screepsmod-auth
localMods: ./mods

And then run docker-compose up, you should see the error

screeps-service | 2020/12/30 17:42:37 screeps-launcher  ()
screeps-service | 2020/12/30 17:42:37 Loaded config from config.yml
screeps-service | 2020/12/30 17:42:37 Installing Node
screeps-service | 2020/12/30 17:42:37 Downloading https://nodejs.org/dist/v10.23.0/node-v10.23.0-linux-x64.tar.gz...
screeps-service | 2020/12/30 17:42:37   200 OK
screeps-service | 2020/12/30 17:42:37   downloaded 0/21182673 bytes (0.00%)
screeps-service | 2020/12/30 17:42:37 Download failed: open node-v10.23.0-linux-x64.tar.gz: permission denied
screeps-service | 2020/12/30 17:42:37 node-v10.23.0-linux-x64.tar.gz
screeps-service | 2020/12/30 17:42:37 node-v10.23.0-linux-x64
screeps-service | 2020/12/30 17:42:37 rename deps/node-v10.23.0-linux-x64 deps/node: no such file or directory
bastianh commented 3 years ago

the mounting of the config file works for me.

you are mounting the screeps folder and then you are mounting a file inside the already mounted folder... are you sure that's supported ?

mattiekat commented 3 years ago

I suppose the example used volumes and not bindings, so that may be the issue I am encountering. The specific example provided was

volumes:
      - ./config.yml:/screeps/config.yml
      - screeps-data:/screeps
AlinaNova21 commented 3 years ago

In my experience, it does work if /screeps is mounted to a volume. If not mounting as a volume, its best to just remove the config.yml mount and place it in the folder mounted to /screeps

On Wed, Dec 30, 2020 at 12:16 PM Matthew Conover notifications@github.com wrote:

I suppose the example used volumes and not bindings, so that may be the issue I am encountering. The specific example provided was

volumes:

  • ./config.yml:/screeps/config.yml
  • screeps-data:/screeps

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/screepers/screeps-launcher/issues/19#issuecomment-752712416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHXODYVERQERXCY6YJR2WTSXNU6VANCNFSM4VORWMRA .

mattiekat commented 3 years ago

Okay, I should have seen the problem earlier, it is a permission error because it seems that when docker is creating the mount directory it is marking it as readonly or something. So the real fix seems to be running mkdir -p /path/to/screeps first.

Not sure if this is something that you can fix on your end or if this is truly a case of docker + user error.