0
0
Dockerdevops~10 mins

RUN instruction for executing commands in Docker - Interactive Code Practice

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

Complete the Dockerfile line to run a command during image build.

Docker
RUN [1]
Drag options to blanks, or click blank then click option'
ACMD python app.py
Bapt-get update
CEXPOSE 80
DCOPY . /app
Attempts:
3 left
💡 Hint
Common Mistakes
Using COPY or CMD with RUN, which are different instructions.
Trying to expose ports with RUN instead of EXPOSE.
2fill in blank
medium

Complete the RUN command to install curl using apt-get.

Docker
RUN apt-get update && apt-get [1] -y curl
Drag options to blanks, or click blank then click option'
Ainstall
Bremove
Cupgrade
Dclean
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove instead of install.
Using upgrade which updates existing packages but doesn't install new ones.
3fill in blank
hard

Fix the error in the RUN instruction to update and install git.

Docker
RUN apt-get update && apt-get [1] git
Drag options to blanks, or click blank then click option'
A-y install
Binstall
Cinstall -y
D-y remove
Attempts:
3 left
💡 Hint
Common Mistakes
Placing -y after the package name.
Using remove instead of install.
4fill in blank
hard

Fill both blanks to run a shell command that creates a directory and lists its contents.

Docker
RUN mkdir [1] && ls [2]
Drag options to blanks, or click blank then click option'
A/app
B/var
D/tmp
Attempts:
3 left
💡 Hint
Common Mistakes
Creating one directory but listing another.
Using invalid directory paths.
5fill in blank
hard

Fill all three blanks to run a command that updates, installs vim, and cleans up.

Docker
RUN apt-get [1] && apt-get install [2] vim && apt-get [3]
Drag options to blanks, or click blank then click option'
Aupdate
B-y
Cclean
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove instead of clean at the end.
Omitting the -y flag during install.