20250405 Deck2 Flashcards
What does docker-ce
provide that docker-ce-cli
does not?
docker-ce
installs the Docker Engine (daemon), which actually runs containers. docker-ce-cli
only provides the command-line interface. Without docker-ce
, you can’t run containers.
Why is it important to add Docker’s official GPG key and repository instead of using Ubuntu’s default Docker packages?
The official repo provides the latest stable Docker version. The GPG key verifies that packages are authentic and safe. Ubuntu’s default packages may be outdated or incomplete.
What does sudo usermod -aG docker $USER
do, and why is it followed by newgrp docker
or logout?
It adds your user to the docker
group, allowing you to run Docker commands without sudo
. newgrp docker
(or logout/login) applies the group change.
What is the purpose of the ca-certificates
package on Linux?
It provides trusted Certificate Authority certificates used for verifying HTTPS connections. Without it, secure downloads and communications might fail.
What is the difference between docker-compose
and docker compose
?
docker-compose
is the older v1 (Python-based). docker compose
is the newer v2+ (plugin-based) built into the Docker CLI. v2+ is actively maintained and preferred.
What is the difference between systemctl start docker
and systemctl enable docker
?
start
runs the Docker service immediately. enable
makes Docker auto-start on boot.
If you get ‘Failed to enable unit: Unit file docker.service does not exist,’ what’s likely missing?
The docker-ce
package (Docker Engine) is missing. Install it with sudo apt install docker-ce containerd.io
.
How do you test if Docker and Docker Compose are working correctly?
Use docker run hello-world
to test Docker, and docker compose version
to test Compose.
What are the risks of not adding yourself to the Docker group and always using sudo
for Docker?
Using sudo
is more secure but less convenient. Adding yourself to the Docker group allows password-free Docker use, but users in that group have root-like access.
What are the key components installed when setting up Docker on Linux, and what do they do?
-
docker-ce
: Docker Engine (core daemon) -
docker-ce-cli
: Command-line interface -
containerd.io
: Low-level container runtime -
docker-compose-plugin
: Plugin for Docker Compose v2+