0
0
Dockerdevops~10 mins

Consistent environments across teams 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 to specify the base image.

Docker
FROM [1]
Drag options to blanks, or click blank then click option'
Aubuntu:latest
Bpython:3.12-slim
Cnode:14-alpine
Dalpine:3.15
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a base image with a different Python version.
Using a non-Python base image.
2fill in blank
medium

Complete the Dockerfile to copy the application code into the container.

Docker
COPY [1] /app
Drag options to blanks, or click blank then click option'
Aapp/
Bsrc/
C.
Dcode/
Attempts:
3 left
💡 Hint
Common Mistakes
Copying a wrong folder that doesn't contain the app code.
Using an incorrect path that causes build errors.
3fill in blank
hard

Fix the error in the Dockerfile command to install dependencies.

Docker
RUN pip install -r [1]
Drag options to blanks, or click blank then click option'
Apackages.txt
Brequirements
Cdeps.txt
Drequirements.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filename without extension.
Using a non-standard filename that pip won't recognize.
4fill in blank
hard

Fill both blanks to expose the container port and set the default command.

Docker
EXPOSE [1]
CMD ["[2]"]
Drag options to blanks, or click blank then click option'
A8080
Bpython
C5000
Dnode
Attempts:
3 left
💡 Hint
Common Mistakes
Exposing a wrong port that the app doesn't listen on.
Using a command that doesn't start the Python app.
5fill in blank
hard

Fill all three blanks to create a Docker Compose service for the app.

Docker
services:
  web:
    image: [1]
    ports:
      - "[2]:[3]"
Drag options to blanks, or click blank then click option'
Amyapp:latest
B8080
C80
D5000
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect port mappings that prevent access.
Using an image name without a tag.