User Avatar

Cora Iberkleid 🚢

🌊Kubernetes

2y ago

Developer Advocate at Tanzu by Broadcom focused on Kubernetes and Spring related technologies.

Pulling The Tablecloth Out From Under Your Docker Image (How to Safely Swap Out The OS)
Cora Iberkleid 🚢

Pulling a tablecloth out from under a set table without disturbing the dinnerware is so intimidating I would never even attempt it. I'm sure I'd shatter everything and have to start over with new porcelain and fresh wine glasses.

Dockerfile: Brute Force

Dockerfile is not so shy. Docker images are composed in layers. Imagine the OS is the tablecloth, the runtime is the dinner plate, and your application is the salad plate.

When Dockerfile changes the OS (base image), it ruthlessly throws away all the layers that had been carefully placed on top. Your expensive china shatters to pieces.

What's worse, there's no guarantee that it will be able to recreate the layers precisely. Depending on how your Dockerfile is written, the new china may not completely match. It would be more predictable and less risky not to disturb existing layers at all.

Buildpacks: Set It And Forget It

With Cloud Native Buildpacks, you set your proverbial table once and can rest easy that if the base image is updated, all other layers (certificates, runtime, app, metadata, etc) will remain untouched. This is called "rebasing."

Buildpacks have fine-grained control over image layers and can therefore manage changes more efficiently. For OS updates in particular, they take advantage of a contractual guarantee—known as Application Binary Interface (ABI)—between the base image and other layers that assures compatibility after a rebase.

Security Now

Dockerfile does not provide a mechanism to update all Dockerfiles that reference a base image with a known vulnerability. In contrast, Buildpacks deliver patches to all end users in one fell swoop, because the "engine" that churns your app source code into an image is distributed as a centralized, reusable resource (itself an OCI image). Add to that the fast and non-invasive way Buildpacks update the OS. It's a no-brainer that Cloud Native Buildpacks offer superior security and peace of mind.

You can bet that if I could use Buildpacks to swiftly pull out my tablecloth and keep my dinnerware intact, I'd be performing magic tricks in my dining room right now!