0
0
Dockerdevops~10 mins

What is Docker - Interactive Quiz & Practice

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

Complete the code to run a Docker container from the nginx image.

Docker
docker run [1] nginx
Drag options to blanks, or click blank then click option'
A-d
B-p
C--rm
D-v
Attempts:
3 left
💡 Hint
Common Mistakes
Using -p instead of -d runs the container with port mapping, not detached.
2fill in blank
medium

Complete the command to list all Docker containers, including stopped ones.

Docker
docker ps [1]
Drag options to blanks, or click blank then click option'
A-l
B-a
C-q
D-s
Attempts:
3 left
💡 Hint
Common Mistakes
Using -l shows only the last created container.
3fill in blank
hard

Fix the error in the command to build a Docker image from a Dockerfile.

Docker
docker build -t [1] .
Drag options to blanks, or click blank then click option'
Arun
Bstart
Ccontainer
Dmyimage
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' or 'start' as image names causes errors.
4fill in blank
hard

Fill both blanks to create a Docker volume and mount it to a container.

Docker
docker volume [1] mydata && docker run -v mydata:[2] nginx
Drag options to blanks, or click blank then click option'
Acreate
B/data
C/app
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' instead of 'create' deletes volumes.
5fill in blank
hard

Fill all three blanks to write a Dockerfile that uses an alpine base image, copies a file, and runs a command.

Docker
FROM [1]
COPY [2] /app/
CMD ["[3]"]
Drag options to blanks, or click blank then click option'
Aalpine
Bscript.sh
Csh
Dubuntu
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ubuntu' as base image changes the image size.