Docker Flashcards

1
Q

What type of service are containers and why?

A

Between LaaS and PaaS

Because we can customize the runtime

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

What is a daemon?

A

A background process

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

What is an image?

A

A particular runtime configuration

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

What is a container?

A

A singular deployment of an image

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

What is the command to deploy an image?

A

docker run -d -p 80:80 docker/name

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

When using docker run what does the -p option mean?

A

Specifies the internal and external ports of the container

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

When using docker run what does the -d option mean?

A

Use daemons

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

What files do you need to create a Docker image?

A

Dockerfile

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

In the Dockerfile what is the FROM command?

A

Specifies the base image and version to use

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

In the Dockerfile what is the RUN command?

A

Run commands during the building of the image

Used for environment configuration

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

In the Dockerfile what is the COPY command?

A

Copies files from your local filesystem into the images filesystem

COPY

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

In the Dockerfile what is the EXPOSE command?

A

Specifies a port that we want to open

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

In the Dockerfile what is the CMD command?

A

Run commands during the container initialization

Dockerfile can only have one CMD statement

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

What is the command to build an image?

A

docker build -t alpineapache ../name

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

What is the command to build an image?

A

docker build -t “alpineapache ../name”

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

When using docker build what does the -t option mean?

A

Allows us to specify a name

17
Q

What is Docker Hub?

A

A remote repository hosted by Docker

18
Q

What is the command to push your image to DockerHub?

A

docker push username/repo

19
Q

What are tags used for?

A

Used to specify things like the underlying OS or version

20
Q

What is the command to build an image with a tag?

A

docker build -t “alpineapache ../name:tag” .

21
Q

What is the command to push your image to DockerHub with a tag?

A

docker push username/repo:tag

22
Q

What are multi-process containers?

A

multiple different processes running together in a single container

23
Q

What are multi-process containers good and bad for?

A
  • Good for small deployments

- Bad for scalability

24
Q

What is container orchestration are what is it used with?

A
  • Docker Compose

- Deploys multiple containers as a single service

25
What are the pros of Docker Compose?
- Deploy & destroy containers all at once | - Containers communicate securely and quickly
26
What files are needed to use Docker Compose?
docker-compose.yml tells Docker what containers to run for our services
27
Give an example of a docker-compose.yml file
``` services: webserver: build: ports: - "80:777" ```
28
In the Dockerfile what is the ENV command?
Set some environment variables the Flask web framework will use
29
What is the command to run docker compose?
docker-compose up --build
30
When using docker-compose what does --build mean?
Force Docker to rebuild images in your deployment
31
What does the depends_on option?
Specifies when one service relies on another depends_on: - "redisserver"
32
When using docker-compose what does this mean? | docker-compose up --build --scale webserver=3
Specify the number of instances to scale to
33
What is the command to remove all currently stopped containers in Docker?
docker container prune