CentOS中部署Docker并配置Nginx
查看系统版本# cat /etc/redhat-release
CentOS Linux> 查看内核版本
# uname -r
3.10.0-327.el7.x86_64
关闭selinux和防火墙
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#' /etc/selinux/config
systemctl disable firewalld.service
systemctl stop firewalld.service
下载docker
# yum install -y docker
替换国内加速器
# cat >/etc/docker/daemon.json 9d76d200aae9 centos "/bin/bash" 14 minutes ago Up 14 minutes mynginx
提交镜像并查看
# docker commit -m "add new docker images" mynginx test/nginx:v1
sha256:5e28845136a33dc8e6175248086a90f9195dda4bdfc014a89b7ee32e37cc24d0
# docker images
REPOSITORY TAG IMAGE> test/nginx v1 5e28845136a3 About a minute ago 420 MB
docker.io/centos latest 49f7960eb7e4 7 weeks ago 200 MB
测试nginx连通性
# docker run -p 80:80 --name test_nginx 5e28845136a3 nginx
原文出处转载链接
啥也不说了,楼主就是给力! 厉害了,简单明了。
页:
[1]