Dockerfile
Description:
FROM
- Base image, from docker hub
- A valid Dockerfile must start with a
FROM
instruction.
- The image can be any valid image.
COPY
- Copy individual file from source code to image or COPY . .
WORKDIR
- Equivalent to
cd
- The
WORKDIR
instruction sets the working directory for any RUN
, CMD
, ENTRYPOINT
, COPY
and ADD
instructions that follow it in the Dockerfile.
- If the
WORKDIR
doesn’t exist, it will be created even if it’s not used in any subsequent Dockerfile instruction.
RUN
ENV
CMD
- Last command
- Use it for starting the app