4 ms·
What's holding back user namespaces with Docker, are containers requiring real root common or is there some other reason it's turned off by default? I guess th
by fulafel 10y ago
What's holding back user namespaces with Docker, are containers requiring real root common or is there some other reason it's turned off by default?
I guess the explanation might be the example image here: it's called "fedora". I thought running whole Linux distributions VM/LXC-style under Docker didn't really work - the Docker people always said you're only supposed run one app per container. Has this changed?
- e1g 10y agoThe core philosophy of "one app per container" has not changed. Strictly speaking, this will never change because containers - whether Docker, ACI, or OCI - are processes and not VMs. I recommend this accessible presentation on how to write a poor-mans Docker by hand[1] to remove some of the magic behind containers. As with any philosophy, there are many smart people who hold an opposite view. Docker itself is perhaps deviating from the architectural simplicity of container==process, while the underdog rkt is enforcing this approach even at the cost of user-land usability (e.g. rkt cannot run containers as daemons by itself). In practice, most containers must have an OS wrapping the application (unless you're distributing binaries), and that OS often ends up being a nearly fully baked version of Ubuntu/Debian/Fedora or whatever the person is most comfortable with outside of Docker. edit PS: One common exception to this philosophy is a short-lived container for admin/management/debugging. Having a full OS with devel/admin tools is useful for investigation/maintenance purposes, then you kill it and nothing is changed in prod. [1] https://www.youtube.com/watch?v=HPuvDm8IC-4 https://www.youtube.com/watch?v=HPuvDm8IC-4
- insaneirish 10y ago> Strictly speaking, this will never change because containers - whether Docker, ACI, or OCI - are processes and not VMs. Who died and made you king of definitions? Use of the word "container" for virtualizing a full OS instance predates [1] Docker, ACI, OCI. [1]: https://us-east.manta.joyent.com/bcantrill/public/ppwl-cantrill-zones.pdf https://us-east.manta.joyent.com/bcantrill/public/ppwl-cantr... (I wouldn't be surprised if there are even earlier IBM or FreeBSD uses of the word "container" with respect to OS virtualization.)
- e1g 10y agoHaha, valid point. My thinking is within the current nomenclature and implementations of "containers" vs "Virtual Machines". These definitions could change drastically in the future.
- icebraining 10y agoEven in the Linux world, OpenVZ has had full OS containers for many years. Cheap VPSs were often just a container with an OS installed in it.
- chucky_z 10y agoso I think a better explanation is 'you should only run one command per container.' Sometimes that involves using one container that you tightly control to do a bunch of different things -- e.g.: "fedora". You may use a base (fully loaded) fedora container to run apache in one container, (fedora:httpd), mysql in another (fedora:mysql), and something like tomcat (fedora:tomcat). The alternative, preferred in some (most?) instances, is to use something like Alpine and bake in the bare minimum of everything for every process. When folks run a bunch of stuff in one container it's typically using something like circus or supervisord running at pid 1.
- vishvananda 10y agoThe main problem with user namespaces is file ownership. User namespaces allow you to shift a range of user ids to a different set of user ids on the host, but there is no way to mount a filesystem with the same set of shifts. This means you have to copy the root filesystem for the container and chown it which is pretty hairy. Note that there have been various proposals to do some kind of shifting at the fs layer[1] but nothing has been finished yet. [1] http://lwn.net/Articles/637431/ http://lwn.net/Articles/637431/
- the_why_of_y 10y agoOn this issue, a more recent status update from James Bottomley at the 2016 Linux Security Summit: https://lwn.net/Articles/700422/ https://lwn.net/Articles/700422/ https://www.youtube.com/watch?v=wfE3JayCejQ https://www.youtube.com/watch?v=wfE3JayCejQ