Docker Docker 基础环境安装

shouquan · November 15, 2017 · 869 hits

1.系统要求
centos 7 以上

2.环境要求

# 关闭防火墙systemctl stop firewalld
systemctl disable firewalld

3.docker安装

wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.13.1-1.el7.centos.x86_64.rpm
yum -y localinstall docker-engine-1.13.1-1.el7.centos.x86_64.rpm

4.配置docker参数

cat > /etc/docker/daemon.json <<EOF
{
"storage-driver": "overlay",
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}
EOF

5.启动2376监听端口

docker是C/S模式的,默认只监听本地-H unix:///var/run/docker.sock,若要远程监听修改/usr/lib/systemd/system/dockerer.service文件。把ExecStart这一行改成如下:

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock

5.启动docker

systemctl start docker
systemctl enable docker
No Reply at the moment.
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up