Docker – Understanding Layers

In previous article we explored the basic concepts of docker images and now we will move forward to the building blocks of a docker image i,e. layers.

Layers are the building blocks of docker image, instructions like ADD, COPY and RUN are used to create layers within an image. Layers in an image can be reused.

Docker image layers
Docker image layers

Layers can also be called sub-images and using union filesystem docker will combine all these sub-images (layers) into a single image. Union file system allows overlaying of files and directories from different file systems.

Union Filesystem
Union Filesystem

Using Union Filesystem layers are arranged in a stack, every layer within an image is identified with a layer id and pointers are used to connect layers with each other. Every child layers in an image will have a pointer to it’s parent layer as shown in following diagram.

Docker image - layer pointers
Docker image – layer pointers

Docker keep track of all the files / layers using checksum, while building the image docker will check if an existing layer with matching checksum is available in cache, if yes it will reused instead of creating a new one. This concept of layer reusability makes docker a light weight solution to deploy, run and distribute applications.

Layers are additive in nature, this helps maintain complete history of an image and enables the possibility to rollback to a specific point in history of an image. Docker’s image tagging functionality is used to enable features like history and rollback, we will explore image tagging in upcoming article.

In this article I explained the basics of docker image layers, so now we know that docker images are actually composed of layers. Docker images will have read-only layers, on starting a container docker will use read-only layers of a base image and will add a writeable layer on top of it. In next article we will learn about docker containers.

Shoket Mahmood Ahmed

86 thoughts on “Docker – Understanding Layers

  1. Aw, this was a really good post. Spending some time and actual effort to create a top notch article?but what can I say?I procrastinate a whole lot and never seem to get anything done. Ilse Iorgo Irisa

  2. My family all the time say that I am killing my time here at web, however I know I am getting knowledge all the time by reading such pleasant articles or reviews.| Jackquelin Adham Rose

  3. I am typically to blogging and i actually recognize your content. The article has actually peaks my interest. I am going to bookmark your web site and maintain checking for brand new information. Brooks Yanaton Janean

  4. I together with my buddies happened to be checking out the best secrets found on your web page and so before long developed an awful suspicion I had not thanked the web site owner for those techniques. All of the women happened to be totally passionate to read them and have now seriously been using these things. Thanks for turning out to be indeed kind and also for settling on this kind of perfect things most people are really eager to be informed on. Our own sincere apologies for not expressing appreciation to you earlier. Berri Noland Shelman

  5. Great beat ! I wish to apprentice while you amend your website, how could i subscribe for a blog site? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear concept| Ariella Garv Sacken

  6. After study a couple of of the blog posts on your web site now, and I actually like your approach of blogging. I bookmarked it to my bookmark website checklist and will probably be checking back soon. Pls take a look at my website as effectively and let me know what you think. Stacey Hurleigh Winwaloe

  7. I will right away grab your rss feed as I can not find your email subscription link or e-newsletter service. Do you’ve any? Kindly let me know in order that I could subscribe. Thanks. Bridgette Dominik Ritz

  8. MarvelousWonderfulExcellentFabulousSuperb, what a blogweblogwebpagewebsiteweb site it is! This blogweblogwebpagewebsiteweb site providesgivespresents usefulhelpfulvaluable datainformationfacts to us, keep it up. Shelli Jamey Teodor

  9. Undeniably imagine that which you stated. Your favourite justification appeared to be on the web the easiest thing to take into account of. I say to you, I definitely get irked whilst other folks think about issues that they just do not realize about. You managed to hit the nail upon the highest as well as defined out the entire thing without having side-effects , other folks could take a signal. Will likely be back to get more. Thanks| Fidela Maurizio Sander

  10. This is my first time visitgo to seepay a visitpay a quick visit at here and i am reallyactuallyin facttrulygenuinely impressedhappypleassant to read alleverthing at onealonesingle place. Sheryl Jarrett Liddle

  11. Hey can you please send me the code , i have also looking for this audio to text conversion in C# visual studio.. i have tried above code. but i getting through so many errors, so please help, will b very grateful to you Zuzana Tobie Jo-Ann

  12. Thanks a lot for providing individuals with a very special opportunity to read from this site. It can be so pleasurable and jam-packed with a great time for me and my office mates to search your web site at least thrice weekly to study the latest things you have got. And indeed, I am actually happy concerning the amazing advice served by you. Selected 3 areas in this article are certainly the most efficient we have ever had. Zita Cosmo Nikolai

  13. I was wondering if you ever thought of changing the structure of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or two pictures. Maybe you could space it out better? Perry Tyler Service

  14. This is really interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your excellent post. Also, I have shared your website in my social networks! Florinda Sullivan Tortosa

  15. Hi! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a extraordinary job! Aviva Sayers Oakes

  16. Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your website? My blog is in the exact same niche as yours and my visitors would certainly benefit from some of the information you provide here. Please let me know if this okay with you. Regards! Tawsha Lyn Corine

  17. You write so beautifully, and your postscript brought tears to my eyes. I love good people, and I love good men, and I love the revolution good people can bring. Thanks for the inspiration! Cariotta Mandel Christalle

  18. Simply desire to say your article is as amazing. The clarity in your post is simply excellent and i can assume you are an expert on this subject. Fine with your permission let me to grab your feed to keep up to date with forthcoming post. Thanks a million and please carry on the enjoyable work. Antonietta Boyce Alvin

  19. It is in reality a great and useful piece of information. I am happy that you shared this useful information with us. Please keep us informed like this. Thanks for sharing. Bernita Mikkel Meneau

  20. Hello there. I discovered your site by the use of Google whilst looking for a related matter, your website came up. It appears great. I have bookmarked it in my google bookmarks to come back then. Anne Renaud Lukasz

  21. Nullam at leo tincidunt felis facilisis tincidunt. Nunc sit amet velit metus. Proin posuere, ligula nec porttitor eget luctus, risus lectus tristique ligula, quis pretium elit diam a nisi. Proin vehicula malesuada dolor, vel rutrum. Alisha Levin Derwon

  22. I replaced the flour with oat flour in this recipe and it worked well. I reduced the sugar to 1/3C and it still was very nice. I found 2/3C oil to be too much, though, and would suggest cutting back on that! Jennifer Clim Hola

  23. thanks Lindsay! Sounds so good and sooo easy! No company this year, but still want to make great food! Make so many of your recipes I have lost count! Happy Thanksgiving! Verina Forrester Malory

  24. Hi, why is it that all the “urls submitted by sitemaps” and the “urls on web index” of all my sites went terribly down? Are there any changes made by google on how and how often do they update the data here? Thanks Celie Upton Stephie

  25. Good day! This is my 1st comment here so I just wanted to give a quick shout out and say I truly enjoy reading your blog posts. Can you suggest any other blogs/websites/forums that deal with the same topics? Thank you! Nicolea Alexandros Antonetta

  26. Hiya, I am really glad I have found this info. Today bloggers publish just about gossip and net stuff and this is actually annoying. A good site with interesting content, {that is} what I need. Thank you for making this website, and I will be visiting again. Do you do newsletters? I Cant find it. Vitia Stefan Desdamona

Leave a Reply

Back to top