November 2017
Intermediate to advanced
298 pages
7h 10m
English
Our first new directive here is LABEL:
LABEL version="1.0"LABEL org.sgnn7.name="python-webserver"
LABEL <key>=<value> or LABEL <key> <value> is used to add metadata about the image that is being built, which can later be examined and filtered by docker ps and docker images using something like docker images --filter "<key>=<value>". Keys are generally all lowercase in the reverse-dns notation, but you can use anything you want here and version should be present on every image, so we use the top-level version key name. However, the version here is not only there so that we can filter images but also to break Docker's cache if we change it. Without cache-busting of this sort or through the manually set flag during builds ( docker build ...
Read now
Unlock full access