Docker安装
卸载旧版本
1 | sudo yum remove docker \ |
安装yum-utils
1 | sudo yum install -y yum-utils |
设置镜像仓库地址
阿里云(推荐)
1 | sudo yum-config-manager \ |
官方
1 | sudo yum-config-manager \ |
更新yum安装包索引
1 | yum makecache fast |
安装docker
1 | sudo yum install -y docker-ce docker-ce-cli containerd.io |
启动docker服务
1 | sudo systemctl start docker |
检查是否安装成功
1 | # 查看docker版本 |
配置镜像
1 | mkdir /etc/docker/ |
DockerCompose安装
下载安装包
GIthub下载
1 | curl -L https://github.com/docker/compose/releases/download/1.25.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose |
daocloud下载
1 | curl -L https://get.daocloud.io/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose |
赋予权限
1 | chmod a+x /usr/local/bin/docker-compose |
创建软连接
1 | ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose |
检查是否安装成功
1 | docker-compose --version |