DEV Community

Cover image for Pull Nginx image and run the container
Jun Ueno
Jun Ueno

Posted on

Pull Nginx image and run the container

Written with Cameron Gibson

Versions

OS: MacOS (intel chip)
Docker version: 20.10.12

Official image of Nginx

Nginx distribute its official Docker image on Docker Hub.
https://hub.docker.com/_/nginx

How to

  1. Pull Nginx Docker image
  2. Run the container

1. Pull Nginx Docker image

① Pull the latest of Nginx Docker image

docker pull nginx
Enter fullscreen mode Exit fullscreen mode

② Confirm you successfully pulled the image

docker images
Enter fullscreen mode Exit fullscreen mode

Image Pulled

2. Run the container

① Run the container
Listen Port: 3000, Forward to: 80

docker run -p 3000:80 nginx
Enter fullscreen mode Exit fullscreen mode

② Confirm you successfully run the container
Access to http://localhost:3000/

localhost3000

Thank you

I hope this helps.
Thank you for reading.

Top comments (0)