3 ms·
> An aspect of Docker that I don’t really like is that inside the container you are root by default PSA: everyone should turn on the userns option in docker da
by fulafel 8y ago
> An aspect of Docker that I don’t really like is that inside the container you are root by default
PSA: everyone should turn on the userns option in docker daemon settings. It messes with volume mounts but you can turn it off on a per container basis (userns=host) or arrange a manual uid mapping for the mounts.
https://docs.docker.com/v17.12/engine/security/userns-remap/ https://docs.docker.com/v17.12/engine/security/userns-remap/
- wezm 8y agoThank you. I didn’t know about this.
- jxub 8y agoJust create a user in the Dockerfile, change to him and chroot the container application directory to the created user
- fulafel 8y agoThis only works if you trust all your docker images and audit them for root processes. Even then you still have setuid binaries and other privilege escalation risks, if you inherit from dockerhub images etc.
- barrystaes 8y agoI wondered if this is what Unraid already does: yes its mentioned at https://wiki.unraid.net/UnRAID_6/Overview#Containers https://wiki.unraid.net/UnRAID_6/Overview#Containers > The cornerstone of Docker is in its ability to use Linux control groups, namespace isolation, and images to create isolated execution environments in the form of Docker containers. If you want to run dockers at home, i suggest you give it a try. All you need is an old computer and a USB (it runs in RAM). Unraid basically is Linux with a (happy little) webinterface for NAS shares + apps.
- fulafel 8y agoThe web page doesn't read like it's enabling userns-remap, to me.