For building images, we create Dockerfile and add instructions to it.
Detailed description of all instructions to create a Dockerfile are given as follows -
i) You typically start with a “FROM” instruction. This allows you to build on top of a base image.
For example,
FROM node
ii) To run all the subsequent commands where we copy our application, we need to specify working directory. For this, we use the “WORKDIR” instruction.
WORKDIR /app
iii) Next, we specify which files in our application dir should go into the image -
COPY . /app
Here, “.” represents the path where the files to be copied in the image lie and “/app” represents the path inside the image i.e. internal filesystem inside docker container.
iv)