Harbor在安装前的几个注意点

由于Harbor有1.8后和前的配置不一样,决定先安装1.8,结果报错如下

[root@localhost harbor]# ./install.sh 

[Step 0]: checking installation environment ...
✖ Need to upgrade docker package to 17.06.0+. 

对docker的版本要求较高,决定先卸载之前的docker

[root@topcheer harbor]# docker --version
Docker version 1.13.1, build 7f2769b/1.13.1

[root@topcheer harbor]# ./install.sh

[Step 0]: checking installation environment ...
✖ Need to upgrade docker package to 17.06.0+.

开始卸载

[root@topcheer harbor]# yum remove docker                   docker-client                   docker-client-latest                   docker-common                   docker-latest                   docker-latest-logrotate                   docker-logrotate                   docker-selinux                   docker-engine-selinux                   docker-engine
已加载插件:fastestmirror, langpacks
参数 docker-client-latest 没有匹配
参数 docker-latest 没有匹配
参数 docker-latest-logrotate 没有匹配
参数 docker-logrotate 没有匹配
参数 docker-engine 没有匹配
正在解决依赖关系
--> 正在检查事务
---> 软件包 container-selinux.noarch.2.2.107-3.el7 将被 删除
---> 软件包 docker.x86_64.2.1.13.1-103.git7f2769b.el7.centos 将被 删除
---> 软件包 docker-client.x86_64.2.1.13.1-103.git7f2769b.el7.centos 将被 删除
---> 软件包 docker-common.x86_64.2.1.13.1-103.git7f2769b.el7.centos 将被 删除
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================================
 Package                             架构                     版本                                                   源                         大小
=====================================================================================================================================================
正在删除:
 container-selinux                   noarch                   2:2.107-3.el7                                          @extras                    40 k
 docker                              x86_64                   2:1.13.1-103.git7f2769b.el7.centos                     @extras                    65 M
 docker-client                       x86_64                   2:1.13.1-103.git7f2769b.el7.centos                     @extras                    13 M
 docker-common                       x86_64                   2:1.13.1-103.git7f2769b.el7.centos                     @extras                   4.4 k

事务概要
=====================================================================================================================================================
移除  4 软件包

安装大小:77 M
是否继续?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在删除    : 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64                                                                                 1/4
警告:/etc/sysconfig/docker-storage 已另存为 /etc/sysconfig/docker-storage.rpmsave
  正在删除    : 2:docker-client-1.13.1-103.git7f2769b.el7.centos.x86_64                                                                          2/4
  正在删除    : 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64                                                                          3/4
  正在删除    : 2:container-selinux-2.107-3.el7.noarch                                                                                           4/4
  验证中      : 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64                                                                          1/4
  验证中      : 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64                                                                                 2/4
  验证中      : 2:container-selinux-2.107-3.el7.noarch                                                                                           3/4
  验证中      : 2:docker-client-1.13.1-103.git7f2769b.el7.centos.x86_64                                                                          4/4

删除:
  container-selinux.noarch 2:2.107-3.el7                                    docker.x86_64 2:1.13.1-103.git7f2769b.el7.centos
  docker-client.x86_64 2:1.13.1-103.git7f2769b.el7.centos                   docker-common.x86_64 2:1.13.1-103.git7f2769b.el7.centos

完毕!

安装新的docker,首先要先update一下,不然后面会报错

[root@topcheer harbor]# systemctl restart docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[root@topcheer harbor]#  sudo yum update

最后在开始正式安装

[root@topcheer harbor]# yum install -y yum-utils
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 yum-utils.noarch.0.1.1.31-50.el7 将被 升级
---> 软件包 yum-utils.noarch.0.1.1.31-52.el7 将被 更新
--> 解决依赖关系完成

依赖关系解决

[root@topcheer harbor]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
已加载插件:fastestmirror, langpacks
adding repo from: https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@topcheer harbor]# yum list docker-ce --showduplicates|sort -r
已加载插件:fastestmirror, langpacks
可安装的软件包
 * updates: mirrors.tuna.tsinghua.edu.cn
Loading mirror speeds from cached hostfile
 * extras: mirrors.tuna.tsinghua.edu.cn
docker-ce.x86_64            3:19.03.4-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.3-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.2-3.el7                     docker-ce-stable
.....


[root@topcheer harbor]# yum install docker-ce-17.06.2.ce-1.el7.centos
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 docker-ce.x86_64.0.17.06.2.ce-1.el7.centos 将被 安装
--> 正在处理依赖关系 container-selinux >= 2.9,它被软件包 docker-ce-17.06.2.ce-1.el7.centos.x86_64 需要
--> 正在检查事务
---> 软件包 container-selinux.noarch.2.2.107-3.el7 将被 安装
--> 解决依赖关系完成
原文地址:https://www.cnblogs.com/dalianpai/p/11795201.html