Jump to content

Trying to get docker user remapping to work or something else to fix permission issues.

Joveice

Hey!
I'm having a bit of issues with docker (Which I have not used before)
My setup is Fedora 34.

I have the web app in source control and I want it mapped inside the containers for them to run in (typical web development). This works but docker makes all files root from which it created (etc logs), this isn't ideal at all.

My co-workers don't have this issue, they are running OSX.

 

What I have tried:
https://docs.docker.com/engine/security/userns-remap/

Docker failed to start, had to reboot and it started again (I could not see that it mentioned it)

 

Now when I run docker-compose -up it runs as when without it until it stops here:
 

ERROR: failed to register layer: ApplyLayer exit status 1 stdout:  stderr: Container ID 7584526 cannot be mapped to a host ID

I ended up finding stuff about user namespaces not beeing enabled by default, but I found nothing on how to enable or check if it was on Fedora 34, closest was CentOS 7.4, and from what I can tell from superuser is that it is then enabled: https://superuser.com/questions/1294215/is-it-safe-to-enable-user-namespaces-in-centos-7-4-and-how-to-do-it
 

$ cat /proc/sys/user/max_user_namespaces 
62834

What am I doing wrong or is there a better way to do this? This seems unnecessarily difficult.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×