安装docker
卸载原来安装的旧版本
yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
安装一个管理repository的工具
yum install -y yum-utils
添加docker镜像仓库文件
yum-config-manager --add-repo https://download.docker.com/linux/centos/dockerce.repo
安装docker社区版和相关工具
yum install -y docker-ce docker-ce-cli containerd.io #默认安装最新版本
镜像加速
mkdir -p /etc/docker tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://l0grswq5.mirror.aliyuncs.com"] } EOF systemctl daemon-reload systemctl restart docker
启动docker
systemctl start docker && systemctl enable docker
安装docker-compose
下载源码文件
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.9.0/dockercompose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
给文件授权
chmod +x /usr/local/bin/docker-compose
检验是否安装成功
docker-compose --version
安装Harbor
下载Harbor源码包
链接:https://pan.baidu.com/s/1oladwRia9li2P-YWJUJEAQ?pwd=97er
提取码:97er
解压Harbor压缩文件
tar -zxf harbor-offline-installer-v2.4.1.tgz
修改配置文件
cd harbor cp harbor.yml.tmpl harbor.yml vim harbor.yml