Publish a port and reach the app. Map host 8080 to container 80, then prove it answers.
student@lab:~$ docker run -d -p 8080:80 --name web nginx:1.27
3f2a9c1e7b0d4e8f6a1c2b3d4e5f60718293a4b5c6d7e8f9
student@lab:~$ curl -s -o /dev/null -w "%{http_code}" localhost:8080
200
student@lab:~$
Container web is running
Host 8080 → container 80
HTTP 200 from localhost:8080
Step 4 verified · checked against your container