20250405 Deck2 Flashcards

1
Q

What does docker-ce provide that docker-ce-cli does not?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is it important to add Docker’s official GPG key and repository instead of using Ubuntu’s default Docker packages?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does sudo usermod -aG docker $USER do, and why is it followed by newgrp docker or logout?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of the ca-certificates package on Linux?

A

It provides trusted Certificate Authority certificates used for verifying HTTPS connections. Without it, secure downloads and communications might fail.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between docker-compose and docker compose?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between systemctl start docker and systemctl enable docker?

A

start runs the Docker service immediately. enable makes Docker auto-start on boot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

If you get ‘Failed to enable unit: Unit file docker.service does not exist,’ what’s likely missing?

A

The docker-ce package (Docker Engine) is missing. Install it with sudo apt install docker-ce containerd.io.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you test if Docker and Docker Compose are working correctly?

A

Use docker run hello-world to test Docker, and docker compose version to test Compose.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the risks of not adding yourself to the Docker group and always using sudo for Docker?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the key components installed when setting up Docker on Linux, and what do they do?

A
  • 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+
How well did you know this?
1
Not at all
2
3
4
5
Perfectly