What are the instructions that create layers in Docker?

Experience Level: Senior
Tags: Docker

Answer

When you run an image and generate a container, you add a new writable layer (the “container layer”) on top of the underlying layers. All changes made to the running container, such as writing new files, modifying existing files, and deleting files, are written to this writable container layer.

Only the following instructions create layers during image build process:
  • COPY
  • RUN
  • CMD

Other instructions create temporary intermediate images, and do not increase the size of the build.

Comments

No Comments Yet.
Be the first to tell us what you think.
Docker instructions
Docker instructions

Are you learning Docker ? Try our test we designed to help you progress faster.

Test yourself