docker network rm aice
docker network create aice
创建容器
docker rm -f nginx-proxy
docker run -p 80:80 -p 443:443 \
-d \
—name nginx-proxy \
—network aice \
—network-alias nginx-proxy-host\
-v /usr/share/nginx/html \
-v /etc/nginx/vhost.d \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
jwilder/nginx-proxy
新建容器
docker rm -f nginx-proxy
docker run -p 80:80 -p 443:443 \
-d \
—name nginx-proxy \
—network aice \
—network-alias nginx-proxy-host\
-v /root/nginx/ssl:/etc/nginx/certs:ro \
-v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
—label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy \
jwilder/nginx-proxy
运行伴侣
docker rm -f companion
docker run \
-d \
—name companion \
—network aice \
—network-alias companion-host \
-v /root/nginx/ssl:/etc/nginx/certs:rw \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
—volumes-from nginx-proxy \
jrcs/letsencrypt-nginx-proxy-companion
站点1
docker rm -f www
docker run \
-d \
-e VIRTUAL_HOST=abovesoft.net \
-e “LETSENCRYPT_HOST=abovesoft.net” \
-e “LETSENCRYPT_EMAIL=info@abovesoft.net.com” \
—network aice \
—network-alias www-host \
—name www \
-p 811:80 \
nginxdemos/hello
站点2
docker rm -f bbs
docker run \
-d \
-e VIRTUAL_HOST=bbs.fengnz.tk \
-e “LETSENCRYPT_HOST=bbs.fengnz.tk” \
-e “LETSENCRYPT_EMAIL=soody@qq.com” \
—network aice \
—network-alias bbs-host \
—name bbs \
-p 82:8000 \
crccheck/hello-world
docker run —name web-test1 -p 80:80 -d —rm nginxdemos/hello
docker run —name web-test2 -p 80:8000 -d —rm crccheck/hello-world