Docker 101: Reach a Container Without Publishing a Port
This challenge focuses on Docker Engine running directly on a Linux server, which is the setup most production Docker installations use. Docker Desktop runs Docker Engine inside a separate VM, so container IP addresses may not be reachable from your computer directly.
By default, Docker attaches every new container to the bridge network and gives it an IP address.
On a Linux Docker host, the host itself can connect to these addresses directly,
which is handy for a quick check of a containerized service.

In this challenge, the Docker host runs three containers of a small web project: an Nginx web server, a Redis cache, and a PostgreSQL database. They were started in random order with the following commands:
docker run -d --name web nginx:alpine
docker run -d --name cache redis:alpine
docker run -d --name db -e ... postgres:18-alpine
Your job is to find the IP addresses of the containers and use one of them to access the web server from the Docker host.
Find the IP Address of a Container
What is the IP address of the db container?
Hint: Where to look
The docker inspect command prints the configuration and state of a container as JSON.
The container's addresses can be found in the NetworkSettings section.
Every container on the bridge network gets an address of its own.
Which container has the IP address 172.17.0.3?
Hint: Looking up a container by its address
Checking the containers one by one with the docker inspect command works, but Docker networks can be inspected too.
See if you can find the needed information in the docker network inspect output.
Access the Web Server by Its IP Address
The Docker host itself is connected to the same bridge network, so it can send traffic to the containers' addresses directly.
Nginx listens on port 80 inside the web container.
Send an HTTP request from the Docker host to the web server using the IP address of the web container:
Hint: Checking the web server logs
The Nginx container writes its access log to the container's standard output,
so the docker logs command shows every request the web server received, including the client address.