aliyun linux 安装Docker

首先我们要知道 aliyun linux 是基于 CentOS 上进行改造的,所以应安装 在CentOS 上的安装方式进行安装

1, 查看是否安装 yum:
yum --version
2,如果之前的版本,则卸载:
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
3,我们选择 Install using the repository 的安装方式
// 首先安装 yum-utils
sudo yum install -y yum-utils
// 配置仓库
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
/**
Docker Engine has three types of update channels, stable, test, and nightly:

The Stable channel gives you latest releases for general availability.
The Test channel gives pre-releases that are ready for testing before general availability (GA).
The Nightly channel gives you latest builds of work in progress for the next major release.
**/
// 以上的内容翻译过来会变味。大概意思就是说 docker engine 有三种更新模式,stable,test,nightly
//安装时不做修改
4,安装 docker
// 我们这里选择安装最新版
sudo yum install docker-ce docker-ce-cli containerd.io
// 如果有特殊版本选择要求,先查看,再安装
// 查看:
/**
$ yum list docker-ce --showduplicates | sort -r

docker-ce.x86_64  3:18.09.1-3.el7                     docker-ce-stable
docker-ce.x86_64  3:18.09.0-3.el7                     docker-ce-stable
docker-ce.x86_64  18.06.1.ce-3.el7                    docker-ce-stable
docker-ce.x86_64  18.06.0.ce-3.el7                    docker-ce-stable
**/
// 安装
/**
例如:
sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
**/
5,启动 Docker:
systemctl start docker
6,查看Docker
docker --version

卸载

yum remove docker-ce docker-ce-cli containerd.io //卸载
rm -rf /var/lib/docker // Images, containers, volumes, or customized configuration files on your host are not automatically removed.
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值