认识docker
什么是Docker?
Docker是基于Go语言实现的云开源项目。
docker 安装:
1,先卸载旧版:
yum remove docker
2,配置yum 源:
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3,查看docker版本:
yum list docker-ce --showduplicates | sort -r
docker-ce.x86_64 3:20.10.9-3.el7 docker-ce-stable
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
yum install docker-ce-20.10.9 docker-ce-cli-20.10.9 containerd.io
4,安装docker:
yum install docker-ce
rpm包解决依赖
rpm -ivh xxx --nodeps 忽略软件包的依赖关系强行安装
rpm -ivh xxx --force 忽略软件包及文件的冲突
注:http://rpm.pbone.net/ 基本可以找到你要的包;
发现有依赖,依赖包解决掉:
---> Package docker-scan-plugin.x86_64 0:0.9.0-3.el7 will be installed
--> Finished Dependency Resolution
Error: Package: docker-ce-rootless-extras-20.10.10-3.el7.x86_64 (docker-ce-stable)
Requires: fuse-overlayfs >= 0.7
Error: Package: docker-ce-rootless-extras-20.10.10-3.el7.x86_64 (docker-ce-stable)
Requires: slirp4netns >= 0.4
5,再次安装yum install docker-ce: (可以看到几个包一同安装)
Installing:
docker-ce x86_64 3:20.10.10-3.el7 docker-ce-stable 23 M
Installing for dependencies:
containerd.io x86_64 1.4.11-3.1.el7 docker-ce-stable 28 M
docker-ce-cli x86_64 1:20.10.10-3.el7 docker-ce-stable 29 M
docker-ce-rootless-extras x86_64 20.10.10-3.el7 docker-ce-stable 8.0 M
docker-scan-plugin x86_64 0.9.0-3.el7 docker-ce-stable 3.7 M
libseccomp x86_64 2.3.1-3.el7 wsupdates 56 k
6,启用dockers服务:
service docker start
service docker status