I thought I understood Docker until I saw the BusyBox docker image

techgnosis picture techgnosis · Oct 22, 2015 · Viewed 30.1k times · Source

I thought I understood Docker. I understood it as a way to package up software with lots of dependencies..to basically create a little world where absolutely everything is taken care of for a piece of software. Then I stumbled upon this on DockerHub

https://hub.docker.com/_/busybox/

It's an image for BusyBox, which is a tiny little Linux binary that is meant for embedded systems. Then the top comment says:

Busybox is awesome :) By far the most useful container per byte on the entire registry.

But I don't understand at all why this image exists, which makes me think that I don't actually understand why Docker exists. What is the point of a BusyBox docker image?

Answer

Charles Duffy picture Charles Duffy · Oct 23, 2015

A Busybox docker image is useful if one is building a container for which busybox can fulfill its dependency chain without needing a full Linux distro.

Often, an embedded appliance can consist of nothing but a statically-linked copy of busybox, an init script that mounts procfs, sysfs, &c. with busybox-provided tools, and then the actual application being invoked. With docker setting up the filesystem namespace, even that init script isn't necessarily needed.