Dcokerfile memo

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>]
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
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.

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

Dcokerfile memo
Integer memo
docker memo
Lombok memo
Dockerfile memo
Java memo
AWS memo
Ruby memo
Memo Stream
Spring retrospective memo
docker tutorial (memo)
java anything memo
primary key memo
Stream API memo
Docker operation memo
Eclipse trick memo
Java Silver memo
JavaParser usage memo
Docker command memo
Kubernetes/container-related standardization memo
Java SE 7 memo
[Memo] docker summary
MySQL migration memo (1)
WatchService usage memo
java anything memo 2
Docker-compose command memo
[wip] Ruby memo
Maven3 error memo
Java specification memo
JUnit5 usage memo
Java pattern memo