基础环境: centos7.8
docker安装+harbor安装
1,使用阿里云yum源;
2,安装docker
3安装harobr
cd /etc/yum.repos.d/ rm-rf ./* wget-O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo yum clean all yum makecache yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo yum makecache fast yum install docker-ce # dock开机启动sudo systemctl enable docker sudo systemctl start docker
安装aliyun镜像加速器
sudomkdir-p /etc/docker sudotee /etc/docker/daemon.json <<-'EOF'{ "registry-mirrors": ["https://66tucjaq.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
docker compose安装
sudocurl-L https://get.daocloud.io/docker/compose/releases/download/1.23.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose sudochmod+x /usr/local/bin/docker-compose docker-compose --version
harbor离线包下载:https://github.com/goharbor/harbor/releases
tar -zxvf harbor-offline-installer-v2.6.0.tgz cp harbor.yml.tmpl harbor.yml
修改harbor配置文件
修改hostname,如本地测试禁用https,使用默认http80端口,执行harbor解压目录下install.sh脚本
harbor后续通过docker-compose启动和关闭
docker-compose startdocker-compose stop
访问域名
部署完毕。