当前位置:   article > 正文

yum安装docker(阿里镜像源)及docker-compose二进制安装_docker compose 安装 阿里云

docker compose 安装 阿里云

安装docker

初始化系统安装常用工具:
yum -y install lrzsz vim wget net-tools bash-completion

初始化后可重启系统
准备:
查看防火墙和selinux是否开启
cat /etc/selinux/config 
关闭selinux:
sed -i '/SELINUX/s/enforcing/disabled/g' /etc/selinux/config
关闭防火墙:
systemctl stop firewalld
systemctl disable firewalld

开始安装docker:
安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2

添加docker镜像软件源
yum-config-manager  --add-repo  https://download.docker.com/linux/centos/docker-ce.repo

选择阿里云源快
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

更新yum包索引
yum makecache fast

安装docker-ce社区版
yum  -y install docker-ce  

启动
systemctl start docker

# 测试
docker run hello-world
docker version
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35

配置镜像加速:

阿里云镜像加速:
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://1do67ezy.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl enable docker
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

安装 docker-compose

安装之前先查看你安装的docker的版本,对应安装相应版本的docker-compose
查看版本:
https://github.com/docker/compose/releases

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

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

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


docker-compose --version
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

参考链接:

https://www.cnblogs.com/llody/p/13024768.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/74140
推荐阅读
相关标签
  

闽ICP备14008679号