创建一个k8s私有仓库-harbor

〇.前言

这一步应该是在搭建k8s之前做好,注意了奥

一.安装docker和docker-compose

1.下载docker-compose的最新版本

# 建议那种网上冲浪下载!,下载下来记得命名成docker-compose
wget https://github.com/docker/compose/releases/download/1.22.0/docker-compose-Linux-x86_64

2.为docker-compose添加可执行权限

chmod +x /usr/local/bin/docker-compose

3.验证查看docker-compose版本

docker-compose --version

二.安装Harbor

Harbor支持在线和离线安装方式,这里,我们使用离线方式,先下载Harbor安装包:

# 还是推荐你懂的那种网上冲浪!!!
wget https://storage.googleapis.com/harbor-releases/harbor-offline-installer-v1.5.3.tgz

2.1解压离线安装包

tar -zxvf harbor-offline-installer-v1.5.3.tgz #解压离线安装包
mv harbor /opt/ #移到/opt目录下
cd /opt #进入到/opt目录
ll #查看目录内容

2.2配置Harbor

cd harbor #进入到harbor目录
ll #查看目录内容

编辑配置,并执行安装

vim harbor.cfg #编辑配置文件

修改以下内容

hostname = 192.168.1.112 #修改harbor的启动ip,这里需要依据系统ip设置
harbor_admin_password = Anxminise123 #修改harbor的admin用户的密码

2.3安装Harbor

./prepare #配置Harbor
./install.sh #安装Harbor

等待。。完成!!

Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating redis              ... done
Creating registry           ... done
Creating harbor-adminserver ... done
Creating harbor-db          ... done
Creating harbor-ui          ... done
Creating nginx              ... done
Creating harbor-jobservice  ... done

✔ ----Harbor has been installed and started successfully.----

Now you should be able to visit the admin portal at http://172.26.130.201.
For more details, please visit https://github.com/vmware/harbor .

三.访问Harbor

浏览器打开http://172.26.130.201

posted @ 2021-07-19 17:27  带着泥土  阅读(248)  评论(0编辑  收藏  举报