Docker Images Flashcards

1
Q

What do docker images consist of?

A

Layers of files containing the differences between each layer

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

What is the writable container layer?

A

Changes the container makes to its file system go into the top writable container layer, containing changes from the base layers

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

How do you get an image?

A

docker image pull

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

How do you view the layers within an image?

A

docker image history

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

How do you build an image?

A

With a Dockerfile

docker build -t .

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

Explain the following Dockerfile directives: FROM, ENV, RUN, CMD

A

FROM - starts build setting by base image
ENV - sets environment variables visible to file itself and container at runtime
RUN - creates layer on previous layer and commits changes
CMD - specify default command to run a container runtime

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

Explain the following Dockerfile directives: EXPOSE, WORKDIR, COPY, ADD

A

EXPOSE - documents which ports intended to be published
WORKDIR - sets the current working directory for subsequent directives
COPY - copy files from local machine to image
ADD - copy, can also pull files from url

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

Explain the following Dockerfile directives: STOPSIGNAL, HEALTHCHECK

A

STOPSIGNAL - specify the signal that will be used to stop the container
HEALTHCHECK - specify a custom health check to verify the container is working properly

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