Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
FROM : To create a base image such as an operating system
RUN: A RUN instruction is used to run specified commands. We can use multiple RUN instructions to run different commands.
CMD: If we need to run a default command that executed for all the containers of the image. If we want to run command during docker run command it overrides the default one.
ENTRYPOINT: If we try to specify default arguments in the docker run command, it will not ignore the ENTRYPOINT arguments.
WORKDIR: when enter inside the container we can specify our working directory using WORKDIR instruction.
COPY: This instruction allows you to copy a file or directory from our local machine to the docker container.
ADD: This is similar to COPY instruction like we can use ADD to copy files and folders from your local machine to docker containers. However, ADD also allows you to copy files from a URL as well as a tar file.
EXPOSE: The EXPOSE instruction inside the dockerfile is listening to the specified port in the network.
LABEL: It is a key-value pair we can use a LABEL instruction to add description or meta data for a docker image.