0
0
Dockerdevops~10 mins

Containers vs virtual machines in Docker - Interactive Practice

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

Complete the command to list all running Docker containers.

Docker
docker [1]
Drag options to blanks, or click blank then click option'
Arun
Bimages
Cps
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'images' instead of 'ps' to list containers.
2fill in blank
medium

Complete the command to start a new container from the nginx image.

Docker
docker [1] nginx
Drag options to blanks, or click blank then click option'
Abuild
Bpull
Cstop
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'build' instead of 'run' to start a container.
3fill in blank
hard

Fix the error in the command to stop a container named myapp.

Docker
docker [1] myapp
Drag options to blanks, or click blank then click option'
Astop
Bstart
Crm
Dexec
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' instead of 'stop' to halt a container.
4fill in blank
hard

Fill both blanks to create a Dockerfile that uses Ubuntu and installs curl.

Docker
FROM [1]
RUN apt-get update && apt-get install -y [2]
Drag options to blanks, or click blank then click option'
Aubuntu
Bnginx
Ccurl
Dnode
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'nginx' as base image or installing 'node' instead of 'curl'.
5fill in blank
hard

Fill all three blanks to create a Docker command that runs a container in detached mode, names it webserver, and maps port 8080 to 80.

Docker
docker run [1] --name [2] -p [3]:80 nginx
Drag options to blanks, or click blank then click option'
A-it
Bwebserver
C8080
D-d
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-it' instead of '-d' for detached mode.
Wrong port mapping syntax.