依赖于docker-compose
下载
curl -L “https://github.com/docker/compose/releases/download/2.22.0/docker-compose- ( u n a m e − s ) − (uname -s)- (uname−s)−(uname -m)” -o/usr/local/bin/docker-compose
添加执行权限
chmod +x /usr/local/bin/docker-compose
测试
docker-compose --version
安装harbor
下载
wget https://github.com/goharbor/harbor/releases/download/v2.8.4/harbor-offline-installer-v2.8.4.tgz
解压
tar -zxvf harbor-offline-installer-v2.8.4.tgz
修改配置文件
cd harbor & cp harbor.yml.tmpl harbor.yml & vi harbor.yml
部署
./install.sh
配置开机自启动
docker-compose -f docker-compose.yml up -d
登录验证
使用harbor
登录
docker login 192.168.19.102:8000
打标签
docker tag {image name}:{tag} {harbor ip}:{port}/{harbor project}/{image name}:{tag}
# eg
docker tag apache-doris:1.2.6-be 192.168.19.102:8000/doris/apache-doris:1.2.6-be
docker commit container-name {harbor ip}:{port}/{harbor project}/{image name}:{tag}
上传
docker push {harbor ip}:{port}/{harbor project}/{image name}:{tag}
# eg
docker push 192.168.19.102:8000/doris/apache-doris:1.2.6-be
下载
docker pull {harbor ip}:{port}/{harbor project}/{image name}:{tag}
# eg
docker pull 192.168.19.102:8000/doris/apache-doris:1.2.6-be
常见问题
-
docker login问题:Error response from daemon: Get https://: http: server gave HTTP response to HTTPS client文章来源:https://www.toymoban.com/news/detail-719390.html
# 原因:服务器通过docker login命令登录报错 # 解决方法 vi /etc/docker/daemon.json { "insecure-registries": ["192.168.19.102:8000"] } systemctl daemon-reload systemctl restart docker [root@iZuf61frmjzzdoqitgbd9hZ harbor]# docker login 192.168.19.102:8000 Username: admin Password: WARNING! Your password will be stored unencrypted in /root/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store Login Succeeded
-
k8s无法下载镜像 unauthorized: unauthorized to access repository文章来源地址https://www.toymoban.com/news/detail-719390.html
# 创建secret kubectl create secret docker-registry harbor-login-registry --docker-email=dd@example --docker-username=admin --docker-password=admin --docker-server=192.168.19.102:8000 # k8s yaml增加配置 imagePullSecrets: # 使用密码登录 - name: harbor-login-registry
到了这里,关于【Docker】简易版harbor部署的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!