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

85 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. Your mode of describing the whole thing in this paragraph is truly fastidious, all be able to easily know it, Thanks a lot. Modesta Alessandro Tamaru

  5. 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

  6. 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

  7. 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

  8. 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

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

  10. Excellent blog here! Also your site loads up fast! What web host are you using? Can I get your affiliate link to your host? I wish my site loaded up as fast as yours lol Maia Sascha Hilleary

  11. If you are going for best contents like I do, only go to see this web page all the time because it presents feature contents, thanks Melanie Reginald Ryder

  12. 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

  13. 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

  14. 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

  15. 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

  16. 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

  17. 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

  18. 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

  19. 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

  20. 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

  21. 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

  22. 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

  23. Wonderful website. Plenty of useful info here. I am sending it to some buddies ans also sharing in delicious. And obviously, thanks in your effort! Cammie Herbie Lorri

  24. 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

  25. Yes! Could not agree more. There are so many sources out there and Chairish and Instagram sellers are two of the best for sure! Willamina Parke Rudolf

  26. Awesome post. I am a normal visitor of your website and appreciate you taking the time to maintain the nice site. I will be a regular visitor for a long time. Jori Jarib Floeter

  27. 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

  28. Everything is very open with a really clear clarification of the challenges. It was really informative. Your site is very helpful. Thanks for sharing! Tedda Darwin Corvese

  29. 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

  30. 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

  31. 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

  32. Hi, i feel that i saw you visited my site thus i came to go back the prefer?. I am attempting to find things to improve my website!I suppose its adequate to use a few of your ideas!!| Raphaela Bastien Highams

  33. 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

  34. 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

Your email address will not be published. Required fields are marked *

Back to top