墙内正确安装docker和docker-compose的方法
1.卸载旧版本Docker
sudo yum remove docker docker-common docker-selinux docker-engine
2.执行以下命令安装依赖包
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
3.鉴于国内网络问题,强烈建议使用国内源执行下面的命令添加 yum 软件源
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4.安装Docker CE
sudo yum -y install docker-ce
5.设置开机启动 Docker CE
sudo systemctl enable docker sudo systemctl start docker
6.鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,强烈建议安装 Docker 之后配置 国内镜像加速
sudo vi /etc/docker/daemon.json { "registry-mirrors": ["https://registry.docker-cn.com"] }
7.重启生效
sudo systemctl daemon-reload sudo systemctl restart docker
8.安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version sudo curl -L "https://get.daocloud.io/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.24.0/docker-compose-`uname -s-uname -m` > /usr/local/bin/docker-compose
国内镜像安装 docker-compose
按照官网操作
sudo curl -L “https://github.com/docker/compose/releases/download/1.24.0/docker-compose-(uname−s)− (uname -s)-(uname−s)−(uname -m)” -o /usr/local/bin/docker-compose
实在太慢!所以,又去找了一下国内镜像。
国内镜像参考文章:
https://blog.csdn.net/huiyanghu/article/details/82253886
按照以上参考文章抄过来。
curl -L https://get.daocloud.io/docker/compose/releases/download/1.24.0/docker-compose-`uname -s-uname -m` > /usr/local/bin/docker-compose
果然秒达!接下来设置可运行
chmod +x /usr/local/bin/docker-compose
确认一下:
$docker-compose --version
docker-compose version
1.24.0, build 0aa59064
酒是穿肠毒药,色是刮骨钢刀,财是惹祸根苗,气是雷烟火炮。
不过,无酒毕竟不成席,无色世上人渐稀,无财何人早早起,无气处处惹人欺。
饮酒不醉量为高,见色不迷真英豪,不义之财君莫取,忍气饶人祸自消。
酒色财气四堵墙,人人都在里边藏,谁若跳到墙外边,不是神仙也寿长。
君听我一言:做人,量体裁衣。