vim /usr/lib/sysctl.d/00-system.conf添加如下内容:
net.ipv4.ip_forward=1安装好docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-enginesudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io创建一个外部的容器挂载:
mkdir /root/nginx先开启一个容器复制出/etc/nginx下的内容 随后删除之前起的容器执行以下命令:
docker run -p 9005:80 --name nginx -v /root/nginx/html:/usr/share//nginx/html -v /root/nginx/logs:/var/log/nginx -v /root/nginx/conf:/etc/nginx -d nginx:1.10最终:
