Docker Flashcards

1
Q

What is Docker primarily used for?

A

Docker is used for developing, shipping, and running applications in containers.

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

Fill in the blank: Docker packages applications into _____.

A

containers

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

True or False: Docker containers require a virtual machine to run.

A

False

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

What command is used to start a Docker container from an image?

A

docker run [image_name]

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

How does Docker improve application scalability?

A

Docker enables containers to be easily replicated and scaled across multiple hosts.

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

Which file format is used to define the steps to build a Docker image?

A

Dockerfile

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

What is the purpose of the ‘docker-compose.yml’ file?

A

It defines and manages multi-container Docker applications.

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

What command lists all Docker containers, including stopped ones?

A

docker ps -a

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

Fill in the blank: Docker images are built from instructions written in a _____.

A

Dockerfile

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

True or False: Docker images contain the entire operating system needed to run an application.

A

False

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

What command is used to stop a running Docker container?

A

docker stop [container_id]

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

How does Docker differ from traditional virtual machines?

A

Docker containers share the host OS kernel, making them lighter and faster than virtual machines.

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

What command removes a Docker container?

A

docker rm [container_id]

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

Fill in the blank: A Docker _____ is an executable package that includes everything needed to run an application.

A

container

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

True or False: Each Docker container runs its own isolated OS kernel.

A

False

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

What command is used to download an image from Docker Hub?

A

docker pull [image_name]

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

What is Docker Hub?

A

Docker Hub is a public repository for Docker images.

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

How does Docker Compose simplify multi-container applications?

A

Docker Compose allows users to define and manage multiple containers with a single YAML file.

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

Which Docker command shows the running processes inside a container?

A

docker top [container_id]

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

True or False: Docker containers can only be run on Linux systems.

A

False

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

What is the default networking mode for a Docker container?

A

Bridge network mode

22
Q

Fill in the blank: Docker volumes are used to manage _____.

A

persistent data

23
Q

What command builds a Docker image from a Dockerfile?

A

docker build -t [image_name] [path_to_dockerfile]

24
Q

How can you access the logs of a running container?

A

docker logs [container_id]

25
Q

True or False: Docker images are immutable once created.

A

True

26
Q

Describe an advantage of using Docker in CI/CD pipelines.

A

Docker ensures consistency across environments, from development to production, by packaging dependencies in containers.

27
Q

What is a Docker registry?

A

A Docker registry is a server where Docker images are stored and distributed.

28
Q

What command lists all Docker images on a host?

A

docker images

29
Q

Fill in the blank: Docker networks are used to facilitate ____ between containers.

A

communication

30
Q

What is the difference between Docker ‘COPY’ and ‘ADD’ instructions?

A

‘COPY’ is simpler and just copies files, while ‘ADD’ can also extract archives and fetch URLs.

31
Q

True or False: A Dockerfile is case-sensitive.

A

True

32
Q

What command starts an interactive shell in a running container?

A

docker exec -it [container_id] [shell]

33
Q

How can you remove all stopped containers in Docker?

A

docker container prune

34
Q

Fill in the blank: Docker ____ allow users to isolate data from the container filesystem.

A

volumes

35
Q

True or False: The ‘EXPOSE’ command in Dockerfile publishes the port to the host.

A

False, it only makes the port available to link with other containers.

36
Q

What command do you use to log in to Docker Hub from the CLI?

A

docker login

37
Q

What’s the purpose of the ‘docker inspect’ command?

A

It provides detailed information about a Docker container or image.

38
Q

Fill in the blank: The Docker daemon runs in the ____ and manages containers.

A

background

39
Q

True or False: Each container has its own IP address when using Docker’s bridge network.

A

True

40
Q

What’s the difference between ‘docker run’ and ‘docker start’?

A

‘docker run’ creates and starts a new container, while ‘docker start’ restarts an existing, stopped container.

41
Q

What command allows you to tag a Docker image?

A

docker tag [image_id] [new_tag]

42
Q

How do you specify the base image in a Dockerfile?

A

With the ‘FROM’ instruction.

43
Q

True or False: Docker Compose can be used with Kubernetes.

A

False

44
Q

How can you restart a Docker container?

A

docker restart [container_id]

45
Q

Fill in the blank: Docker ____ manage isolated network environments for containers.

A

networks

46
Q

What command shows detailed resource usage statistics for Docker containers?

A

docker stats

47
Q

What does the Docker ‘CMD’ instruction do in a Dockerfile?

A

Specifies the default command to run when a container is started.

48
Q

What command removes a Docker image?

A

docker rmi [image_name]

49
Q

True or False: Docker automatically deletes unused images and containers.

A

False

50
Q

What command allows you to attach to a running container’s console?

A

docker attach [container_id]

51
Q

Fill in the blank: Docker ____ is a set of tools to help manage clusters of Docker containers.

A

Swarm