Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly build a static website through Nginx Image

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

How to quickly build a static website through Nginx image, I believe that many inexperienced people do not know what to do about it. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

1. Deployment environment

Docker-machine env

View the environment variables of default docker-machine

Eval $(docker-machine env)

Environment variables that use default docker-machine

2. Download Nginx image from NetEase Honeycomb Image Center

Https://c.163.com/hub#/m/home/

Search for Nginx → library/Nginx

Copy command download docker pull hub.c.163.com/library/nginx:latest

3. View the downloaded images

Docker images

4. Enter the container

Docker run-p 8080 it hub.c.163.com/library/nginx 80-- name nginx_web-it hub.c.163.com/library/nginx / bin/bash

Command parameter interpretation: nginx_web-- container name-it (equivalent to-I-t)

8080 80-- use native port 80 to map to port 8080 of docker

5. Find the nginx in the image

Whereis nginx

6. Run nginx

Command: nginx

7. Visit the website for testing

192.168.99.101:8080

8. Exit the container

Ctrl+P Ctrl+Q

9. Re-enter the container

Docker attach nginx_web has more than two Enter

After reading the above, have you mastered how to quickly build a static website through Nginx image? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report