November 2018
Beginner
230 pages
6h 4m
English
Every Dockerfile must have a FROM instruction, and it must be the first instruction in the file. (Actually, the ARG instruction can be used before a FROM instruction, but it is not a required instruction. We will talk more about that in the ARG instruction section.)
The FROM instruction sets the base for the image being created and instructs the Docker daemon that the base of the new image should be the existing Docker image specified as the parameter. The specified image can be described using the same syntax we saw in the Docker container run command from Chapter 2, Learning Docker Commands. Here, it's a FROM instruction that specifies using the official nginx image with a version of 1.15.2:
# DockerfileFROM nginx:1.15.2 ...
Read now
Unlock full access