部署Docker私有镜像仓库Harbor

Harbor介绍

Harbor 是为企业用户设计的开源镜像仓库项目,包括了权限管理(RBAC)、LDAP、审计、安全漏洞扫描、镜像验真、管理界面、自我注册、HA等企业必需的功能,同时针对中国用户的特点,设计镜像复制和中文支持等功能。

官网:https://goharbor.io/

Harbor安装部署

# 1.harbor安装的环境要求
# 安装Harbor必须有docker环境和docker-compose环境
yum install -y docker-ce
yum install -y docker-compose

# 2.解压harbor安装包
[root@docker ~]# wget https://github.com/goharbor/harbor/releases/download/v2.10.0/harbor-offline-installer-v2.10.0.tgz
[root@docker ~]# tar xf harbor-offline-installer-v2.10.0.tgz

[root@docker ~]cd harbor
[root@docker ~/harbor]# ll
total 605144
-rw-r--r-- 1 root root 619632806 Sep  4  2019 harbor.v1.9.0.tar.gz
-rw-r--r-- 1 root root      5805 Sep  4  2019 harbor.yml.tmpl
-rwxr-xr-x 1 root root      5088 Sep  4  2019 install.sh
-rw-r--r-- 1 root root     11347 Sep  4  2019 LICENSE
-rwxr-xr-x 1 root root      1748 Sep  4  2019 prepare

# 3.复制配置模版并修改harbor配置
[root@docker ~/harbor]# cp -a harbor.yml.tmpl harbor.yml
[root@docker ~/harbor]# vim harbor.yml
hostname: hub.if010.com
harbor_admin_password: Harbor12345

# 4.执行安装脚本
[root@docker ~/harbor]# sh install.sh
[Step 1]: loading Harbor images ...
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

# 5.启动docker
[root@docker ~/harbor]# systemctl start docker
[root@docker ~/harbor]# sh install.sh
[Step 0]: checking installation environment ...
Note: docker version: 24.0.7
Note: docker-compose version: 1.18.0
[Step 1]: loading Harbor images ...
...
...
[Step 2]: preparing environment ...
...
...
Creating redis ... done
Creating harbor-core ... done
Creating network "harbor_harbor" with the default driver
Creating nginx ... done
Creating harbor-db ...
Creating registryctl ...
Creating harbor-portal ...
Creating redis ...
Creating registry ...
Creating harbor-core ...
Creating nginx ...
Creating harbor-jobservice ...
✔ ----Harbor has been installed and started successfully.----
Now you should be able to visit the admin portal at http://10.0.0.200.
For more details, please visit https://github.com/goharbor/harbor .

浏览器访问 https://hub.if010.com

默认用户名:admin
密码:Harbor12345

登录页面

// 看下,拉了一堆镜像
[root@docker ~]# docker images 
REPOSITORY                      TAG       IMAGE ID       CREATED        SIZE
goharbor/harbor-exporter        v2.10.0   1d3fdd3d102d   2 months ago   106MB
goharbor/redis-photon           v2.10.0   5083850c5206   2 months ago   165MB
goharbor/trivy-adapter-photon   v2.10.0   5873942a56be   2 months ago   478MB
goharbor/harbor-registryctl     v2.10.0   7a3b7d7d972c   2 months ago   149MB
goharbor/registry-photon        v2.10.0   9baecb934ded   2 months ago   83.4MB
goharbor/nginx-photon           v2.10.0   d1010aed334c   2 months ago   154MB
goharbor/harbor-log             v2.10.0   518f000ddf00   2 months ago   164MB
goharbor/harbor-jobservice      v2.10.0   4960b98063d3   2 months ago   140MB
goharbor/harbor-core            v2.10.0   00c9a2f5729c   2 months ago   168MB
goharbor/harbor-portal          v2.10.0   f3d83a4e7733   2 months ago   163MB
goharbor/harbor-db              v2.10.0   8215768668f6   2 months ago   269MB
goharbor/prepare                v2.10.0   2ac2fd8f7595   2 months ago   208MB

Harbor的使用

harbor新建项目

新建一个if010项目,在里面可以看到相关推送镜像的命令。
新建项目

harbor上传镜像

将本地镜像上传至harbor的if010项目仓库中

# 1.修改镜像名称
# 查看镜像
[root@docker ~]# docker images
REPOSITORY                      TAG       IMAGE ID       CREATED        SIZE
nginx                           latest    e4720093a3c1   9 days ago     187MB
# 给镜像改名(会生成一个新的镜像,与原镜像同一个ID)
[root@docker ~]# docker tag nginx:latest hub.if010.com/if010/nginx:latest
[root@docker ~]# docker images
REPOSITORY                      TAG       IMAGE ID       CREATED        SIZE
nginx                           latest    e4720093a3c1   9 days ago     187MB
hub.if010.com/if010/nginx       latest    e4720093a3c1   9 days ago     187MB

###命名规则###
照着上面截图命名即可:
harbor服务器地址/项目名称/镜像名称:标签
hub.if010.com/if010/nginx:latest

# 2.修改docker配置文件,信任harbor仓库地址
# 如果证书是真实有效的话可以不进行该项配置
[root@docker /etc/docker]# vim daemon.json
{
 "bip": "192.168.10.1/24",
 "registry-mirrors": ["https://pgz00k39.mirror.aliyuncs.com"],
 "insecure-registries": ["https://hub.if010.com"]
}
[root@docker01 ~]# systemctl restart docker


# 3.登录harbor
[root@docker ~]# docker login hub.if010.com
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


# 4.推送镜像
[root@docker ~]# docker push hub.if010.com/if010/nginx:latest
Using default tag: latest
The push refers to repository [hub.if010.com/if010/nginx:latest]
61a7fb4dabcd: Pushed 
bcc6856722b7: Pushed 
188d128a188c: Pushed 
7d52a4114c36: Pushed 
3137f8f0c641: Pushed 
84619992a45b: Pushed 
ceb365432eec: Pushed 
latest: digest: sha256:678226242061e7dd8c007c32a060b7695318f4571096cbeff81f84e50787f581 size: 1778

刷新查看:

效果图

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/421014.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

kotlin开发环境搭建,算法题+JVM+自定义View

什么是中年危机 根据权威数据显示,国内IT程序员鼎盛时期是在25-27岁左右,30岁对于程序员而言完全是一个38线,接着就是转业转岗的事情,这一点在业界也算是一个共识了。 大学毕业步入IT行业普遍年龄也是在22岁左右,然而…

线程安全的队列

学习一下别人写的,线程安全的队列代码。https://github.com/markparticle/WebServer/blob/master/code/log/blockqueue.hhttps://github.com/markparticle/WebServer/blob/master/code/log/blockqueue.h /** Author : mark* Date : 2020-06-16* copy…

20240301作业

1.使用fwrite、fread将一张随意的bmp图片&#xff0c;修改成德国的国旗 #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> int main(int argc, const char *argv[]) {FILE* fp fopen("./gaoda.bmp","…

Attention 中的 Q, K, V

Attention 中的 Q, K, V flyfish Attention Is All You Need. Q query 查询 K key 键 V value 值 简单理解 一篇文章&#xff0c;文章的标题就是key&#xff0c;文章的内容就是V 使用搜索引擎时&#xff0c;输入到 搜索栏中的文本 就是 query 输入内容 query 与 文章标…

你不可不知的数据安全词汇都在这!

关注公众号&#xff0c;回复关键词 “数据安全”&#xff0c;即可获取报告完整版 随着数字化时代的快速发展&#xff0c;数据安全已成为全球企业和组织面临的一项重大挑战。在这一背景下&#xff0c;我们深感需要有一个统一的、全面的数据安全术语基础&#xff0c;以便行业从业…

P2040 打开所有的灯

题目传送门&#xff1a;P2040 打开所有的灯 用深度优先搜索实现的一个填色题。 题目步骤&#xff1a; 1..dfs 首先dfs要判断是否符合题意&#xff0c;如果符合题意就更新最短路&#xff1b; 如果不符合题意就枚举 如果是关的就把周围四个包括 给标记上和原来相反的&#xf…

Redis--持久化机制详解

什么是redis持久化&#xff1f; Redis持久化是将内存的数据持久化到磁盘上&#xff0c;防止Redis宕机或者断点的时候内存中的数据丢失&#xff0c;把内存中的数据写入到磁盘的过程叫持久化。 Redis持久化的方式&#xff1f; RDB&#xff08;Redis DataBase&#xff09;&…

【YOLO v5 v7 v8 小目标改进】中心化特征金字塔(CFP) = 特征金字塔 + 显式视觉中心(EVC)+ 全局集中调节(GCR)

中心化特征金字塔&#xff08;CFP&#xff09; 特征金字塔 显式视觉中心&#xff08;EVC&#xff09; 全局集中调节&#xff08;GCR&#xff09; 提出背景中心化特征金字塔&#xff08;CFP&#xff09;CFP 架构图问题&#xff1a;不同尺度的对象检测问题&#xff1a;有限感受…

LeetCode //C - 118. Pascal‘s Triangle

118. Pascal’s Triangle Given an integer numRows, return the first numRows of Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown: Example 1: Input: numRows 5 Output: [[1],[1,1],[1,2,1],[1,…

Spring Cloud 构建面向企业的大型分布式微服务快速开发框架+技术栈介绍

分布式架构图 Cloud架构清单 Commonservice&#xff08;通用服务&#xff09; 1&#xff09;清单列表 2&#xff09;代码结构 Component&#xff08;通用组件&#xff09; 1&#xff09;清单列表 2&#xff09;代码结构 快速开发管理平台——云架构【系统管理平台】 一…

python requests接口自动化测试 (数据库断言)

前言 熟练掌握接口自动化测试体系背后的这些技能和处理问题的思路&#xff0c;实现时间、人力、收益的平衡&#xff0c;对于一个经验尚浅的初、中级测试开发人员来说绝对是一个艰巨的挑战。 五步教会你写接口自动化用例 需要安装三方包:requests pytest pytest-htmlpip insta…

视觉三维重建colmap框架的现状与未来

近两年AI技术的火热尤其是nerf和gaussian splatting的出现&#xff0c;又将colmap推了一把&#xff0c;传统mvs的地位仿佛受到了挑战&#xff0c;虽然说nerf/gs的效果是无法胜任传统mvs的精度&#xff0c;但是作为"看看"的条件&#xff0c;是远远足够了。且传统重复纹…

chartjs 饼状图

之前要把canvas先清除掉&#xff0c;不然刷新数据&#xff0c;还会有前面的图表 function clearCanvas(){$(#donutChart).remove();$(#chartdiv).append(<canvas id"donutChart" style"min-height: 500px; height: 500px; max-height: 500px; max-width: 70%…

一文搞懂 Transformer 工作原理 !!

文章目录 前言 一、单头Attention工作原理 二、多头Attention工作原理 三、全连接网络工作原理 前言 本文将从单头Attention工作原理、多头Attention工作原理、全连接网络工作原理三个方面&#xff0c;实现一文搞懂Transformer的工作原理。 Transformer工作原理 一、单头Atte…

【学习记录】Resnet

Resnet的残差块 BasicBlock模块&#xff1a; Resnet的作用 解决梯度消失。网络越深&#xff0c;会导致梯度消失。Resnet可以解决梯度消失的问题。 Resnet的原理 参考视频&#xff1a;https://www.bilibili.com/video/BV1cM4y117ob/?spm_id_from333.337.search-card.all.cl…

达梦数据库查询语句内存溢出问题解决

背景&#xff1a;达梦数据库使用过程中&#xff0c;某天突然服务宕机&#xff0c;导致各类后端服务无法注册到nacos上&#xff0c;重启之后nacos正常启动&#xff0c;可执行一条两千多条数据量的连表查询时间很长&#xff0c;甚至会报错&#xff0c;经查看日志发现在查询过程中…

恒创科技:服务器CPU核心和线程如何理解?

​  关于 CPU 核心和线程&#xff0c;是服务器处理能力的核心和灵魂&#xff0c;它们决定了服务器执行任务和同时处理多个操作的效率。 那么&#xff0c;服务器中的 CPU 核心和线程到底是什么?如何理解呢? 什么是CPU核心? CPU核心作为CPU(中央处理单元)的主要处理单元。该…

Windows下卸载JDK

操作步骤&#xff1a; 直接到windows程序卸载面板进行卸载 然后删除已配置的环境变量

Python调用ChatGPT API使用国内中转key 修改接口教程

大家好&#xff0c;我是淘小白~ 有的客户使用4.0的apikey ,直接使用官方直连的apikey消费很高&#xff0c;有一位客户一个月要消费2万&#xff0c;想使用4.0中转的apikey&#xff0c;使用中转的apikey 需要修改官方的openai库&#xff0c;下面具体说下。 1、首先确保安装的op…

在vue2中使用饼状图

1.引入vue2和echarts <script src"https://cdn.jsdelivr.net/npm/vue2.7.14/dist/vue.js"></script> <script src"https://cdn.jsdelivr.net/npm/echarts5.4.0/dist/echarts.min.js"></script> 2.1 补充基本的body内容 <div id…