January 2019
Intermediate to advanced
484 pages
11h 48m
English
A Dockerfile consists of a series of text instructions to guide the Docker daemon to form an image, and a Dockerfile must start with the FROM directive. For example, we may have an image built from the following one-liner:
docker commit $( \ docker start $( \ docker create alpine /bin/sh -c \ "echo My custom build > /etc/motd" \))
This roughly equates to the following Dockerfile:
FROM alpineRUN echo "My custom build" > /etc/motd
Obviously, building with a Dockerfile is much more concise and precise.
The docker build [OPTIONS] [CONTEXT] command is the only command associated with building tasks. A context can be a local path, URL, or stdin, which denotes the location of the Dockerfile. Once a build is triggered, ...
Read now
Unlock full access