#更新一下 curl yum reinstall curl #下载 docker-compose curl -L https://get.daocloud.io/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
# 赋予执行权限 chmod +x /usr/local/bin/docker-compose
# 停止现有 docker-compose 中的容器: docker-compose down #重新拉取镜像: docker-compose pull #后台启动 docker-compose 中的容器: docker-compose up -d
1.新建 docker-compose.yml 文件
通过以下配置,在运行后可以创建两个站点(只为演示)
vi docker-compose.yml
version: "3" services: web1: image: lmk19980312/mynginx:v1 ports: - "60101:80" web2: image: lmk19980312/mynginx:v1 ports: - "60102:80" web3: image: lmk19980312/mynginx:v1 ports: - "60103:80"