linux系統(tǒng)通過docker安裝nginx
環(huán)境準(zhǔn)備:
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.執(zhí)行docke-compose up -d
把編寫的docker-compose.yml文件上傳到linux系統(tǒng)中,
在當(dāng)前目錄下執(zhí)行docker-compose up -d
本文摘自 :https://blog.51cto.com/u