0
0
Dockerdevops~10 mins

Why build optimization matters in Docker - 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 set the base image.

Docker
FROM [1]
Drag options to blanks, or click blank then click option'
Aubuntu:20.04
BCOPY . /app
CRUN apt-get update
DEXPOSE 80
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like COPY or RUN instead of a base image after FROM.
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'
ARUN apt-get install -y curl
B.
C/app
DEXPOSE 8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like RUN or EXPOSE instead of a path.
3fill in blank
hard

Fix the error in the Dockerfile command to run a package update.

Docker
RUN apt-get [1] update
Drag options to blanks, or click blank then click option'
Ainstall
Bupgrade
Cremove
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'install' or 'upgrade' instead of 'update' in this context.
4fill in blank
hard

Fill both blanks to optimize the Dockerfile by combining commands.

Docker
RUN apt-get [1] && apt-get [2] -y curl
Drag options to blanks, or click blank then click option'
Aupdate
Binstall
Cremove
Dupgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order or using 'remove' or 'upgrade' incorrectly.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that filters packages to install.

Docker
packages = {pkg: version for pkg, version in all_packages.items() if pkg [1] ['curl', [2], [3]]}
Drag options to blanks, or click blank then click option'
Ain
B'wget'
C'git'
Dnot in
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'not in' or forgetting quotes around package names.