Docker and CI/CD · Junior · Question 10 of 75
What does docker run -p 8080:3000 my-app mean?
- 1Container port 8080 forwards to port 3000 on the host
- ✓Correct answer: Host port 8080 forwards to port 3000 in the container
- 3The app may use any port in the range 3000 to 8080
Explanation
The format is host:container. Open http://localhost:8080 and the request reaches the app listening on 3000 inside the container.