O'Reilly logo

Docker: Creating Structured Containers by Scott Gallagher, Allan Espinosa, Russ McKendrick, Santosh Kumar Konduri, Vaibhav Kohli, Rajdeep Dua, Neependra Khare, Oskar Hane, Shrikrishna Holla, Vinod Singh, Jeeva S. Chelladhurai, Pethuru Raj

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

Dockerfile

We have seen how to create images by committing containers. What if you want to update the image with new versions of dependencies or new versions of your own application? It soon becomes impractical to do the steps of starting, setting up, and committing over and over again. We need a repeatable method to build images. In comes Dockerfile, which is nothing more than a text file that contains instructions to automate the steps you would otherwise have taken to build an image. docker build will read these instructions sequentially, committing them along the way, and build an image.

The docker build command takes this Dockerfile and a context to execute the instructions, and builds a Docker image. Context refers to the path or source code ...

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