Live data from Hacker News

Rootless Docker in a multi-user environment

cmtops.dev

31–40 of 50 posts

Re: Rootless Docker in a multi-user environment

#31

Earlier quoted context omitted.

>> Why would those be multi user? For prod, why isnt it cattle where you don't ever SSH onto the server? I hate the cattle not pets analogy, do you know how well taken care of most cattle are? If your operating at google/fb/apple scale then yes you can have this approach. There are lots of business that DON't need, want or have to scale to this level. There are lots of systems where this approach breaks down. Docker…

The "it only happens here" bugs are a symptom of mutable infrastructure.

Boundary conditions, behavior under load, behavior under dynamic load, behavior using real world networks, with real word latency...

If you dont give a shit about your customers (google, FB) where errors at scale dont matter then yes you can believe that.

Most of us dont have that luxury or dont want it.

Re: Rootless Docker in a multi-user environment

#32
post #14

Earlier quoted context omitted.

If it works as I understood, in this setup I can see an advantage at an architectural level: in Podman containers images are stored on a per-user basis, while in this setup they would be shared between users, thus using much less disk space (if using the same base images). Besides this, I actually have the same question.

No both use the exact same techniques to achieve so called "rootless" which is generally considered to be insecure. Rootless docker stores images for the user executing it and that is all, same as podman.

How are they considered insecure?

Re: Rootless Docker in a multi-user environment

#33

I still don't get why multi user. I haven't seen a multi user scenario that makes any sense for any Linux deploy in ages. Is this a shared prod server? Is it a shared Dev server? Why would those be multi user? For prod, why isnt it cattle where you don't ever SSH onto the server? For Dev if you can't just run it all on your local machine why not do something like shipyard.build Somebody tell me what im missing.

>> Why would those be multi user? For prod, why isnt it cattle where you don't ever SSH onto the server? I hate the cattle not pets analogy, do you know how well taken care of most cattle are? If your operating at google/fb/apple scale then yes you can have this approach. There are lots of business that DON't need, want or have to scale to this level. There are lots of systems where this approach breaks down. Docker…

> If your operating at google/fb/apple scale then yes you can have this approach. There are lots of business that DON't need, want or have to scale to this level. There are lots of systems where this approach breaks down.

I used to work at Yandex which is not Google but had hundreds of thousands of servers in runtime nevertheless. So definitely cattle.

Still the CTO of search repeatedly said things like "It's your production? Then ssh into a random instance, attach with gdb and look at the stacks. Is it busy doing what you think it should be doing?"

Dealing with cattle means spending a lot of time in the barn not in the books.

Re: Rootless Docker in a multi-user environment

#34
post #24

This is a lot of work for something that works out of the box with Podman. Of course, using Podman introduces its own idiosyncrasies, and as someone else noted, the benefit of the approach in the article is that all users share an image cache. Source: I use Podman on a workstation where I SSH in as a bunch of different non-root users, and I've never had to think about it working.

I've used rootless podman for development for several months now. I had a few issues in the beginning, but in the end the solutions were rather trivial. I had to: - Delete config files from previous podman versions (pre 4) - Enable the docker socket (for my user) - Use docker compose 2 rather than "podman compose" or an older docker compose (shipped with the distro) We mostly use docker-compose files for our dev setu…

I've switched from using podman-compose to using the podman native way of composing services, which uses Kubernetes style manifests

https://docs.podman.io/en/stable/markdown/podman-kube-genera...

It also lets you generate those manifests from existing containers or pods. No need to learn the compose spec, less friction dev and prod without stop-gap measures like Kompose

Re: Rootless Docker in a multi-user environment

#35
post #15
post #11

Earlier quoted context omitted.

Oh man, Singularity… I once wrote: “In the shipping container analogy, you can think about Singularty containers as if they have no walls.” [1] [1] https://sarusso.github.io/blog/container-engines-runtimes-or...

Well, I'm glad I asked, appreciate your response and great blog post.

Thanks! And don't get me wrong, I really wanted Singularity to work when I started working with it...

Re: Rootless Docker in a multi-user environment

#36
post #14

Earlier quoted context omitted.

If it works as I understood, in this setup I can see an advantage at an architectural level: in Podman containers images are stored on a per-user basis, while in this setup they would be shared between users, thus using much less disk space (if using the same base images). Besides this, I actually have the same question.

No both use the exact same techniques to achieve so called "rootless" which is generally considered to be insecure. Rootless docker stores images for the user executing it and that is all, same as podman.

Ok, but here the OP is doing something a bit different than just rootless Docker, which is to use a "centralised" rootless Docker running as a single, non-privileged user... or am I missing something?

Re: Rootless Docker in a multi-user environment

#37
post #11
post #3

I wonder why people aren't using Singularity containers instead which seem to be rootless by design.

Oh man, Singularity… I once wrote: “In the shipping container analogy, you can think about Singularty containers as if they have no walls.” [1] [1] https://sarusso.github.io/blog/container-engines-runtimes-or...

Your claims here are inaccurate. You can pass flags or define environment variables to get the behavior you want. Please spend some more time hitting the man pages and the guide.

> It indeed does not enforce (or even permit) robust isolation between the containers and the host, leaving large portions exposed. … More in detail, directories as the /home folder, /tmp, /proc, /sys, and /dev are all shared with the host, environment variables are exported as they are set on host, the PID namespace is not created from scratch, and the network and sockets are as well shared with the host. Moreover, Singularity maps the user outside the container as the same user inside it, meaning that every time a container is run the user UID (and name) can change inside it, making it very hard to handle permissions.

Re: Rootless Docker in a multi-user environment

#38
post #15
post #11

Earlier quoted context omitted.

Oh man, Singularity… I once wrote: “In the shipping container analogy, you can think about Singularty containers as if they have no walls.” [1] [1] https://sarusso.github.io/blog/container-engines-runtimes-or...

Well, I'm glad I asked, appreciate your response and great blog post.

Pretty much everything the post says about Apptainer is untrue or inapplicable. See https://apptainer.org/docs/user/main/index.html

Re: Rootless Docker in a multi-user environment

#39
post #11

Earlier quoted context omitted.

Oh man, Singularity… I once wrote: “In the shipping container analogy, you can think about Singularty containers as if they have no walls.” [1] [1] https://sarusso.github.io/blog/container-engines-runtimes-or...

I think singularity is about keeping program dependencies together, not isolation.

I agree to a certain level. However, it's hard to ensure dependencies to work in the right way without isolation. These two support tickets are a showcase of the essence of the problem: "Same container, different results" [1] and "python3 script fails in singularity container on one machine, but works in same container on another" [2]. In my experience with Singularity, there were many issues like these.

I am not sure why they had to call it a "containerization" solution. It gets a bit philosophical, but IMO containers are meant to "contain", not to just package. To me, Singularity is more a "virtual environment on steroids", and it works great in that sense. But it doesn't "contain".

The hard truth is that Singularity was designed more to address a cultural problem in the HPC space (adoption friction and push back of new, "foreign" technologies) rather than to engineer a proper solution the the dependency hell problem.

HPC clusters still use Linux users and shell access, meaning that it is up to the user to run the container: there is just no container orchestration. This means that the user has to issue a command like "singularity run" or "docker run". And since not long time ago, to let users do a "docker run" it meant to have them part of the docker group, which is a near-root access group. Just not doable.

Singularity also works more or less out of the box with MPI in order to run parallel workloads, either locally on multi-nodes. However, this has a huge price as it relies on doing an "mpi singularity run", and it requires to have the same MPI version inside and outside the container. To me, this is this is more a hacky shortcut than a reliable solution.

I believe that the definitive solution in the HPC word will be to let HPC queuing systems to run and orchestrate containers on behalf of the users (including to run MPI workloads), thus allowing to make use of any container engine or runtime, including Docker. I did some trials and it works well, almost completely solving the dependency hell problem and greatly improving scientific reproducibility. A solution like the one presented in the OP contributes in the discussion towards this goal, and I personally welcome it.

With respect to Singularity, I think they just had to name the project "singularity environments" rather than "singularity containers" and everything would have been much more clear.

[1] https://github.com/apptainer/singularity/issues/476 [2] https://github.com/apptainer/singularity/issues/3484

Post reply on HN