Live data from Hacker News

A 1 KB Docker Container

blog.quickmediasolutions.com

61–70 of 75 posts

Re: A 1 KB Docker Container

#61

We already have a portable container format for executables with no dependencies... It's called an ELF binary... Why would you even put a static binary in a container in the first place? I don't get it.

Even static binaries often have some dependencies, eg SSL root certificates. Plus adding metadata to elf is not that convenient.

Re: A 1 KB Docker Container

#62
post #28

Earlier quoted context omitted.

Interesting. Incidentally, > It was created to test how many containers docker can spin up What was the answer? I'd think on the order of 200-300 on a server with 64 GB of RAM. (Pure guess!)

Depends on several other variables. If you use default docker options, you'll be creating a veth pair per container. You might run into a limit there at around 1024 containers. You also might hit ulimit if your system isn't well configured. If you use --net=none, you won't hit that issue, and you'll probably be able to manage quite a few The resource usage ends up being roughly 4 bytes rss for the executable in the c…

thanks, this was interesting! That's better than I expected.

Re: A 1 KB Docker Container

#63
post #31

Earlier quoted context omitted.

Interesting. Incidentally, > It was created to test how many containers docker can spin up What was the answer? I'd think on the order of 200-300 on a server with 64 GB of RAM. (Pure guess!)

I would expect a 64 gig machine to be able to host 200-300 VMs, and an order or two magnitudes more containers

Well, I was asking what the actual result was. GP (who didn't respond to me) mentioned it was an experiment. TheDong gave experimental results in a reply though.

Re: A 1 KB Docker Container

#64

We already have a portable container format for executables with no dependencies... It's called an ELF binary... Why would you even put a static binary in a container in the first place? I don't get it.

Containers are not just about shipping binaries. In fact, they don't really add too much in that category. Namespace isolation and resource limiting with cgroups are the real benefits.

And in most real world cases, you will still need at least libc and ca-certificates.

Re: A 1 KB Docker Container

#65

Earlier quoted context omitted.

You still need to administer the box it runs on. Offloading that to others is often useful.

I guess you mean something like Compose or Kubernetes. I think it's weird these things force you to use the docker runtime, personally. I would really love a more flexible definition in kubernetes of what a "resource to be ran" means. I know they support multiple container runtimes now, but what if I dont want a container runtime at all? Nomad supports raw executables to be downloaded and scheduled, which is nice( ht…

Kubernetes absolutely does not force you to use the docker runtime. In fact, there has been a lot of work to avoid this by creating the CRI[0].

Kubernetes also supports extensions like the Third Party Resource or their successor, Custom Resource Definitions. KubeVirt[1] is an example of extending resources to include VMs

[0] http://blog.kubernetes.io/2016/12/container-runtime-interfac...

[1] https://github.com/kubevirt/kubevirt

Re: A 1 KB Docker Container

#67
post #33

Earlier quoted context omitted.

> but the bare minimum container that does something useful in practice is rarely less than 100 MB in size. I’ve made containers using code written in most common programming languages (python/go/ruby/c/rust/heck even PHP/etc) which were easily under 100mb, most significantly less. If your containers are frequently >100mb, I say you’re either using the JVM or are doing it wrong!

Actually, even the entire JVM is below 60MB without Jigsaw, with Jigsaw it can go as low as 10MB

Yeah, I can easily make JVM containers under 100mb too usually, but it’s not always that small, so I wanted to give a little benefit of the doubt there.

Re: A 1 KB Docker Container

#68
post #13

The smallest useful container I know of is 129B. It was created to test how many containers docker can spin up while reducing the overhead of what was in the container itself. tianon/sleeping-beauty latest 2e8193709fa7 6 months ago 129B https://github.com/tianon/dockerfiles/tree/master/sleeping-b...

Interesting. Incidentally, > It was created to test how many containers docker can spin up What was the answer? I'd think on the order of 200-300 on a server with 64 GB of RAM. (Pure guess!)

I'll have to ask tianon to see what he says. I don't remember the number.

Re: A 1 KB Docker Container

#69
post #59
post #43

Earlier quoted context omitted.

What happens when you hit the limit? Thrashing swap or oom kills? (And what kind of overcommit policy did you use?)

I didn't hit any limit, but since I don't have swap it would likely be oom kills. The first part of my post is speculating, the second part I ran an arbitrary number and observed resource usage to allow extrapolation, but didn't hit a limit.

Thanks for reproducing the experiment. :) I sent a message to tianon asking him if he remembers what the original numbers were. He told me long ago, I think it was around 1000. This was well before the go shim or dockerd existed.

Re: A 1 KB Docker Container

#70
post #65

Earlier quoted context omitted.

I guess you mean something like Compose or Kubernetes. I think it's weird these things force you to use the docker runtime, personally. I would really love a more flexible definition in kubernetes of what a "resource to be ran" means. I know they support multiple container runtimes now, but what if I dont want a container runtime at all? Nomad supports raw executables to be downloaded and scheduled, which is nice( ht…

Kubernetes absolutely does not force you to use the docker runtime. In fact, there has been a lot of work to avoid this by creating the CRI[0]. Kubernetes also supports extensions like the Third Party Resource or their successor, Custom Resource Definitions. KubeVirt[1] is an example of extending resources to include VMs [0] http://blog.kubernetes.io/2016/12/container-runtime-interfac... [1] https://github.com/kubevi…

And CRI-O [0] is another open project making head way in that space.

[0] https://github.com/kubernetes-incubator/cri-o

Post reply on HN