Dockerfile Flashcards

1
Q

What must be the first command in a Dockerfile? What is the exception?

A
FROM baseImage

The exception is if an ARG command is used to declare arguments passed to FORM

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

Given the following code:

FROM busybox
ENV FOO=/bar
WORKDIR 

What is the syntax for using FOO as the WORKDIR?

A

WORKDIR ${FOO}

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

What is the purpose of EXPOSE?

A

To document which ports are available for binding so you don’t have to look at the application’s source code

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