1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Docker

Connected

Exercise

Mapping a port

Now that you've learned about port mapping in Docker, your manager wants to see if you can simplify the container testing for your team. Given that you typically need to maintain multiple versions of your application, it currently requires starting and stopping them individually. Your manager asks you to try using the nginx container for your testing as your application works similarly.

Instructions 1/4

undefined XP
  • 1
    • Create an instance of the nginx:1.27-alpine container, making sure to use the -d flag (the detach flag, which allows a container to run disconnected from the terminal). Map the port to port 80 on the container. Use host ports 61000.
  • 2
    • Create an instance of the nginx:1.27-alpine container, making sure to use the -d flag (the detach flag, which allows a container to run disconnected from the terminal). Map the port to port 80 on the container. Use host ports 61001.
  • 3
    • Create an instance of the nginx:1.27-alpine container, making sure to use the -d flag (the detach flag, which allows a container to run disconnected from the terminal). Map the port to port 80 on the container. Use host ports 61002.
  • 4
    • Verify that the ports are listening.