docker-compose安装harbor
环境:centos7
1、安装docker
官方文档
- https://docs.docker.com/engine/install/centos/
1、卸载旧版本
$ sudo yum remove docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-engine
2、设置rpm仓库
2.1 配置官方仓库
$ sudo yum install yum-utils device-mapper-persistent-data lvm2
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
2.2 配置阿里云仓库
$ sudo yum install yum-utils device-mapper-persistent-data lvm2
$ yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、安装指定版本 Docker Engine-Community
3.1 查看所有版本
$ yum list docker-ce --showduplicates | sort -r
3.2 安装指定版本
$ yum install docker-ce-20.10.8-3.el7 docker-ce-cli-20.10.8-3.el7 containerd.io docker-compose-plugin
4、配置镜像加速
$ mkdir -p /etc/docker
$ tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors":["https://registry.docker-cn.com","https://smym36v5.mirror.aliyuncs.com"],
"insecure-registries":["harbor地址:harbor端口"]
}
EOF$ systemctl daemon-reload
$ systemctl restart docke
5、验证docker
$ docker version
2、安装docker-compose
github地址
- https://github.com/docker/compose/releases/
下载地址
- https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64
安装
wget https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64
chmod +x docker-compose-linux-x86_64
mv docker-compose-linux-x86_64 docker-compose
验证
docker-compose version
3、下载harbor
github地址
- https://github.com/goharbor/harbor/releases
官方文档 - https://goharbor.io/docs/2.9.0/install-config/
$ wget https://github.com/goharbor/harbor/releases/download/v2.9.1/harbor-offline-installer-v2.9.1.tgz
4、开始安装
4.1 修改配置
$ tar xf harbor-offline-installer-v2.9.1.tgz
$ cd harbor
$ cp harbor.yml.tmpl harbor.yml
$ vim harbor.yml
4.2 开始安装
$ ./install.sh
6、验证
web登录默认账号密码: admin / Harbor12345
$ docker ps