0
0
Dockerdevops~10 mins

Why Dockerfiles automate image creation - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the Dockerfile command to specify the base image.

Docker
FROM [1]
Drag options to blanks, or click blank then click option'
Aubuntu:latest
BRUN apt-get update
CCOPY . /app
DCMD ["bash"]
Attempts:
3 left
💡 Hint
Common Mistakes
Using RUN or COPY instead of FROM to specify the base image.
2fill in blank
medium

Complete the Dockerfile command to copy files into the image.

Docker
COPY [1] /app
Drag options to blanks, or click blank then click option'
ACMD ["python"]
BRUN apt-get install
C/app
D.
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like RUN or CMD instead of a path for COPY.
3fill in blank
hard

Fix the error in the Dockerfile command to run a shell command.

Docker
[1] apt-get update
Drag options to blanks, or click blank then click option'
ARUN
BCMD
CCOPY
Dapt-get
Attempts:
3 left
💡 Hint
Common Mistakes
Using COPY or CMD instead of RUN for shell commands.
4fill in blank
hard

Fill both blanks to set the working directory and default command.

Docker
WORKDIR [1]
CMD [2]
Drag options to blanks, or click blank then click option'
A/app
B["python", "app.py"]
C["bash"]
D/usr/src
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up WORKDIR and CMD values.
5fill in blank
hard

Fill all three blanks to create a dictionary of environment variables in a Dockerfile.

Docker
ENV [1]=[2] [3]
Drag options to blanks, or click blank then click option'
AAPP_ENV
Bproduction
CDEBUG=false
DPATH
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid syntax or missing equal signs in ENV.