Start a temporary container without mounting it
docker run -d --name zxl-nginx -p 80:80 nginx
Copy the configuration file from the container
docker cp zxl-nginx:/etc/nginx/nginx.conf /home/nginx/nginx.conf
docker cp zxl-nginx:/etc/nginx/conf.d /home/nginx/
docker cp zxl-nginx:/usr/share/nginx/html /home/nginx/
Delete temporary container
docker rm -f zxl-nginx
Restart a container with a mounted directory
docker run \
-p 80:80 \
--name nginx01 \
-v /home/nginx/nginx.conf:/etc/nginx/nginx.conf \
-v /home/nginx/conf.d:/etc/nginx/conf.d \
-v /home/nginx/logs:/var/log/nginx \
-v /home/nginx/html:/usr/share/nginx/html \
-d nginx:latest