cd /opt
mkdir compose_nginx
cd compose_nginx
mkdir nginx
cd nginx/
此时顺便将nginx安装包拖进来
vim Dockerfile
mkdir /opt/compose_nginx/wwwroot
echo "<h1>this is test web</h1>" > /opt/compose_nginx/wwwroot/index.html
docker network ls
vim run.sh
进入到compose_nginx目录
vim docker-compose.yml
#上传 docker-compose安装包
mv docker-compose /usr/local/bin/
chmod +x /usr/local/bin/docker-compose
yum install -y tree
tree compose_nginx/
docker-compose --version
cd compose_nginx/
docker-compose -f docker-compose.yml up -d
docker ps -a
docker-compose ps
浏览器访问:http://192.16886.30:1216