Docker Flashcards

1
Q

Building a container from dockerfile

A

docker build -t dockerfile:version

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

Show docker images

A

docker images

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

Run a container with networking

A

docker run -d -p 5000:5000 dockerfile

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

Stopping a container

A

docker stop

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

Create a container from an image.

A

docker create

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

Start an existing container.

A

docker start

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

Create a new container and start it.

A

docker run

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

List running containers.

A

docker ls

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

Get detailed information regarding the container.

A

docker inspect

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

Print run logs from the container’s execution.

A

docker logs

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

Stop the main process in the container abruptly.

A

docker kill

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

Delete a stopped container.

A

docker rm

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

List running containers

A

docker ps

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

List all past containers

A

docker ps -a

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

Removing a container

A

docker container rm

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

For pushing the container into docker hub

A

docker tag

17
Q

Push Docker to hub

A

docker push

18
Q

Removing the image locally

A

docker rmi -f

19
Q

Getting the image using docker ID

A

docker pull

20
Q

o Selects the base image used to start the build process.

A

o FROM

21
Q

o Lets you select a name and email address for the image creator.

A

o MAINTAINER

22
Q

o Creates image layers and executes commands within a container.

A

o RUN

23
Q

o Executes a single command within a container. Only one can exist in a Dockerfile.

A

o CMD

24
Q

o Sets the path where the command defined with CMD is to be executed.

A

o WORKDIR

25
Q

o Executes a default application every time a container is created with the image.

A

o ENTRYPOINT

26
Q

o Copies the files from locally, remotely via a URL into the container’s file system.

A

o ADD

27
Q

o Sets environment variables within the container.

A

o ENV

28
Q

o Associates a specific port for networking binding.

A

o EXPOSE

29
Q

o Sets the UID (or username) of the user that is to run the container.

A

o USER

30
Q

o Sets up a sharable directory that can be mapped to a local host directory

A

o VOLUME

31
Q

o Provides a label to identify the created Docker image.

A

o LABEL