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

Example Analysis of Docker Nginx Mirror

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you an example analysis of Docker Nginx images, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

One: a brief introduction

Docker Hub Nginx image address https://dev.yisuyun.com/list.html?namePrefix=nginx

The current stable version is 1.12

Second: mirror use

1. Get the image

Docker pull nginx:1.12

two。 Start nginx, and the static page is in the / home/html directory of the host.

Docker run-- name mynginx-v / home/html:/usr/share/nginx/html:ro-d nginx:1.12

3. Map port to 8080 of host

Docker run-- name mynginx-v / home/html:/usr/share/nginx/html:ro-d-p 8080 nginx:1.12

4. Specify the configuration file on the host

Docker run-- name mynginx-v / home/html:/usr/share/nginx/html:ro-v / home/nginx/nginx.conf:/etc/nginx/nginx.conf-d-p 808080 nginx:1.12

5. Copy the default configuration in the mirror to the host

Docker cp mynginx:/etc/nginx/nginx.conf / home/nginx/nginx.conf

6. Copy all the nginx configuration information in the image to the host

Docker cp mynginx:/etc/nginx / home/

7. Configuration files, logs, etc. are all mapped from the host

Docker run-- name mynginx-v / home/html:/usr/share/nginx/html:ro-v / home/nginx/log:/var/log/nginx-v / home/nginx:/etc/nginx-v / home/nginx/run:/var/run-d-p 8080purl 80 nginx:1.12

The above is a sample analysis of Docker Nginx images. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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

Internet Technology

Wechat

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

12
Report