首先下载nginx镜像,加标签
docker pull nginx:latest
映射端口(对外提供http或者web服务)
docker run -p 容器外端口:容器内端口
ifconfig 看一下ip
挂载数据卷
docker run -v 容器外目录;容器内目录
docker run -d --rm --name nginx_with_baidu -d -p82:80 -v/root/html:/user/share/nginx/html nginx
首先下载nginx镜像,加标签
docker pull nginx:latest
映射端口(对外提供http或者web服务)
docker run -p 容器外端口:容器内端口
ifconfig 看一下ip
挂载数据卷
docker run -v 容器外目录;容器内目录
docker run -d --rm --name nginx_with_baidu -d -p82:80 -v/root/html:/user/share/nginx/html nginx