In this hands-on lab, you will be pulling a specific Nginx container image and then using that image to start a new container with port mappings. Upon completion of this lab, you will have the knowledge and skills required to start a new Nginx container, map host ports to container ports, and assign a name to a Docker container.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Pull an Image
- Log in to
server-1
using thecloud_user
account. - Pull the
Nginx
image with the tag of1.22
- Log in to
- Start a Container
- Start a new container using the
nginx:1.22
container image. - Name the container
web-1
. - Map the container
port 80
to hostport 8080
.
- Start a new container using the
- Verify the Container Is Working
- Use
curl
to accessserver-1:8080
to verify the container is running. - Use a web browser and the public IP address of
server-1
to check that the container is running onport 8080
.
- Use