Dockerfile commands
The following list is a similar one, but this time, we are covering the commands you can use in a Dockerfile, and we've arranged it in an order similar to the one you would use when working within the Dockerfile:
FROM <image_name>[:<tag>]: Base the current image on <image_name> LABEL <key>=<value> [<key>=value>...]: Add metadata to the image EXPOSE <port>: Indicate which port should be mapped into the container WORKDIR <path>: Set the current directory for the following commands RUN <command> [ && <command>... ]: Execute one or more shell commands ENV <name>=<value>: Set an environment variable to a specific value VOLUME <path>: Indicates that the <path> should be externally mounted volume COPY <src> <dest>: Copy a local ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access