Dockerfiles Flashcards

1
Q

Dockerfile FROM does

A

Required. Indicates the base image to start from.

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

Docker ENV

A

Sets environmental variables. Often includes the version in the image

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

Dockerfile processing order

A

Every command adds an image layer on top, so order matters!

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

Dockerfile RUN

A

Includes CLI commands to run

Use && syntax to add commands without adding a layer

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

Dockerfile EXPOSE

A

The ports that should be open

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

CMD

A

Required, the final command that runs when starting the container.

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

WORKDIR

A

Sets the working directory

Preferred to RUN cd /path/

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

COPY

A

Transfers a local file to the location

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

Are ENVs inherited from upstream images?

A

No.

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