Skip to content

How to Get the IP Address of a Docker Container

If you need to get the IP Address of a Docker Container, then you can do the following:

Option 1 – Connect to the Bridge Network

Find out the network setup:

docker network ls
Code language: Bash (bash)

Create a docker container and assign it to the bridge network:

docker run -dt <nginx>
Code language: Bash (bash)

Get the information about the container:

docker ps
Code language: Bash (bash)

Inspect the network:

docker network inspect bridge
Code language: Bash (bash)

Now you can see the container IP Address.

Option 2 – Use docker inspect

Use the container id to get detailed information:

docker inspect abcde1234567
Code language: Bash (bash)

See also  AppMesh and ECS with Imported ACM certificates on Envoy Sidecar through EFS
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x