teoML
teoML

Reputation: 836

Problems running a docker container (maybe permission issues)

I am new to docker and I was trying to deploy the software (https://github.com/HumanSignal/label-studio) to a debian VM. I followed the instructions here: https://hub.docker.com/r/heartexlabs/label-studio#run-with-docker-compose but it seems like I am getting a permission error after executing:

docker run -it -p 8080:8080 -v `pwd`/mydata:/label-studio/data heartexlabs/label-studio:latest The error log is on this screenshot:

enter image description here

My question is: Is it some docker issue (me not setting permissions to some path) or something else? I tried executing with a root user and thus I expect the permissions to be no problem.

Upvotes: 1

Views: 967

Answers (2)

Alexander L
Alexander L

Reputation: 86

You're facing a permissions issue due to the user inside the container not having the right access to the mounted volume. Instead of running as root, follow these steps:

Change ownership of your local mydata directory to match the user ID (e.g., 1001) inside the container:

sudo chown -R 1001:1001 mydata/

Run the container:

docker run -it -p 8080:8080 -v `pwd`/mydata:/label-studio/data heartexlabs/label-studio:latest

This way, the user inside the container has correct permissions without needing elevated privileges. For further reference please read best practice suggestions in What is the (best) way to manage permissions for Docker shared volumes?

Upvotes: 5

redwards
redwards

Reputation: 258

I got the same thing. Looks like a known issue: https://github.com/HumanSignal/label-studio/issues/3595

They point to this: https://labelstud.io/guide/install.html#PermissionError-Errno-13-Permission-denied-label-studio-data-media

Apparently the latest version requires root.

$ sudo docker run -it --user root -p 8080:8080 -v `pwd`/mydata:/label-studio/data heartexlabs/label-studio:latest chown -R 1001:root /label-studio/data/
$ sudo docker run -it -p 8080:8080 -v `pwd`/mydata:/label-studio/data heartexlabs/label-studio:latest

Also, just opening up the perms on the folder works, but isn't secure.

$ sudo chmod 777 mydata

Upvotes: 1

Related Questions