Instructions that can be used in the Dockerfile It is not case sensitive. It is customary to use uppercase letters.
FROM <image> [AS <name>]
FROM <image>[:<tag>] [AS <name>]
FROM <image>[@<digest>] [AS <name>]
ESCAPE Specifying escape characters. By default, "" is set.
ENV
Environment variable replacement. It is supported by the following instructions.
RUN
RUN <command>Shell format
RUN ["executable", "param1", "param2"]exec format
CMD ["executable","param1","param2"](exec format, this format is recommended)
CMD ["param1","param2"](As the default parameter for ENTRYPOINT)
CMD command param1 param2 (Shell format)
LABEL <key>=<value> <key>=<value> <key>=<value> ...
EXPOSE <port> [<port>...]
ENV <key> <value>Set one value for one variable
ENV <key>=<value> ...Set the values of multiple variables at once
<src>
to ADD <src>... <dest>
ADD ["<src>",... "<dest>"] <dest>Is specified by an absolute path or a relative path from WORKDIR
COPY <src>... <dest>
COPY ["<src>",... "<dest>"]Specified by absolute path or relative path from WORKDIR
ENTRYPOINT ["executable", "param1", "param2"](Execformat,recommended)
ENTRYPOINT command param1 param2 (shell format)
VOLUME ["/data"]
VOLUME /data
USER <user>[:<group>]
USER <UID>[:<GID>]
WORKDIR /a
WORKDIR b
WORKDIR c
RUN pwd ⇒ This result is "/a/b/c」
ARG <name>[=<default value>]
The following ARG variables are already defined.
HTTP_PROXY
http_proxy
HTTPS_PROXY
https_proxy
FTP_PROXY
ftp_proxy
NO_PROXY
no_proxy
ONBUILD Tori adds instructions to the image. Executed when the image is used as a base image in other builds.
STOPSIGNAL
STOPSIGNAL signal
--SHELL Default shell overwrite setting
SHELL ["executable", "parameters"]
The default shell is
On Linux ["/ bin / sh "," -c "]
On Windows ["cmd "," / S "," / C "]
Recommended Posts