linux系统通过docker安装nginx
环境准备:
docker
docker-compose
1.编写docker-compose.yml
version: '3.1'
services:
nginx:
restart: always
image: daocloud.io/library/nginx:1.9.1
container_name: nginx
ports:
- 80:80
镜像地址通过
http://hub.daocloud.io/repos/2b7310fb-1a50-48f2-9586-44622a2d1771
2.执行docke-compose up -d
把编写的docker-compose.yml文件上传到linux系统中,
在当前目录下执行docker-compose up -d
本文摘自 :https://blog.51cto.com/u