How can you check the port mappings of a container using Docker?

0174

You can check the port mappings of a Docker container using the docker port command followed by the container name or ID. Here’s the syntax:

docker port <container_name_or_id>

For example, if you have a container named my-nginx, you would run:

docker port my-nginx

This command will display the port mappings for the specified container. Additionally, you can use the docker ps command to see a list of all running containers along with their port mappings:

docker ps

This will show you the container ID, image, command, created time, status, and the ports that are mapped.

0 Comments

no data
Be the first to share your comment!