docker run -p280:280 --name nginx -d nginx
创建挂载到容器的宿主机文件夹
mkdir -p /home/000nginx-ebrms-ftp/html
mkdir -p /home/000nginx-ebrms-ftp/logs
mkdir -p /home/000nginx-ebrms-ftp/conf
拷贝相关配置到宿主机文件夹
docker container cp nginx:/etc/nginx /home/000nginx-ebrms-ftp/conf
mv /home/000nginx-ebrms-ftp/conf/nginx/* /home/000nginx-ebrms-ftp/conf
rm -rf /home/000nginx-ebrms-ftp/conf/nginx
删除基础容器
docker stop nginx
docker rm nginx
docker run -p 20012-20023:20012-20023 --restart=always --name nginx \
-v /home/000nginx-ebrms-ftp/html:/usr/share/nginx/html \
-v /home/000nginx-ebrms-ftp/logs:/var/log/nginx \
-v /home/000nginx-ebrms-ftp/conf/:/etc/nginx \
-d nginx