docker image built with`-bt prodction` throws permission denied on `/usr/local/bin/dockerd-entrypoint.sh`
See original GitHub issue🐛 Describe the bug
After building the docker image with production built type as follows:
$ ./build_image.sh -bt production --gpu --tag torchserve:cuda113 -cv cu11
The container runs into the following error at startup:
$ docker run -it -p8080:8080 -p8081:8081 -p8082:8082 \
-v $(pwd)/model_store:/home/model-server/model-store \
torchserve:cuda113 \
torchserve --model-store model-store --models mymodel=mymodel.mar
/bin/bash: /usr/local/bin/dockerd-entrypoint.sh: Permission denied
Note that it works fine with --bt dev
Error logs
$ docker run -it -p8080:8080 -p8081:8081 -p8082:8082 \
-v $(pwd)/model_store:/home/model-server/model-store \
torchserve:cuda113 \
torchserve --model-store model-store --models mymodel=mymodel.mar
/bin/bash: /usr/local/bin/dockerd-entrypoint.sh: Permission denied
Installation instructions
$ git clone git@github.com:pytorch/serve.git
Model Packaing
torch-model-archiver --model-name mymodel \
--version 1.0 \
--serialized-file "model_scripted.pt" \
--handler image_segmenter \
--export-path model_store -f
or equivalent but not relevant as it works in 3 different contexts
config.properties
No response
Versions
master at commit 695b90e5acc8b1afc08cb0f73f8f58b8915b9b52
Repro instructions
$ cd serve/docker
$ ./build_image.sh -bt production --gpu --tag torchserve:cuda113 -cv cu11
$ docker run -it -p8080:8080 -p8081:8081 -p8082:8082 \
-v /home/ubuntu/model_store:/home/model-server/model-store \
torchserve:cuda113 \
torchserve --model-store model-store --models mymodel=mymodel.mar
Possible Solution
Just don’t set the entrypoint maybe as it’s not in the Dockerfile.dev
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How to Fix Docker Permission Denied? - phoenixNAP
Using the docker images command without sudo to check if the Permission Denied command persists. Method 2: Run Docker Commands with sudo.
Read more >Troubleshooting Docker Permission Denied Problems
Launch your terminal and prepend sudo to the docker command below to run the hello-world Docker image. Since you're running an elevated command, ......
Read more >Container permission denied: How to diagnose this error
Learn what is causing a container permissions error and how to work around the issue without resorting to the --privileged flag.
Read more >How to fix docker: Got permission denied issue - Stack Overflow
If you want to run docker as non-root user then you need to add it to the docker group. Create the docker group...
Read more >Avoiding Permission Issues With Docker-Created Files
The user of the container (root in the worst case) is completely different than the one on the host. The file permissions and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
up? I’ve been building my tochserve images this way for about a month now and it works just fine. Otherwise probably best to close this issue.
The
COPY
works fine, it it looks like it’s more to do with how the permissions are set. I managed to get it to work. I bumped into another permission error with the config file. Just add a read permission to the entrypoint and change the ownership of the config file as follows:to
Should I open a PR wit this? I didn’t run all the tests you ask for but I managed to serve a model and run an inference