4 ms·
> How is a container different from just installing all the dependencies along with an application? Once the image is built, you can get another installation t
by vidarh 10y ago
> How is a container different from just installing all the dependencies along with an application?
Once the image is built, you can get another installation that is guaranteed to be identical. You can do that with VM images too, but you can not reasonably do that if you try to install multiple applications side by side in a single VM without further isolation - there are too many ways they can interact.
> Isolation from each other seemed like one advantage, but that's not even security strength isolation so you can't count on it to protect the host OS from malware in a container.
That's only true to the extent that they don't have a long enough track record. Many container technologies do have a decent track record when it comes to security.
But even so there are plenty of reasons for isolation in cases where the security requirements are not the primary reason for further isolation. E.g. making it impossible for an app to accidentally reading/writing files it shouldn't is in itself helpful.
> A claim I often see, and that's repeated here, is that containers can run anywhere. But can they really run in any more places than an ordinary application with dependencies included, or even statically compiled into it? You still need Linux and the same CPU architecture, right?
Try to get an application - statically compiled or not - to run across different Linux distributions, and you will see why this matters.
Needing Linux and the same CPU architecture isn't much of a limiting factor on servers. Being able to not having to account for distribution peculiarities or version differences is a big deal.
- k__ 10y ago> guaranteed to be identical [Citation Needed] As far as I know, this isn't the case. That's why using Nix [0] for deployment is a much saner approach than Docker. But after installation and configuration has been done, containers are a viable technology for the rest. [0] https://blog.wearewizards.io/why-docker-is-not-the-answer-to-reproducible-research-and-why-nix-may-be https://blog.wearewizards.io/why-docker-is-not-the-answer-to...
- dekz 10y agoThe comment you are replying to mentions once the docker image is built, referring to the built layers. These are guaranteed to be identical. Building from scratch, is not always guaranteed to be identical.
- k__ 10y agoAh okay, got this wrong :) Yes, the pre-build images are always identical. Nix starts a step before this with solving the problem, so building from scratch is also guaranteed to be identical.
- paulddraper 10y ago> Try to get an application - statically compiled or not - to run across different Linux distributions, and you will see why this matters. Done. A statically compiled application has no other dependencies.
- elsonrodriguez 10y agoThis is the eventual future. What most people don't realize is that a large part of Docker's value is in being a generic static compiler for languages that don't have that feature. Pretty soon you can expect raw process support in many "container" management systems, where you just provide it a linux binary which are then run in isolated cgroups and namespaces.
- Koshkin 10y agoI think this is too strong a statement. To have "no other dependencies" you would have to statically link in (1) the operating system (including device drivers) and (2) the hardware model, to be absolutely sure. Only virtual machines (possibly including Java VM) can give you such guarantee.
- paulddraper 10y agoAnd do you believe this set of issues doesn't apply to Docker?
- vidarh 10y agoDoes it never do DNS lookups? Open files? Do you not want to tie into process management? Logging? Do you really have no dependencies on a functioning locale? Network settings? Are you sure it won't try to exec anything? An application with no other dependencies is exceedingly rare. Small tools, sure. Sometimes. But even then I see people making silly assumptions all the time, which makes using a container as a suitable straightjacket very useful. E.g. I run all kinds of tools "with no other dependencies" all the time, that turns out to have all kinds of dependencies when you actually try to put it in the smallest container possible.
- deleted 10y ago