docker commands, flags, syntax Flashcards

1
Q

-d

A

detach

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

-p

A

port

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

docker exec -it image_id ps -aux

A

full process listing of anything inside container

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

full process listing of anything inside container

A

docker exec -it image_id ps -aux

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

run shell inside docker container and connect to shell

A

docker exec -it image_id sh

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

docker exec -it image_id sh

A

run shell inside docker container and connect to shell

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

restart container

A

docker restart image_id

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

get logging info for container

A

docker logs image_id

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

get timestamped logs of container

A

docker logs image_id -t

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

remove a stopped container

A

docker rm <CONTAINER ID/CONTAINER NAME>

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

get further information about an image or a container.

A

docker inspect <CONTAINER ID/NAME OR IMAGE ID/NAME>

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

Create a volume with the volume name (used to persist data in a container beyond its lifecycle)

A

docker volume create <VOLUMENAME></VOLUMENAME>

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

List all volumes

A

docker volume ls

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

Use a docker compose file (compose.yaml) to run multi-container applications.

A

docker compose up -d

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

Stop and remove all the containers contained in the docker compose file (compose.yaml).

A

docker compose down

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

remove an image

A

docker rmi <IMAGE ID/IMAGE NAME>

17
Q

Sets the base image for a build

A

FROM

18
Q

adds metadata to an image

A

LABEL

19
Q

runs / executes commands in a new layer (for installations or configuration)

A

RUN

20
Q

copies NEW files.folders from src (client machine) to destination (new image layer)

A

COPY

21
Q

add from a remote URL & do extraction etc (adding application/web files)

A

ADD

22
Q

sets the default executable of a container & arguments (i.e. web server)

A

CMD
(can be overridden via docker run parameters)

23
Q

sets the default executable of a container & arguments (but can’t be overridden)

A

ENTRYPOINT
(for very specific, single-purpose container)

24
Q

informs docker what port the container app is running (metadata only! - no network configuration, just informs)

A

EXPOSE

25
Q

tag upon building

A

docker build -t image_name