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

Dockerfile, lines 31 & 32 #14

Closed
mrtuborg opened this issue Apr 11, 2017 · 2 comments
Closed

Dockerfile, lines 31 & 32 #14

mrtuborg opened this issue Apr 11, 2017 · 2 comments

Comments

@mrtuborg
Copy link

mrtuborg commented Apr 11, 2017

Seems does not work in macOS Sierra:

Status: Downloaded newer image for crops/poky:latest
Refusing to use a uid less than 101
Traceback (most recent call last):
  File "/usr/bin/usersetup.py", line 66, in <module>
    subprocess.check_call(cmd.split(), stdout=sys.stdout, stderr=sys.stderr)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', 'restrict_useradd.sh', '70', '70', 'pokyuser']' returned non-zero exit status 1

This article has an universal approach, have to avoid using constants in gid and uid:
https://denibertovic.com/posts/handling-permissions-with-docker-volumes/

@rewitt1
Copy link
Contributor

rewitt1 commented Apr 13, 2017

The poky container essentially does a similar thing as in the article linked.

A user is created dynamically to match the uid and gid of the workdir that was passed into the container. And so if you follow the instructions for creating a volume, the uid and gid would be 1000, because the instructions say to explicitly set that uid and gid on the volume. If you didn't run the step to set the uid and gid on the volume, then it defaults to 0.

However, there is also some additional protection used that won't let the uid or gid be less than 101, because those are typically reserved for users that have elevated privileges, including of course 0 or root.

So what looks like happened in your case, is that you were using a volume whose uid/gid are less than 101. And if you were using the instructions step by step most likely meant you perhaps missed the

docker run -it --rm -v myvolume:/workdir busybox chown -R 1000:1000 /workdir

@mrtuborg
Copy link
Author

mrtuborg commented Apr 17, 2017

thanks @rewitt1. This was helpful :)

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