Dockerfile instructions
We will begin with the instruction that every Dockerfile must have at the top, the FROM
instruction.
FROM
This is the first instruction in the Dockerfile. It sets the base image for every subsequent instruction coming next in the file. The syntax for the FROM
instruction is straightforward. It's just:
FROM <image>
, or FROM <image>:<tag>
, or FROM <image>@<digest>
The FROM
instruction takes a tag
or digest
as a parameter. If you decide to skip them, Docker will assume you want to build your image from the latest
tag. Be aware that latest
will not always be the latest version of the image you want to build upon. The latest
tag is kind of a special one. Also, it may not work as you may expect. Well, to cut a long story short, it doesn't mean anything special unless the image creator (openjdk
or fabric8
, for example) has a specific build
, tag
, and push
pattern. The latest
tag assigned to an image simply means that it's the image that was last...