Quickly deploy Docker and publish multiple websites or services at the same time

 

 

 

1. Install Docker

https://docs.docker.com/engine/install/debian/ 

Then follow this tutorial to install, choosing Debian operating system is the best .

Don’t be scared when you see English, it says steps 1, 2, 3, 4. . . Obviously, just copy the command and run it .

2. Create a network switch

docker network create --driver bridge --subnet=172.19.12.0/24 --gateway=172.19.12.1 mynet

3. Create your first website

docker run -d -p 81:80   --network=mynet --ip 172.19.12.4 --name httpd1-web -v  /home/httpd1/htdocs:/var/www/  -v /home/httpd1/apache_conf:/etc/apache2  -v /home/httpd1/php_conf:/usr/local/etc/php --privileged=true --restart=always  php:7.2-apache

Add an Index.html in the /home/ httpd1 /htdocs directory

<html>
<body>
<h1>打工人,打工魂</h1>
&

Guess you like

Origin blog.csdn.net/usdnfo/article/details/111509661