Open bitjian opened 9 months ago
mkdir -p ~/docker/nginx
docker pull nginx
docker run --name nginx -d nginx
docker cp nginx:/etc/nginx/nginx.conf ~/docker/nginx docker cp nginx:/etc/nginx/conf.d ~/docker/nginx/ docker cp nginx:/usr/share/nginx/html/ ~/docker/nginx
docker rm -f id
docker run --name nginx -d -p 80:80 -p 443:443 \ -v ~/docker/nginx/nginx.conf:/etc/nginx/nginx.conf \ -v ~/docker/nginx/conf.d:/etc/nginx/conf.d \ -v ~/docker/nginx/log:/var/log/nginx \ -v ~/docker/nginx/html:/usr/share/nginx/html \
docker-部署nginx
创建目录
拉取镜像
运行容器
复制容器文件到本地
删除容器
重新运行带挂载目录的容器
访问