vim docker_load_nginx.sh
#!/bin/bash
# 创建主机映射目录
mkdir -p /home/docker-nginx/
chmod 755 -R /home/docker-nginx
# 复制容器中的配置文件到主机
docker run --name nginx -d nginx:latest
docker cp nginx:/etc/nginx/nginx.conf /home/docker-nginx
docker cp nginx:/etc/nginx/conf.d /home/docker-nginx