News for hackers. Stuff that matters.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by gumby on Saturday April 29, 2017 @03:03PM (#14228150)
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"
Re:Tiny Linux distro that runs the entire OS as Docker conta... by lobster_johnson on Saturday April 29, 2017 @07:32PM (#14229381)
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 sandboxing tech does), of course.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by bubo_bubo on Saturday April 29, 2017 @09:07PM (#14229661)
"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 conta... by unscaled on Saturday April 29, 2017 @11:50PM (#14230076)
That's one of the main touted benefits of containers (a.k.a build reproducibility). You can view containers as a an overly complicated way to make software with complicated deployment brain-dead easy to deploy.

We're at the point in the hype cycle where it starts getting fashionable to dismiss that as an overkill, but the reality for most of us out there is that most software is way more complicated than a single executable and containers make it easier to deploy complicated software.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by lobster_johnson on Saturday April 29, 2017 @09:27PM (#14229718)
I'm talking about mutations to the file system. Things like database files, logs, /var/run, etc.

Managing internal dependencies (like libraries) is another concern entirely. But containers are good for that, too.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by chainsaw10 on Saturday April 29, 2017 @09:30PM (#14229733)
> Which would work if licenses and copyrights didn't exist.

I don't think it would.

Dynamic linking allows a library to be patched once and have the patch apply to all the programs using it. If every program was statically linked, you would have to update each one individually.

Not to mention the waste of space.

I'm guessing much of that is moot these days, but IMHO it's still something to aim for.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by isostatic on Sunday April 30, 2017 @07:17AM (#14231016)
Patch a library and perhaps you end up breaking some programs that rely on that library.

The benefit of that goes away with containers anyway, you don't share libraries, every instance gets its own install.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by digi_owl on Sunday April 30, 2017 @08:07AM (#14231170)
Could have sworn that _nix already had mechanisms for loading different lib versions side by side...
Re:Tiny Linux distro that runs the entire OS as Docker conta... by digi_owl on Saturday April 29, 2017 @09:42PM (#14229758)
I think GP is being snarky/sarcastic.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by michaelmrose on Saturday April 29, 2017 @08:49PM (#14229619)
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 conta... by lobster_johnson on Saturday April 29, 2017 @08:57PM (#14229631)
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 conta... by mschuster91 on Saturday April 29, 2017 @03:55PM (#14228401)
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, and put a SSL offloader in the front" and that was it, no more "we need <insert long list> to deploy this" or countless hours spent with the hoster on how to get weird-framework-x to behave correctly.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by voltagex_ on Saturday April 29, 2017 @09:14PM (#14229683)
This is a good reason to build your own rootfs for containers and have as little as possible in them.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by gunnihinn on Saturday April 29, 2017 @06:14PM (#14229062)
I work in a big company. It's much easier for us to spin up a container to run whatever experimental program we've thought might be useful to help us do our job than to provision a real box for it to run on or fit it into the whole bureaucracy.

If it's actually useful we'll find someplace for it to live (or just in containers if that's all that's needed). If not, finding that out was cheap.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by gumby on Saturday April 29, 2017 @07:22PM (#14229347)
This is a more charitable interpretation of what I meant: "we can quickly test the value of an idea via a prototype without the cost of making it super well behaved in other areas." Which is an excellent application of containers!

I just sometimes wonder if the cart hasn't gotten in front of the horse on the whole container front. The fact that the term "bare iron" has been hijacked to mean "not under virtualization" made me start to think that something is seriously fucked up.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by digi_owl on Saturday April 29, 2017 @09:27PM (#14229716)
It very much has. Mix it in with devops and agile, and before you know it everyone is throwing hot code directly to "prod"...
Re:Tiny Linux distro that runs the entire OS as Docker conta... by concede_pluto on Saturday April 29, 2017 @06:41PM (#14229172)
If you have machines with unused capacity, why would deploying a docker container image be easier than deploying a RPM package?
Re:Tiny Linux distro that runs the entire OS as Docker conta... by wmf on Saturday April 29, 2017 @07:21PM (#14229345)
Because either there is no RPM or the RPM conflicts with other RPMs on the machine.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by darkr on Sunday April 30, 2017 @07:32AM (#14231063)
There is software collections for RPMs, which is basically namespacing. Can have quite an operational overhead if the thing you want to install has a lot of dependencies though.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by dkarapetyan on Saturday April 29, 2017 @07:37PM (#14229409)
Sounds like then you should learn what a chroot is. All the existing linux platforms already provide the solution to your exact problem with much less overhead than docker.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by chubot on Saturday April 29, 2017 @11:46PM (#14230068)
I agree this is possible, but the tools are somewhat obscure and slow. You can debootstrap in a chroot and then install packages, but it takes a long time, and likely re-downloads hundreds of megabytes packages you already have on the system.

I don't like Docker, but I think it does some differential compression with the layers when you are modifying the image. So you don't have to re-do this install from scratch.

You may also run into issues with user IDs and various system config files in the chroot. Configuring the service with flags, env vars, and config files is a bit of a pain.

Docker is essentially a glorified chroot... I've essentially tried to rebuild it, and it is unfortunately a lot of work.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by coldtea on Saturday April 29, 2017 @10:27PM (#14229885)
Only that chroot wont also run on the development machine, running a totally different OS.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by concede_pluto on Sunday April 30, 2017 @02:39PM (#14233137)
This is a self-inflicted problem. 787 engineers don't have to test their work on a Learjet.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by dozzie on Saturday April 29, 2017 @06:41PM (#14229169)
You do realize that the scenario you have described could be carried out with chroot just as easily, right? The only way "containers" help (and not containers as is, but Docker specifically) is that they ship the whole chroot OS image with all the dependencies.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by hamburglar on Saturday April 29, 2017 @07:35PM (#14229399)
I think the "just as easily" is highly debatable. I'm not a container evangelist by any stretch, but if you were going to take a "just chroot it" approach, the very first thing you'd want to do to ease the operational burden is define some kind of standard app packaging format that defines what's in the chroot and an entry point and an environment, and maybe some scheme for mapping external data and various other niceties you get with containers, and at that point, congratulations, you've reinvented containers.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by dozzie on Saturday April 29, 2017 @08:05PM (#14229487)
> I think the "just as easily" is highly debatable.

Heads up, you're talking about a different thing. You want to run these things as normal operations, but gunnihinn was talking about deploying an application to check if it is of any value. Chroot is just enough to make a mess as the application's developer instructed in INSTALL.txt without the need to worry about cleaning up afterwards.

And by the way, you seem to be confusing containers and Docker.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by hamburglar on Saturday April 29, 2017 @09:31PM (#14229736)
I disagree. Just google "doesn't work in chroot" and you'll be reminded of a litany of issues that come up when trying to build/run things in a chroot, and a container containing a linux distro makes a tidy little sandbox which generally avoids those issues. It's somewhere on a spectrum between a chroot and a VM, which I think a lot of people find value in.

And I'm not confusing containers and Docker, I'm just speaking a bit imprecisely. In my experience, conversations about "containers" are rarely about raw containers, but rather some specific containerization scheme and tools (e.g. docker). I suspect everyone in this entire subthread means "docker containers" when they says "containers."

Re:Tiny Linux distro that runs the entire OS as Docker conta... by dozzie on Sunday April 30, 2017 @07:33AM (#14231070)
> Just google "doesn't work in chroot" and you'll be reminded of a litany of issues that come up when trying to build/run things in a chroot

Yeah, some newbie forgot to mount-bind a necessary directory like /proc or /dev, didn't provide sensible /etc/resolv.conf, or messed up host's and chroot's paths, either in request or in configuration. Nothing that would render chroot unviable. Is this what you meant?

Re:Tiny Linux distro that runs the entire OS as Docker conta... by jstarks on Sunday April 30, 2017 @05:49PM (#14234035)
Why would anyone want to get all that right manually when containers manage all that automatically?
Re:Tiny Linux distro that runs the entire OS as Docker conta... by dozzie on Monday May 01, 2017 @07:40AM (#14236846)
Good question. Why anyone presented with fancy and fashionable third party software would use a mechanism that has been present for decades, ships with the operating system, works reliably and predictably, doesn't change substantially every quarter, doesn't do any magical things to network configuration, and is easy to inspect, debug, and adjust for an outsider? Why indeed?
Re:Tiny Linux distro that runs the entire OS as Docker conta... by dkarapetyan on Saturday April 29, 2017 @07:17PM (#14229325)
So you have an organizational problem and you're hacking one problem with another hack. Clearly nothing can go wrong with this approach.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by gumby on Saturday April 29, 2017 @07:22PM (#14229348)
I don't see that as an organizational problem, but a way to try something out safely and faster.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by dkarapetyan on Saturday April 29, 2017 @07:26PM (#14229358)
I was referring to how they are unable to provision the right resources to run experiments because of all the red tape and they are getting around the issue by using docker. What happens when the red tape guard get wind of this?
Re:Tiny Linux distro that runs the entire OS as Docker conta... by ChuckMcM on Saturday April 29, 2017 @04:21PM (#14228539)
I don't think so. Consider that computers are generally so powerful these days that when running a single application stack their seriously under utilized. The first way people went about getting this going was Virtual Machines (made popular by IBM with its VM/370 OS :-) and that works well but when all of your clients are running the exact same OS down to the same version, it is kind of waste to have 'n' copies of the OS loaded, so containers are a 'semantic' fractioning of the resources where the OS is common but the set of processes are unique to a client. You still need a way to allocate from the single set of resources so containers provide that abstraction.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by dkarapetyan on Saturday April 29, 2017 @04:27PM (#14228569)
What exactly is the problem with process sandboxing and language level VMs? The industry is tackling all the wrong problems. So have we given up on process sandboxing with capabilities? The whole containerization movement is one giant hammer to kill a fly kinda business these days. While you guys are figuring all this out I'm gonna stick with BEAM, JVM, and other tried and true methods. I'll check back in another 5 years to see what this mess has turned into. Maybe that's enough time to figure out how all the overlay networking is working out because, you know, we need a few more overlays between the hardware and the VM.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by derefr on Saturday April 29, 2017 @06:48PM (#14229191)
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.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by dkarapetyan on Saturday April 29, 2017 @06:54PM (#14229218)
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 how to properly use their tools and platforms people have started looking for golden hammers like docker and now we have a mess like RancherOS. 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. My guess is there are no advantages and people are jumping on bandwagons they know nothing about and since the previous generation of tools was not utilized to its full extent neither will all the new docker hotness. People are hammering square pegs into round holes.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by derefr on Saturday April 29, 2017 @08:06PM (#14229491)
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 conta... by digi_owl on Saturday April 29, 2017 @10:01PM (#14229794)
Ugh, "apps". If ever there is a tortured term in computing these days it's that one.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by derefr on Saturday April 29, 2017 @11:37PM (#14230053)
Okay, how about "a purchased software product launched through a GUI"? There's no guarantee that it's a single process, but there's an assumption that it's a single security context.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by ChuckMcM on Sunday April 30, 2017 @02:06PM (#14232937)
Well at Google where a lot of development on containers took place the problems with process sandboxing and language level VMs were machine resource allocation, both in memory and in I/O bandwidth. Lets say you have three "systems" on the box, one is a collection of processes providing elements of a file system, one is a collection of processes providing computation, and one is a collection of processes providing chat services. Now you want to allocate half of the disk i/o to the file services, and a half to the compute system, then 75 percent of the network bandwidth to the chat system, 20 percent to the file system, and the remaining plus any "unused" to the compute system. You want half of the memory in the system to go to the compute system and give the rest to the network file system processes.

That is a complex mix of services running on a machine, some sharing the same flavor of VM, and you're allocating fractions of the total available resource capability to different components. If you cannot make hard allocations that are enforced by the kernel you cannot accurately reason about how the system will perform under load, and if one of your missions is to get your total system utilization to be quite high, you have to run things at the edge.

Re:Tiny Linux distro that runs the entire OS as Docker conta... by justincormack on Sunday April 30, 2017 @05:18AM (#14230760)
Because process sandboxing turned out to be insufficient, and we need layered sandboxing with several levels for protection for security.
Re:Tiny Linux distro that runs the entire OS as Docker conta... by rsync on Sunday April 30, 2017 @11:02AM (#14231851)
"it is kind of waste to have 'n' copies of the OS loaded, so containers are a 'semantic' fractioning of the resources where the OS is common but the set of processes are unique to a client. You still need a way to allocate from the single set of resources so containers provide that abstraction."

Agreed. What I find so odd is that this problem was simply and elegantly solved in BSD with 'jail' and everyone went about their business.

I do not understand why (what appears to be) the linux answer to 'jail' is so complicated and fraught and the subject of so much discussion.

I am not sure that containers and their build scripts represent the $huge_profit_potential that people think they do ...

Re:Tiny Linux distro that runs the entire OS as Docker conta... by thearn4 on Sunday April 30, 2017 @07:08AM (#14230998)
Do you feel the same way about visibility in OOP? E.g. private data and methods?