add restart policy to docker compose, add sample dockerfile for demoing features
This commit is contained in:
36
06-building-container-images/Dockerfile.sample
Normal file
36
06-building-container-images/Dockerfile.sample
Normal file
@ -0,0 +1,36 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# escape=\
|
||||
# ^ OPTIONAL "directives" (must be at top if used)
|
||||
|
||||
# THIS IS A COMMENT
|
||||
|
||||
# ARG is the only instruction that can come before FROM
|
||||
ARG BASE_IMAGE_TAG=19.4
|
||||
# ARGs can be overriden at build time
|
||||
# > docker build --build-arg BASE_VERSION=19.3 .
|
||||
|
||||
FROM node:${BASE_IMAGE_TAG}
|
||||
|
||||
RUN echo "Hey Team 👋 (shell form)"
|
||||
RUN ["echo", "Hey Team 👋 (exec form)"]
|
||||
|
||||
# --mount allows for mounting additional files
|
||||
# into the build context
|
||||
# RUN --mount=type=bind ...
|
||||
# RUN --mount=type=cache ...
|
||||
# RUN --mount=type=secret ...
|
||||
# RUN --mount=type=ssh ...
|
||||
|
||||
# Available only at build time
|
||||
# (Still in image metadata though...)
|
||||
ARG BUILD_ARG=foo
|
||||
|
||||
# Available at build and run time
|
||||
ENV ENV_VAR=bar
|
||||
|
||||
# Set the default working directory
|
||||
# Use the convention of your language/framework
|
||||
WORKDIR path/to/the/working/directory
|
||||
|
||||
ENTRYPOINT [ "echo", "Hey Team 👋 (entrypoint)" ]
|
||||
CMD [ "+ (cmd)" ]
|
||||
Reference in New Issue
Block a user