Live data from Hacker News

Tiny Linux distro that runs the entire OS as Docker containers

github.com

101–110 of 177 posts

Re: Tiny Linux distro that runs the entire OS as Docker containers

#101
post #82

Earlier quoted context omitted.

Because then each piece of software you develop is limited to a single process written in a single language. How do you use "process sandboxing with capabilities" to isolate, say, an Erlang process that uses a NIF embedding a shared-memory section to interact with a companion OpenCL C process? With containers (or VMs), the answer is obvious; with POSIX-level isolation primitives, not so much.

http://man7.org/linux/man-pages/man7/capabilities.7.html There are several capabilities in that list to address your problem. Since your question is concerned about memory you can search for "memory" in that page and note the exact capabilities you will need. OpenBSD has even more features ( https://en.wikipedia.org/wiki/OpenBSD_security_features ) alongside the capability model. My gripe is that instead of learning…

Note that my point wasn't about how "your process" can be non-isolated in certain ways using capabilities, such that you could, in theory, sandbox both of those processes individually and have them still do whatever IPC you want; yes, this is certainly possible, and obviously more sensible if one of those processes isn't so much "your" process as it is some other process managed by some other party that you're interacting with.

My point was more about the "developer UX" of needing to isolate things that way. Containers have the semantics of isolating a group of processes, but not performing any internal isolation between the processes in the container. This is almost always what you want—you want "your app" to be able to have multiple processes, and to not have any security boundary between the parts of "your app", just between "your app" and "other apps" or the OS. In other words, you want to have a single "process"—from the OS security subsystem's perspective—whose threads happens to be composed of multiple PIDs, multiple binaries, and multiple virtual-memory mappings. You want to fork(2) + exec(2) without creating a new security context in the process.

Sandboxing would make perfect sense if single processes were always the granularity that "apps" existed at. Sometimes they are. Sometimes they're not, and people do complex things with IPC-capability-objects. And sometimes, when they're not, that fact pushes people toward avoiding multi-process architectures in favor of monolithic apps that reimplement functionality that already exists in some other program in themselves, in order to bring that functionality into their platform/runtime so it can live in their process.

Containers let people avoid this decision, by just applying things like capabilities at the container level, rather than at the process level.

> If someone can explain to me how isolating the system services in docker containers (which by the way are not isolated since they are privileged) does anything above and beyond what capabilities and the security features in OpenBSD provide then I'll concede the point.

Completely apart from the above, my understanding of Rancher is that it's the Docker part of "Docker container", not the container part, that provides the benefit there. Docker is a packaging and service-management system; that its packages use containers is frequently beside the point. Rancher's system services are Docker images (i.e. Docker "packages"), and so you use Docker tooling to create, distribute, manage and upgrade them. If your own application on such a system is managed through Docker, this provides a neat solution to unifying your operations—you just do everything through the docker(1) command.

Re: Tiny Linux distro that runs the entire OS as Docker containers

#102
post #26

This is starting to smell like a system on top of a system to fix something that could be fixed in the system. Kind-of like implementing a filesystem on top op a filesystem... or putting a database on a filesystem to run another filesystem inside the database, or using a webbrowser as a runtime instead of an operating system.

The whole notion of containers is basically this. That's why I am not sure why not just fix the OS. If there's anything to fix in the first place.

Actually, Lennart proposed some years ago exactly how you could "fix" the OS to apply the ideas from containerisation. http://0pointer.net/blog/revisiting-how-we-put-together-linu...

Re: Tiny Linux distro that runs the entire OS as Docker containers

#103
post #26

Earlier quoted context omitted.

The whole notion of containers is basically this. That's why I am not sure why not just fix the OS. If there's anything to fix in the first place.

Actually, Lennart proposed some years ago exactly how you could "fix" the OS to apply the ideas from containerisation. http://0pointer.net/blog/revisiting-how-we-put-together-linu...

This seems horribly complicated and ridiculous especially since when it was written btrfs which was a requirement was pretty terrible.

Re: Tiny Linux distro that runs the entire OS as Docker containers

#104
post #34

Earlier quoted context omitted.

I always felt, perhaps uncharitably, that the point of containers was "those other programmers are idiots so we need to encapsulate everything for the sake of defense"

One huge benefit of containers is that you can treat a program as something atomic: Delete the container and it's gone, as if it were never installed. Modern package management systems like APT spend a lot of effort installing and removing files, and they don't do it completely; any file created by a program after it is installed will not be tracked. You could accomplish the same thing in other ways (as Apple's sandb…

Programs either shouldnt create such files or the if the user created them they shouldn't be removed.

Re: Tiny Linux distro that runs the entire OS as Docker containers

#105
I don't understand why running software on bare metal is viewed as a problem to be solved.

how many layers of abstraction are necessary, and why?

Obviously virtualizing serves a valuable purpose.

Making development more accessible is great. Simplistic dev services like this mean reliance on others infrastructure, and being bound to cloud.

Doesn't seem forward thinking.

Can you imagine if Google had decided to run their search app on Microsoft servers?

Re: Tiny Linux distro that runs the entire OS as Docker containers

#106
post #44

This is starting to smell like a system on top of a system to fix something that could be fixed in the system. Kind-of like implementing a filesystem on top op a filesystem... or putting a database on a filesystem to run another filesystem inside the database, or using a webbrowser as a runtime instead of an operating system.

>Kind-of like implementing a filesystem on top op a filesystem yep, when you want a distributed filesystem building it on top of a good and already working local filesystem is a pretty robust and cheap approach. >smell like a system on top of a system to fix something that could be fixed in the system. container layer is basically a distributed OS. Making a distributed OS by "fixing in the system" is pretty much non-…

How is docker a distributed OS?

Re: Tiny Linux distro that runs the entire OS as Docker containers

#107

Earlier quoted context omitted.

One huge benefit of containers is that you can treat a program as something atomic: Delete the container and it's gone, as if it were never installed. Modern package management systems like APT spend a lot of effort installing and removing files, and they don't do it completely; any file created by a program after it is installed will not be tracked. You could accomplish the same thing in other ways (as Apple's sandb…

Programs either shouldnt create such files or the if the user created them they shouldn't be removed.

Are you saying programs cannot create files? That's nonsensical. /var exists for this purpose.

Re: Tiny Linux distro that runs the entire OS as Docker containers

#108

Earlier quoted context omitted.

It's nothing like that at all. It's just a minimal operating system with a small install image. The only special thing it does is replace the init process with a system-docker process to reduce the overhead of resources used by the operating system. The point isn't really to "run more Docker". It's to eliminate as much operating system overhead as possible, so that nearly every CPU cycle and byte of memory usage is d…

You realize how you're not making any sense. Docker is another abstraction so it can not be better in terms of resource usage than running whatever process you are now running inside docker. You literally have more overhead with the docker approach in terms of all resource utilization. You now have all the overhead of an OS and then you are layering docker on top of it. The OS has not gone away. It is still managing…

Rather it's replacing systems like systemd and various other system daemons with the docker equivalents.

For example why run a network supervision daemon if dockerd or equivalent handle all the important complex pieces of networking via container orchestration? Why have a local package manager, or system port mapper.

Re: Tiny Linux distro that runs the entire OS as Docker containers

#109
post #34

Earlier quoted context omitted.

I always felt, perhaps uncharitably, that the point of containers was "those other programmers are idiots so we need to encapsulate everything for the sake of defense"

One huge benefit of containers is that you can treat a program as something atomic: Delete the container and it's gone, as if it were never installed. Modern package management systems like APT spend a lot of effort installing and removing files, and they don't do it completely; any file created by a program after it is installed will not be tracked. You could accomplish the same thing in other ways (as Apple's sandb…

"Modern package management systems like APT spend a lot of effort installing and removing files, and they don't do it completely"

Well, there /is/ another way to do it.

STATIC LINK ALL THE THINGS

Which would work if licenses and copyrights didn't exist.

Re: Tiny Linux distro that runs the entire OS as Docker containers

#110
post #34

Earlier quoted context omitted.

I always felt, perhaps uncharitably, that the point of containers was "those other programmers are idiots so we need to encapsulate everything for the sake of defense"

tbh, I see the security point in Docker as a huge risk. Basically you're depending on everyone in the chain to regularly recompile your images or you will get compromised eventually. There is no such thing as an apt-get dist-upgrade or any way to create real useful audit logs with Docker. On the other hand, deploying stuff is dead easy now. You just tell the hoster "deploy this Docker package, expose port X as HTTP,…

This is a good reason to build your own rootfs for containers and have as little as possible in them.
Post reply on HN