Docker Flashcards
What is the Docker command to run a container?
docker run image
docker run -d image
Runs the container in detached mode (in the background)
docker run -p 80:80 image
Map port 80 of the host to port 80 in the container
How to make…
docker run -d -p image
…more compact?
docker run -dp image
What is a container?
A process on the host machine that has been isolated from all other processes of the host machine
What does the process isolation leverages?
the kernel namespaces and cgroups
docker ps
List running containers
When running a container, it uses an _____ filesystem.
isolated
The isolated filesystem that a running container uses is provided by…
a container image
Since the image contains the container’s filesystem, it must contain…
everything needed to run an application - all dependencies, configuration, scripts, binaries, etc.
What is chroot?
?
In order to build our application, we need to use a…
Dockerfile
A Dockerfile is a…
text-based script of instructions that is used to create a container image
The CMD directive specifies…
the default command to run when starting a container from this image
The FROM instructions initializes…
a new build stage and sets the Base Image for subsequent instructions