3 ms·
The article is correct that there aren't yet best practices about building minimal and secure Docker images, but it seems like switching to unikernels would be
by wmf 12y ago
The article is correct that there aren't yet best practices about building minimal and secure Docker images, but it seems like switching to unikernels would be much more work. Unikernels also suffer from the lack of VM resizing and minimum VM sizes being too big in many cases.
- mato 12y ago<future>I'd like to see $CLOUD selling micro-VMs with burstable memory in the tens of MBs, billed by actual CPU time used, similar to what AWS Lambda does.</future> As for lack of VM resizing, that is a hypervisor/Unikernel implementation detail.
- derefr 12y agoThe problem with micro-VMs in the current world is the overhead of the "control plane" eating most of the VM's capacity. I'm not referring to the "OS stuff" (in Linux, kernel daemons and so forth) but rather the software components any sensibly-engineered application needs if it's going to participate in a larger SOA architecture: logging, queuing, access control, service discovery, load monitoring, subprocess supervision, etc. These things (or at least stub clients for them) need to exist in each and every VM, and making the VM a single-purpose worker drone doesn't eliminate the need for them. If you want to see what happens when you aim for a single-purpose isolated unikernel design, but then bake it fully for operational requirements, look at an (embedded release package of an) Erlang application. There's still a lot of "stuff" there—a lot of attack surface that has nothing to do with achieving the purpose of your app per se—but it's all necessary to keeping your app healthy and stable in the greater ecosystem of services it interacts with. (This is presuming that you can't just shunt off these responsibilities to the hypervisor. If logging means "your unikernel writes to the console and Xen pipes it to rsyslog" then a lot of problems do go away.)
- mwcampbell 12y agoAgreed. The real problem is with the current tools for building images. As a proof of concept, several months ago I built a few tiny Docker images using musl libc and no package manager. But I had do deviate from the normal image build process to do so. http://mwcampbell.us/blog/tiny-docker-musl-images.html http://mwcampbell.us/blog/tiny-docker-musl-images.html
- agumonkey 12y agoHa, I wanted to do something similar to build tiny Virtual Box machines for network labs. I too ended up reading about sabotage linux. Great link !
- shykes 12y agoI am a big fan of these nano-images and really want to support them better in Docker's builder. See "nested builds" and "image squashing". Basically, you should be able to define a Dockerfile for the build environment, then within that define how to produce the final image. Then you need squashing to avoid carrying the build layers. I personally played with aboriginal Linux, but I believe it's the same idea :)
- amirmc 12y ago> Unikernels also suffer from the lack of VM resizing and minimum VM sizes being too big in many cases. Could you clarify what you mean here? Is this specifically a Unikernel problem or an ecosystem problem (in terms of actually trying to deploy Unikernels in the wild)? If so, those seem like different issues and should be discussed separately.
- wmf 12y agoIt's a cloud provider problem, but I don't think a technology can be usefully separated from its ecosystem. The cloud can remain irrational longer than you can remain solvent. On a technical level, VM memory hotplug is probably necessarily slower and flakier (ACPI anyone?) than changing one setting in a cgroup.
- justincormack 12y agoKVM has a memory balloon driver that is pretty simple.