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

$HOME/models is root:root #5

Open
piec opened this issue May 16, 2019 · 2 comments
Open

$HOME/models is root:root #5

piec opened this issue May 16, 2019 · 2 comments

Comments

@piec
Copy link

piec commented May 16, 2019

Hi,
Thanks for this great project

There's just an issue in the instructions when using deepdetect with docker

docker run -d -p 8080:8080 -v $HOME/models:/opt/models jolibrain/deepdetect_cpu

if ~/models doesn't exist it gets created by docker as root:root and dede can't write to it (because it's executed as 1000:1000) which results in

[2019-05-16 12:51:15.318] [api] [info] Downloading init model https://www.deepdetect.com/models/init/ncnn/squeezenet_ssd_voc_ncnn_300x300.tar.gz
[2019-05-16 12:51:15.824] [api] [error] 172.17.0.1 "PUT /services/voc" 400 506
[2019-05-16 12:51:15.945] [api] [error] 172.17.0.1 "POST /predict" 400 0

Workarounds:

  • docker run -d -p 8080:8080 jolibrain/deepdetect_cpu
  • Precreate & chown ~/models:
mkdir ~/models
sudo chown 1000:1000 ~/models
docker run -d -p 8080:8080 -v $HOME/models:/opt/models jolibrain/deepdetect_cpu

The best would be to have deepdetect_cpu's entrypoint to chown by itself

Cheers,
Pierre

@alx
Copy link
Collaborator

alx commented May 16, 2019

Hi Pierre,

thanks for your feedback.

Would it work with the following command ?

docker run -d -p 8080:8080 -u $(id -u ${USER}):$(id -g ${USER}) jolibrain/deepdetect_cpu

If it works, we'll change the command inside the README

Cheers,

Alex

@piec
Copy link
Author

piec commented May 16, 2019

It doesn't, the directory is still created as root:root on the host filesystem (if it doesn't exist beforehands)
I think -u only influences the execution uid/gid of the processes run in 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

2 participants