0
0
Dockerdevops~10 mins

Why container security 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 command to list all running Docker containers.

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

Complete the command to remove a Docker container by its ID.

Docker
docker [1] container_id
Drag options to blanks, or click blank then click option'
Arm
Bstop
Crun
Dexec
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'docker stop' which only stops but does not remove containers.
Using 'docker exec' which runs commands inside containers.
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'
Amy_image
B-f
Crun
Dcontainer
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-f' after '-t' which is incorrect here.
Using 'run' or 'container' which are not valid image names.
4fill in blank
hard

Fill both blanks to create a Docker container with a specific name and run it in detached mode.

Docker
docker run -d --name [1] [2]
Drag options to blanks, or click blank then click option'
Amy_container
Bnginx
C-p 80:80
Dubuntu
Attempts:
3 left
💡 Hint
Common Mistakes
Putting image name in the container name blank.
Using port mapping instead of image name.
5fill in blank
hard

Fill all three blanks to write a Dockerfile snippet that sets the base image, copies files, and runs a command.

Docker
FROM [1]
COPY . /app
CMD ["[2]", "[3]"]
Drag options to blanks, or click blank then click option'
Apython:3.12-slim
Bpython
Capp.py
Dnginx
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'nginx' as base image for a Python app.
Swapping command and script names.