Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker image assumes uid/gid and fails #46

Open
wtfrank opened this issue Feb 9, 2024 · 0 comments
Open

docker image assumes uid/gid and fails #46

wtfrank opened this issue Feb 9, 2024 · 0 comments

Comments

@wtfrank
Copy link

wtfrank commented Feb 9, 2024

I set up an account on a machine

When I run the container I get the following error:

2024/02/09 20:29:08 screeps-launcher  ()
2024/02/09 20:29:08 Loaded config from config.yml
2024/02/09 20:29:08 Installing Node
2024/02/09 20:29:08 Downloading https://nodejs.org/dist/v12.22.12/node-v12.22.12-linux-x64.tar.gz...
2024/02/09 20:29:08   200 OK
2024/02/09 20:29:08   downloaded 0/23131523 bytes (0.00%)
2024/02/09 20:29:08 Download failed: open node-v12.22.12-linux-x64.tar.gz: permission denied
2024/02/09 20:29:08 node-v12.22.12-linux-x64.tar.gz
2024/02/09 20:29:08 node-v12.22.12-linux-x64
2024/02/09 20:29:08 rename deps/node-v12.22.12-linux-x64 deps/node: no such file or directory

This problem is caused by hardcoding differ uids/gids in the Dockerfile


RUN groupadd --gid 1000 screeps \
  && useradd --uid 1000 --gid screeps --shell /bin/bash --create-home screeps \
  && mkdir /screeps && chown screeps.screeps /screeps

On my machine I happen to have different gids
$ id -a
uid=1002(screeps) gid=1001(screeps) groups=1001(screeps),137(docker)

I edited the dockerfile to have the uids/gids from my user, built and tagged the container, then I was able to get further with starting the container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant