What is a container image?

Takahiro Oda
2 min readDec 28, 2021

--

#all contents come from here

container image

A container image is a tar file containing tar files. Each of the tar file is a layer. Once all tar files have been extract into the same location then you have the container’s filesystem.

Pull the layers onto local system and export the image into the raw tar format.

docker pull redis:3.2.11-alpinedocker save redis:3.2.11-alpine > redis.tar

Then, extract to the disk

tar -xvf redis.tar

all the layer tar files are available. The image includes information like versions.

create empty image

As an image is just a tar file, an empty image can be created, but the container does not have anything, so it can’t start a process.

tar cv --files-from /dev/null | docker import - empty
docker images

--

--

No responses yet