Create Images Flashcards
what are FROM scratch
and FROM ParentImage
?
FROM scratch
is used to create a Base Image and the other is to create and image From ParentImage
https://docs.docker.com/build/building/base-images/
What is a Base Image?
A base image has no parent image specified in its Dockerfile. It is created using a Dockerfile with the FROM scratch
directive.
https://docs.docker.com/glossary/#base-image
What is a Parent Image?
An image’s parent image is the image designated in the FROM
directive in the image’s Dockerfile
https://docs.docker.com/glossary/#parent-image
What is RUN <command>
instruction?
Executes any commands in a new layer on top of the current image and commits the result.
https://docs.docker.com/build/building/packaging/
What is From <image>
instruction?
Defines a base for your image.
https://docs.docker.com/build/building/packaging/
What is WORKDIR <directory>
instruction?
Sets the working directory for any RUN
, CMD
, ENTRYPOINT
, COPY
, and ADD
instructions that follow it in the Dockerfile.
https://docs.docker.com/build/building/packaging/
What is COPY <src> <dest>
instruction?
Copies new files or directories from <src>
and adds them to the filesystem of the container at the path <dest>
.
https://docs.docker.com/build/building/packaging/
What is CMD <command>
instruction?
Lets you define the default program that is run once you start the container based on this image
https://docs.docker.com/build/building/packaging/
what is ARG <name>[=<default value>]
instruction?
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
https://docs.docker.com/engine/reference/builder/#arg
Which istruction is first From
or ARG
?
FROM
Is Possible to set a defaul value on a ARG
instruction.
YESARG var_name=<def value>
Wha is LABEL <key>=<value> <key>=<value> <key>=<value> ...
instruction?
The LABEL
instruction adds metadata to an image
https://docs.docker.com/engine/reference/builder/#label:~:text=LABEL-,%F
What is ADD [--chown=<user>:<group>] [--checksum=<checksum>] <src>... <dest>
instruction?
The ADD
instruction copies new files, directories or remote file URLs from <src>
and adds them to the filesystem of the image at the path <dest>
.
https://docs.docker.com/engine/reference/builder/#add:~:text=ENV-,ADD,-V
what is COPY in Dockerfile command.
[--chown=<user>:<group>] <src>... <dest>
instruction?
The COPY
instruction copies new files or directories from <src>
and adds them to the filesystem of the container at the path <dest>
.
https://docs.docker.com/engine/reference/builder/#copy:~:text=COPY-,%F0%
What is ENTRYPOINT ["executable", "param1", "param2"]
instruction?
An ENTRYPOINT
allows you to configure a container that will run as an executable.
+ ENTRYPOINT ["executable", "param1", "param2"]
+ ENTRYPOINT command param1 param2
https://docs.docker.com/engine/reference/builder/#entrypoint