docker企业级镜像仓库harbor搭建

2023-05-16

目录

      • 1. 下载harbor离线安装包
      • 2. 解压harbor安装包
      • 3. 编辑harbor配置文件
      • 4. 编辑docker配置文件
      • 5. 安装docker-compose
      • 6. 运行安装脚本
      • 7. 访问harbor网页端
      • 8. 登录harbor
      • 9. 推送docker镜像到harbor

1. 下载harbor离线安装包

v1.10.9
v2.3.4
v2.3.5
v2.4.1

wget https://github.com/goharbor/harbor/releases/download/v1.10.9/harbor-offline-installer-v1.10.9.tgz

2. 解压harbor安装包

tar xvf harbor-offline-installer-v1.10.9.tgz -C /usr/local/

在这里插入图片描述

3. 编辑harbor配置文件

vim /usr/local/harbor/harbor.yml

在这里插入图片描述

4. 编辑docker配置文件

vim /etc/docker/daemon.json
然后执行下面命令重启docker服务
sudo systemctl daemon-reload
sudo systemctl restart docker

{
             "registry-mirrors": [
                              "http://f1361db2.m.daocloud.io","https://6drkwgha.mirror.aliyuncs.com"
                                   ],
             "insecure-registries":["192.168.227.57:5000","192.168.227.57:80"]
                                         }

5. 安装docker-compose

// 下载docker-compose(下载到/usr/local/bin/文件夹下即可使用)
curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose 
// 修改docker-compose文件的权限  
chmod 777 /usr/local/bin/docker-compose
//执行docker-compose version命令,显示如下版本说明docker-compose安装成功

在这里插入图片描述

6. 运行安装脚本

/usr/local/harbor/install.sh  --with-clair --with-chartmuseum
注意:2.+版本需要去除--with-clair这个参数
[root@localhost harbor]# /usr/local/harbor/install.sh  --with-clair --with-chartmuseum

[Step 0]: checking if docker is installed ...

Note: docker version: 20.10.12

[Step 1]: checking docker-compose is installed ...

Note: docker-compose version: 1.29.2

[Step 2]: loading Harbor images ...
Loaded image: goharbor/harbor-core:v1.10.9
Loaded image: goharbor/harbor-jobservice:v1.10.9
Loaded image: goharbor/notary-signer-photon:v1.10.9
Loaded image: goharbor/nginx-photon:v1.10.9
Loaded image: goharbor/chartmuseum-photon:v1.10.9
Loaded image: goharbor/registry-photon:v1.10.9
Loaded image: goharbor/clair-photon:v1.10.9
Loaded image: goharbor/clair-adapter-photon:v1.10.9
Loaded image: goharbor/prepare:v1.10.9
Loaded image: goharbor/harbor-portal:v1.10.9
Loaded image: goharbor/harbor-db:v1.10.9
Loaded image: goharbor/notary-server-photon:v1.10.9
Loaded image: goharbor/harbor-log:v1.10.9
Loaded image: goharbor/harbor-registryctl:v1.10.9
Loaded image: goharbor/redis-photon:v1.10.9


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /usr/local/harbor
/usr/src/app/utils/configs.py:100: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  configs = yaml.load(f)
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
/usr/src/app/utils/configs.py:90: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  versions = yaml.load(f)
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Clearing the configuration file: /config/clair/postgresql-init.d/README.md
Clearing the configuration file: /config/clair/postgres_env
Clearing the configuration file: /config/clair/config.yaml
Clearing the configuration file: /config/clair/clair_env
Clearing the configuration file: /config/clair-adapter/env
Clearing the configuration file: /config/chartserver/env
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /secret/keys/secretkey
Copying offline data file for clair DB
Generated configuration file: /config/clair/postgres_env
Generated configuration file: /config/clair/config.yaml
Generated configuration file: /config/clair/clair_env
Generated configuration file: /config/clair-adapter/env
Generated configuration file: /config/chartserver/env
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir



[Step 5]: starting Harbor ...
Creating harbor-log ... done
Creating harbor-db     ... done
Creating redis         ... done
Creating registry      ... done
Creating harbor-portal ... done
Creating chartmuseum   ... done
Creating registryctl   ... done
Creating clair         ... done
Creating harbor-core   ... done
Creating clair-adapter ... done
Creating harbor-jobservice ... done
Creating nginx             ... done
 ----Harbor has been installed and started successfully.----

7. 访问harbor网页端

访问地址:http://192.168.227.57/harbor
默认管理员admin ;密码 Harbor12345

在这里插入图片描述

8. 登录harbor

docker login 192.168.227.57:80
默认管理员admin ;密码 Harbor12345

在这里插入图片描述

9. 推送docker镜像到harbor

[root@localhost ~]# docker tag e77d7ce2134c 192.168.227.57:80/jamysong/mariadb:10.3
[root@localhost ~]# docker push 192.168.227.57:80/jamysong/mariadb:10.3
The push refers to repository [192.168.227.57:80/jamysong/mariadb]
f5d31ca48d87: Pushed 
2b4d61b5a22b: Pushed 
d92e0331c7a2: Pushed 
6627237e4074: Pushed 
672465781193: Pushed 
6c649bbdd7d6: Pushed 
286a90349ea9: Pushed 
eb3b55e3972c: Pushed 
8f2689356f7c: Pushed 
657a7983a5d3: Pushed 
9f54eef41275: Pushed 
10.3: digest: sha256:cd33a9afb2e44071e6bb3aee07a3552ce99b350f4bdcff7673bc568dd32160e9 size: 2619

看看从本地推送到harbor的镜像
在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

docker企业级镜像仓库harbor搭建 的相关文章

随机推荐

  • linux搭建nacos集群

    目录 前言1 准备mysql数据库2 准备nacos压缩包 xff08 1 xff09 下载nacos xff08 2 xff09 创建集群节点目录 xff08 3 xff09 修改集群配置文件 3 复制nacos到每个节点目录4 修改se
  • docker搭建mysql8.0主备(主从复制)

    目录 前言1 拉取mysql8 0 25镜像2 启动mysql容器3 修改配置文件4 进入主容器mysql5 进入从容器mysql6 测试主从复制效果 注意事项 xff1a 前言 由于最近项目中开始要用到mysql主备模式 xff0c 所以
  • window11系统安装

    目录 前言1 系统配置要求2 安装方式Windows 11 安装助手创建 Windows 11 安装媒体下载 Windows 11 磁盘映像 ISO 3 安装 微软官网下载地址 也可用迅雷下载 其他版本下载地址 xff08 可用迅雷下载 x
  • docker搭建consul集群

    目录 官方下载地址1 拉取 Consul 镜像2 启动consul主容器 xff08 搭建数据中心dc1 xff09 3 查询dc1中主容器IP地址4 启动其他容器并加入dc15 查看数据中心dc1节点6 启动consul主容器 xff08
  • docker搭建zookeeper集群

    目录 前言1 拉取镜像2 启动容器3 查看容器IP4 修改容器配置文件4 1 修改容器 xff08 10 88 0 19 xff09 的zoo cfg文件4 2 修改容器 xff08 10 88 0 20 xff09 的zoo cfg文件4
  • imagex工具整合window11的wim镜像

    目录 前言1 提取install wim镜像文件2 用wintool查看镜像文件3 用imagex整合镜像4 查看整合后的镜像5 替换install wim文件6 效果图 前言 window11镜像微软官网昨天刚刚发布出来 xff0c 现在
  • 制作window11系统U盘启动盘

    目录 前言1 U盘分区2 复制系统文件到U盘3 编辑bcd文件4 查看系统安装盘 xff08 U盘 xff09 前言 制作系统安装U盘需要使用到bootice这个工具 下载地址 xff0c 它主要是用来给U盘分区以及编辑bcd引导文件的 这
  • macOS Big Sur系统安装

    目录 前言系统安装U盘制作系统安装过程 前言 本次是在Vmware虚拟机用U盘启动盘来安装的macOS Big Sur 10 16版本 模仿实体机安装 xff0c 首先在虚拟机的macOS10 15系统中 xff0c 进入终端执行命令制作U
  • linux下安装nginx

    前言 nginx是一款高性能的 HTTP 和反向代理的web服务器 xff0c Nginx 可以作为静态页面的 web 服务器 xff0c 同时还支持 CGI 协议的动态语言 xff0c 但是不支持 java Java 程序只能通过与 to
  • js中获取当前点击的li标签以及li标签中a标签的id

    可以使用以下代码来获取当前点击的li标签的id xff1a document querySelectorAll 39 li 39 forEach function li li addEventListener 39 click 39 fun
  • linux下nginx的使用

    目录 前言1 nginx conf配置文件2 反向代理3 负载均衡4 动静分离5 高可用配置 前言 今天来说一下nginx的具体怎么使用 xff08 nginx安装参考这里 xff09 xff0c 主要包括反向代理 负载均衡 动静分离以及高
  • docker命令详解

    docker命令集 命令说明容器生命周期管理run创建一个新容器并运行start开启一个容器并使其在后台运行stop停止一个容器restart重启一个容器kill杀掉一个容器进程rm删除容器pause暂停容器unpause恢复暂停容器cre
  • redis常见问题与解决方案

    文章目录 缓存穿透 问题描述解决方案 缓存击穿 问题描述解决方案 缓存雪崩 问题描述解决方案 缓存穿透 问题描述 key 对应的数据在数据源并不存在 xff0c 每次针对此 key 的请求从缓存获取不到 xff0c 请求都会压到数据库 xf
  • jar包里面文件修改

    目录 前言1 解压jar包2 编辑要修改的配置文件3 重新生成jar包4 替换 前言 之前认为只要用解压软件打开包 xff0c 把里面要修改的配置文件提取出来编辑完成后直接替换掉jar包里原来的文件就好 xff0c 但实际项目中这样做很可能
  • javaweb项目字符集设置

    目录 前言1 编辑idea的VM Options属性文件2 idea的settings设置3 idea中tomcat设置4 tomcat字符集设置 前言 今天主要来讲一下在idea开发java web项目中怎么统一字符集 xff0c 乱码在
  • maven

    目录 1 maven安装1 1 maven下载1 2 配置maven环境变量1 3 settings配置文件 2 maven使用2 1 maven项目的层级结构2 2 maven工作方式2 3 maven生命周期2 4 maven命令2 5
  • docker之网络篇

    前言 刚开始学习docker的时侯 xff0c 启动容器时并没有指定网络 xff0c 使用的是默认的bridge xff0c 也就是桥接的模式 xff0c 这种模式下启动的容器间都是可以相互通信的 xff0c 所以使用起来也是特别的爽 xf
  • 虚拟机中Linux怎么与宿主机、外网通信

    目录 前言一 NAT模式1 设置宿主机2 设置VMware虚拟机3 对虚拟机Linux进行设置4 重启linux网络服务 二 桥接模式1 cmd命令行窗口查询IP地址2 设置Linux3 重启网卡服务 三 only host模式1 设置宿主
  • docker私有镜像仓库搭建

    目录 1 拉取registry镜像2 启动registry容器3 编辑daemon json文件4 重新加载docker配置5 访问私库web页面6 推送镜像到registry私库 1 拉取registry镜像 span class tok
  • docker企业级镜像仓库harbor搭建

    目录 1 下载harbor离线安装包2 解压harbor安装包3 编辑harbor配置文件4 编辑docker配置文件5 安装docker compose6 运行安装脚本7 访问harbor网页端8 登录harbor9 推送docker镜像