Docker-commands & terminology Flashcards

1
Q

delete all stopped containers.

A

docker rm $(docker ps -a -q)

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

remove a docker image

A

docker rmi [image name]

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

delete all docker images

A

docker rmi $(docker images -q)

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

log into a running docker container.

A

sudo docker exec -it [container name] bash

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

show running docker containers

A

docker ps

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

run a docker container

A

docker run [image name]

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

see the logs of a docker container

A

docker logs [container name]

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

build a docker image

A

docker build -t [tag name] .

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

stop a running container.

A

docker stop [container name]

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

list all images

A

docker images

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

run a container and map it to a host port.

A

docker run -p 8082:8082 [image name]

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

remove a stopped container

A

docker rm [container name]

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

what is a docker image?

A

a lightweight standalone, executable package that includes everything needed to run a piece of software.

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

what is a docker container?

A

a runtime instance of a docker image.

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

what is a Dockerfile?

A

A text document that contains all the commands a user could call on the command line to assemble an image.

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

create a volume

A

docker volume create [volume name]

16
Q

what is a docker daemon?

A

listens for docker API requests and manages docker objects such as images, containers, networks and volumes.

17
Q

what is docker?

A

a tool that allows you to create, deploy and run applications by using containers.

18
Q

describe the docker architecture

A

docker client: ie commands that you run on the cli, the client and daemon communicate using a REST API
docker daemon: the docker daemon (dockerd) listens for docker API requests and manages docker objects.
docker registry: stores docker images.