ITPub博客

首页 > 云计算 > > Centos7 Docker安装

Centos7 Docker安装

作者:浪花小雨滴 时间:2020-05-11 18:23:16 0 删除 编辑

若安装了旧版

	yum remove docker  docker-client  docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine


1.安装所需的软件包。yum-utils 提供了 yum-config-manager ,并且 device mapper 存储驱动程序需要 device-mapper-persistent-data 和 lvm2。

	yum install -y yum-utils device-mapper-persistent-data lvm2

2.使用以下命令来设置稳定的仓库。

	yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

3.安装 Docker Engine-Community

3.1.安装最新版本的 Docker Engine-Community 和 containerd

	yum install docker-ce docker-ce-cli containerd.io

3.2.或者按照历史版本

3.2.1.列出并排序您存储库中可用的版本。此示例按版本号(从高到低)对结果进行排序。

		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

3.2.2.通过其完整的软件包名称安装特定版本,该软件包名称是软件包名称(docker-ce)加上版本字符串(第二列),从第一个冒号(:)一直到第一个连字符,并用连字符(-)分隔。例如:docker-ce-18.09.1。

		yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd

4.启动 Docker

	systemctl start docker

5.通过运行 hello-world 映像来验证是否正确安装了 Docker Engine-Community 。

	docker run hello-world

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31537575/viewspace-3167184/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2018-05-16

  • 博文量
    4259
  • 访问量
    39957