O'Reilly logo

Docker and Kubernetes for Java Developers by Jaroslaw Krochmalski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

RUN

The RUN instruction is the central executing instruction for the Dockerfile. In essence, the RUN instruction will execute a command (or commands) in a new layer on top of the current image and then commit the results. The resulting committed image will be used as a base for the next instruction in the Dockerfile. As you will remember from Chapter 1, Introduction to Docker, layering is the core concept in Docker. RUN, takes a command as its argument and runs it to create the new layer.

This also means that COPY and ENTRYPOINT set parameters can be overridden at runtime, so if you don't change anything after starting your container, the result will always be the same. RUN however, will be executed at build time and no matter what you do ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required