0
0
Dockerdevops~10 mins

Combining RUN 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 combine two commands in one RUN instruction using the correct operator.

Docker
RUN apt-get update [1] apt-get install -y curl
Drag options to blanks, or click blank then click option'
A||
B|
C;
D&&
Attempts:
3 left
💡 Hint
Common Mistakes
Using ';' runs commands regardless of success.
Using '|' pipes output, not for chaining commands.
2fill in blank
medium

Complete the Dockerfile RUN command to update packages and clean cache in one line.

Docker
RUN apt-get update [1] apt-get upgrade -y [2] apt-get clean
Drag options to blanks, or click blank then click option'
A&&
B;
C||
D|
Attempts:
3 left
💡 Hint
Common Mistakes
Using ';' runs commands regardless of success.
Using '||' runs next command only if previous fails.
3fill in blank
hard

Fix the error in this Dockerfile RUN command by choosing the correct operator to combine commands.

Docker
RUN mkdir /app [1] cd /app [2] git clone https://repo.url
Drag options to blanks, or click blank then click option'
A&&
B;
C|
D||
Attempts:
3 left
💡 Hint
Common Mistakes
Using ';' runs commands regardless of success.
Using '|' pipes output, not for chaining commands.
4fill in blank
hard

Fill both blanks to combine commands that update, install, and clean in one RUN instruction.

Docker
RUN apt-get update [1] apt-get install -y nginx [2] apt-get clean
Drag options to blanks, or click blank then click option'
A&&
B;
C||
D|
Attempts:
3 left
💡 Hint
Common Mistakes
Using ';' runs commands regardless of success.
Using '||' runs next command only if previous fails.
5fill in blank
hard

Fill all three blanks to create a RUN command that updates, installs curl, and cleans cache safely.

Docker
RUN apt-get update [1] apt-get install -y [2] [3] apt-get clean
Drag options to blanks, or click blank then click option'
A&&
Bcurl
D;
Attempts:
3 left
💡 Hint
Common Mistakes
Using ';' instead of '&&' breaks safe chaining.
Missing the package name causes install failure.