Bitesized Engineering

Share this post

What's inside the Container Image?

www.bitesizedengineering.com

Discover more from Bitesized Engineering

Engineering deep-dives for People in a hurry.
Over 1,000 subscribers
Continue reading
Sign in

What's inside the Container Image?

Chronicles of Containers - Part 8

Mihailo Joksimovic
Jan 23, 2023
2
Share this post

What's inside the Container Image?

www.bitesizedengineering.com
Share

Hey there! 👋

A new week and another deep-dive inside the container space. And this time I’m focused on answering the question that puzzled me forever - what’s INSIDE the Container Image? And as usual - we go with image first and the details below ;)

(click on image to expand)

If you were to just get started with containers, chances are that you’d be told to “run a container by pojnting it to image URL”. Here’s an example from Microsoft docs on how to start your first container:

# Pull the image first (i.e. download it to your local system)
docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022

# Start your container and have fun :)
docker run -it mcr.microsoft.com/windows/nanoserver:ltsc2022

If you execute above two on your Windows system, chances are you’ll end up inside a container:

Now the real question is - what’s inside that image that we just unwrapped into a full-blown filesystem? Luckily, there are two ways to find out - Docker export and containerd’s image export.

Sadly, for reasons completely mysterious to me, former doesn’t really work:

So I had to resort to containerd’s image export:

Perfect! Now you untar it and you can explore the content inside:

We’ll discuss the actual content in the next article. What you need to know though is that the content follows the OCI Image specification (OCI stands for Open Container Initiative and it’s a standard that defines how container-related stuff should work; there’ll be another article about it as well!).

Lastly, I’d like to introduce you to a tool called dive. It’s a free to use tool that can be used to explore the contents and some other attributes of the images:

dive.exe mcr.microsoft.com/windows/nanoserver:ltsc2022

Dive is an extremely powerful tool which is especially useful when you end up with multiple layers abd want to inspect if you can do some space-savings. But more about Layers and other details in the next article!

Until then, if you haven’t already, you might want to subscribe to this newsletter:

Thanks for reading Bitesized Engineering! Subscribe for free to receive new posts and support my work.

If you missed previous articles, here are the last three I published:

Bitesized Engineering
What is Container Network Interface (CNI)?
Hey there! 👋 Previous article gave an intro to Container Networking and now I’d like to focus on CNI (Container Network Interface) specifically. If you were ever to deal with a non-Docker runtime, chances are high you’ve heard of it. So, what is it? As usual, first the image and then the details

Read more
8 months ago · Mihailo Joksimovic
Bitesized Engineering
đˆđ§đ­đ«đš 𝐭𝐹 đ‚đšđ§đ­đšđąđ§đžđ« đđžđ­đ°đšđ«đ€đąđ§đ 
Hey there! 👋 As promised last week, I’m switching gears a bit and moving back to deep-dives in containers :) If you are curious on “WHY” am I switching contexts, it’s actually quite simple - I’m experimenting with this approach where I spend a week or two exploring a topic, and just when I reach the peak of “wow, I can draw a ton of stuff on this topic

Read more
8 months ago · Mihailo Joksimovic
Bitesized Engineering
How do COWs (Containers on Windows) work?
Hey there! 👋 What a better to spend your Sunday than reading a bit on containers, eh? :) I actually planned on sharing this article on Tuesday but it opened so many things to think about that I just couldn’t wait. As usual, here’s an infographic, and the expanded description can be found below it

Read more
8 months ago · Mihailo Joksimovic
2
Share this post

What's inside the Container Image?

www.bitesizedengineering.com
Share
Comments
Top
New
Community

No posts

Ready for more?

© 2023 Mihailo Joksimovic
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing