0
0
Dockerdevops~10 mins

EXPOSE instruction for ports 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 expose port 80.

Docker
EXPOSE [1]
Drag options to blanks, or click blank then click option'
A22
B443
C80
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 22 which is for SSH, not HTTP.
Confusing port 443 which is for HTTPS.
2fill in blank
medium

Complete the Dockerfile line to expose port 5432 for a PostgreSQL database.

Docker
EXPOSE [1]
Drag options to blanks, or click blank then click option'
A5432
B3306
C6379
D27017
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 3306 which is for MySQL.
Using port 6379 which is for Redis.
3fill in blank
hard

Fix the error in the Dockerfile line to expose port 5000 (remove the wrong character).

Docker
EXPOSE [1]
Drag options to blanks, or click blank then click option'
A5000/
B5000
C5000/tcp
Dtcp/5000
Attempts:
3 left
💡 Hint
Common Mistakes
Adding a slash after the port number.
Including protocol in the wrong format.
4fill in blank
hard

Fill both blanks to expose HTTP and HTTPS ports in the Dockerfile.

Docker
EXPOSE [1] [2]
Drag options to blanks, or click blank then click option'
A80
B22
C443
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 22 which is for SSH.
Confusing port 8080 with standard HTTP port.
5fill in blank
hard

Fill all three blanks to expose ports for HTTP, PostgreSQL, and Redis.

Docker
EXPOSE [1] [2] [3]
Drag options to blanks, or click blank then click option'
A80
B5432
C6379
D22
Attempts:
3 left
💡 Hint
Common Mistakes
Including port 22 which is for SSH and not relevant here.
Mixing up database ports.