Docker Tutorials for Beginners | List of Dockefile Instructions or Commands

Опубликовано: 28 Сентябрь 2024
на канале: VRTechnologies For Automation
790
15

FROM
It defines the base image used to start the build process. This is mandatory and must be the first command in the file.
MAINTAINER
It used to write the name and email address of the image creator. This is optional.
RUN
Executes a command and save the result as a new layer.
COPY
It copies source (local file or directory) from Docker host into the Image .
ADD
It Copies a file from the host system into the Image.
Note: Source may be a URL or Directly extract tar file and copies it into the image.
CMD
It can be used for executing a specific command within the container
ENTRYPOINT
It sets a default application to be used every time a container is created with the image.
ENV
Sets environment variables.
ARG
The ARG instruction defines a variable that users can pass at build-time to the builder with the docker build command using the --build-arg varname=value flag
ARG values are not available after the image is built.

EXPOSE 
It associates a specific port to enable networking between the container and the outside world.
USER 
It sets the UID (or username) which is to run the container.
VOLUME 
It is used to enable access from the container to a directory on the host machine.
WORKDIR
It sets the path where the command, defined with CMD, is to be executed.
LABEL 
It allows you to add a label to your docker image.
ONBUILD
A command that is triggered when the image in the Dockerfile is used as a base for another image