Docker image does not allow mounting config file
mattiekat opened this issue · 4 comments
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
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 ?
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
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.