Dockerfiles

Docker can build images automatically by reading the instructions provided in a Dockerfile,  a document that contains all the commands that are invoked on the command line to assemble an image. All of those commands have to be preceded by the keywords defined in the Dockerfile specification. The following is a list of the most commonly used instructions. They are executed in the order in which they are found in the Dockerfile. Here, we can also append some comments that have to be followed by the # character:

Instruction

Description

FROM

This  initializes a new build stage and sets the base image for subsequent instructions. In fact, every valid Dockerfile has to start with a FROM instruction.

MAINTAINER

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.