What is the purpose of containers?
How to configure a Docker container?
Start a docker container.
$ docker-compose up
Shorthand for $ docker-compose build && docker-compose run
How to run docker commands without putting a sudo in front of them?
Add username to docker group.
What is containerization?
The process of distributing and deploying apps in a portable and predictable way. It accomplishes this by packaging components and their dependencies into standardized, isolated, lightweight process environments called containers.
Describe the docker compose workflow.
List the running docker containers.
$ docker-compose ps
What are the main functions of docker compose?
What is a container?
A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings.
Differences between containers and VMs.
Containers:
VMs:
What is a dockerfile?
A dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
List local docker images and inspect them.
$ docker image ls
$ docker inspect [id]
Run services in the background with docker.
$ docker-compose up -d
Explanation of -d: “detached mode”
Run one-off commands for services with docker-compose.
$ docker-compose run [service] [command]
Stop services with docker-compose.
$ docker-compose stop
Stop and remove containers, default network and networks defined in the network section of the compose file with docker-compose. Optional: remove images and volumes.
$ docker-compose down
$ docker-compose down –rmi (local/all) –v