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

Install docker deployment Nginx under Centos7

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

Share

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

Experimental environment

Centos 7 operating system

Install docker

Yum install docker-y

Check to see if docker is installed successfully

Docker-v

Docker version 1.12.6, build 3a094bd/1.12.6

Start docker

Systemctl start docker

Deploy Nginx

Get the basic image

Docker pull nginx:1.10.3

View Mirror

1. Start the container directly

Docker run-d-p 8080RV 80 nginx:1.10.3

Explanation: run docker in background mode and map port 80 of nginx to port 8080 of the current server

Check to see if the startup is successful

Access test

2. Build your own image

Edit Docker file # #

FROM nginx:1.10.3

MAINTAINER admin

ADD container_file/html / usr/share/nginx/html # loads the host's files into the docker container

CMD ["nginx", "- g", "daemon off;"]

Create a mirror

Docker build-t mnginx:v1. # # Note do not use uppercase letters for initials that are clear in mirror images

View Mirror

Start the container you just created

Docker run-d-p 7000UR 80 mnginx:v1

Check to see if the container started successfully

test

Http://192.168.10.61:7000/

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