200-901 · Question #260
A developer created a new secure API and is testing the functionality locally. The API was added to a container for further testing, and other team members and applications need to connect to the…
The correct answer is B. docker run -p 0.0.0.0:443:8443/tcp myapiservice. This command maps port 8443 from the container to port 443 on all network interfaces of the host (0.0.0.0). It allows external connections to access the API through the specified host port.
Question
A developer created a new secure API and is testing the functionality locally. The API was added to a container for further testing, and other team members and applications need to connect to the API. Which command exposes the API in the container as port 8443 and allows connections external to the host?
Options
- Adocker run -p 127.0.0.1:80:8443/tcp myapiservice
- Bdocker run -p 0.0.0.0:443:8443/tcp myapiservice
- Cdocker run -p 0.0.0.0:8443:443/tcp myapiservice
- Ddocker run -p 127.0.0.1:443:8443/tcp myapiservice
How the community answered
(38 responses)- A5% (2)
- B82% (31)
- C11% (4)
- D3% (1)
Explanation
This command maps port 8443 from the container to port 443 on all network interfaces of the host (0.0.0.0). It allows external connections to access the API through the specified host port.
Topics
Community Discussion
No community discussion yet for this question.