How to Modify Docker Images

I presume you are a tad bit familiar with Docker and know basics like running docker containers etc.

In previous articles we have discussed updating docker container and writing docker files.

A container image is built in layers or it is a collection of layers each Dockerfile instruction creates a layer of the image. For example consider the following Dockerfile.

Since there are a total of three Dockerfile commands the image built from this Dockerfile will contain a total of three layers. .

You can confirm that by building the image.

And then using the command docker image history on the built image.

Ignore the last 8216ltmissinggt8217 layer.

Each of these layers is read-only. This is beneficial because since these layers are read-only no process associated with a running instance of this image is going to be able to modify the contents of this image therefore these layers can be shared by many containers without having to keep a copy for each instance. But for the containers8217 processes to be able to perform rw another layer is added on top of the existing RO layers when creating the containers this is writable and not shared by other containers.

...

Read Full Post

News Link: https://linuxhandbook.com/modifying-docker-image/.

Linux Chatter is a news aggregator service that curates some of the best Linux, Cloud, Technical Guides, Hardware and Security news. We display just enough content from the original post to spark your interest. If you like the topic, then click on the 'read full post' button to visit the author's website. Use Linux Chatter to find content from amazing authors!

Note: The content provided has been modified and is not displayed as intended by the author. Any trademarks, copyrights and rights remain with the source.

Disclaimer: Linux Chatter sources content from RSS feeds and personal content submissions. The views and opinions expressed in these articles are those of the authors and do not necessarily reflect those of Linux Chatter.