国内网络环境CentOS快速安装docker与docker-compose

docker 9个月前 will
491 0

国内网络环境CentOS快速安装docker与docker-compose

# 修改 CentOS 7默认源为 ALIYUN
cd /etc/yum.repos.d/
mkdir old
mv * old/
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# 安装常用工具
yum install -y yum-plugin-fastestmirror deltarpm bzip2 lbzip2
# yum makecache fast

# 安装docker 所需依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
# 添加 aliyun docker yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# 设置 docker 国内镜像
#yum makecache fast
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://o4omo0yw.mirror.aliyuncs.com"]
}
EOF
# 安装 docker
yum -y  --enablerepo=docker-ce-stable install docker-ce


docker info
docker version

# 关闭防火墙
cat /etc/sysconfig/iptables
service iptables stop
systemctl daemon-reload
systemctl enable docker
systemctl restart docker
# 安装 docker-compose
echo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

chmod a+x  /usr/local/bin/docker-compose

版权声明:will 发表于 2020-02-19 11:43:24。
转载请注明:国内网络环境CentOS快速安装docker与docker-compose | 敏利雅

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...