github: https://github.com/goharbor/harbor

官网:https://goharbor.io/docs/2.5.0/

[安装]

1. 查看是否达到安装条件

2.根据实际情况选择 在线版本和离线版本

  • Online installer: The online installer downloads the Harbor images from Docker hub. For this reason, the installer is very small in size.

  • Offline installer: Use the offline installer if the host to which are deploying Harbor does not have a connection to the Internet. The offline installer contains pre-built images, so it is larger than the online installer.

我这里使用的在线版本进行安装:

3.下载并安装

wget https://github.com/goharbor/harbor/releases/download/v2.5.0/harbor-online-installer-v2.5.0.tgz

tar -zxvf harbor-online-installer-v2.5.0.tgz

修改配置文件:

mv harbor.yml.tmpl harbor.yml

vim harbor.yml
如果配置的域名或使用指定的端口的话, 需要修改 hostname:
如果80端口有占用的话, 需要修改参数: port
如果没有使用https的话, 需要将参数进行注释: https 部分

extenal_url: 可以与hostname 保持一致

注意点: 可以修改这里的admin登录的密码  harbor_admin_password

安装:

./install.sh

打开web界面 进行登录

1)创建项目(共有,私有)

2)用户管理 > 创建用户

3)将用户绑定到指定的仓库下

使用:

1) 登录

docker login  -u xxx -p  xxx   xx.xxx.com

例如:
[root@localhost src]# docker login 192.168.139.132
Username: caixin
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
[root@localhost src]#

2)镜像推送

先进行打tag

[root@localhost src]# docker tag nginx:1.18.0 192.168.139.132/library/nginx:1.18.0
[root@localhost src]# docker tag mysql:5.7.32 192.168.139.132/library/mysql:5.7.32
[root@localhost src]# docker tag php:5.6-fpm 192.168.139.132/library/php:5.6-fpm [root@localhost src]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.139.132/library/nginx 1.18.0 c2c45d506085 12 months ago 133MB
nginx 1.18.0 c2c45d506085 12 months ago 133MB
192.168.139.132/library/mysql 5.7.32 cc8775c0fe94 15 months ago 449MB
mysql 5.7.32 cc8775c0fe94 15 months ago 449MB
192.168.139.132/library/php 5.6-fpm 3458979c7744 3 years ago 344MB
php 5.6-fpm 3458979c7744 3 years ago 344MB
goharbor/chartmuseum-photon v0.7.1-v1.7.0 666d74cc236a 3 years ago 111MB
goharbor/harbor-migrator v1.7.0 482699d98927 3 years ago 799MB
goharbor/redis-photon v1.7.0 8adff755797f 3 years ago 96.1MB
goharbor/clair-photon v2.0.7-v1.7.0 7e72f6ba05bd 3 years ago 165MB
goharbor/notary-server-photon v0.6.1-v1.7.0 b4a22960dfce 3 years ago 102MB
goharbor/notary-signer-photon v0.6.1-v1.7.0 bb0db7ebd1de 3 years ago 99.6MB
goharbor/harbor-registryctl v1.7.0 1906a8b84fa5 3 years ago 101MB
goharbor/registry-photon v2.6.2-v1.7.0 677f21b09362 3 years ago 86.4MB
goharbor/nginx-photon v1.7.0 6ed96fc73f83 3 years ago 35.5MB
goharbor/harbor-log v1.7.0 722fa4a77846 3 years ago 81MB
goharbor/harbor-jobservice v1.7.0 effd390c0cd4 3 years ago 83.8MB
goharbor/harbor-core v1.7.0 2ebd58ce5638 3 years ago 95.2MB
goharbor/harbor-portal v1.7.0 72a291f86bab 3 years ago 40.2MB
goharbor/harbor-adminserver v1.7.0 9f850341a571 3 years ago 72MB
goharbor/harbor-db v1.7.0 45d94fe5fee5 3 years ago 133MB
docker/compose 1.18.0 8a01ec091f90 4 years ago 19.2MB
[root@localhost src]#

3)推送

[root@localhost src]# docker push 192.168.139.132/library/nginx:1.18.0
[root@localhost src]# docker push 192.168.139.132/library/mysql:5.7.32
The push refers to repository [192.168.139.132/library/mysql]
df1ee06a30c4: Pushed
902dedce4cb4: Pushed
569a2d6e5302: Pushed
8bdb6ee41f57: Pushed
98d98806c8ac: Pushed
0394a41efa73: Pushed
c484a3b6d841: Pushed
6d23902c2a54: Pushed
74c86dffd46f: Pushed
ef4a33cee7a0: Pushed
cb42413394c4: Pushed
5.7.32: digest: sha256:860f4bcc18607de9f40a7453c7dc160313ecc3a5a46be3b060569b6216d348f6 size: 2621
[root@localhost src]#
[root@localhost src]# docker push 192.168.139.132/library/php:5.6-fpm
The push refers to repository [192.168.139.132/library/php]
bf97b47da88d: Pushed
56d6009fbc8b: Pushed
b6d5993da6a4: Pushed
c9e57440aae2: Pushed
5e2afcdec12b: Pushed
6e4f2e72b0d9: Pushed
6eb3cfd4ad9e: Pushed
82bded2c3a7c: Pushed
b87a266e6a9c: Pushed
3c816b4ead84: Pushed
5.6-fpm: digest: sha256:7cfd6ccb875ff314b2c672b62aa3169fe79d54bf3422b7b0017955b3457ca1a7 size: 2410
[root@localhost src]#

就可以在harbor中查看到推送上去的镜像了

# 登录
docker login http://harbor.xxx.com
# 打标签
docker tag hello:v1 harbor.xxx.com/library/docker-hello:v1.0.0
# 推送镜像
docker push harbor.xxx.com/library/docker-hello:v1.0.0 # 推送镜像
docker pull harbor.xxx.com/library/docker-hello:v1.0.0

如果出现无法登录的错误, 需要配置仓库地址, 在配置文件中添加/etc/docker/daemon.json

{
...
"insecure-registries": ["http://harbor.xxx.com"]
} 重启生效
systemctl daemon-reload systemctl restart docker

镜像一般较大,需要设置nginx的最大文件上限

vim /usr/local/nginx/conf/nginx.conf

http {
...
client_max_body_size 1024m; }

Docker镜像管理之Harbor的更多相关文章

  1. Docker镜像管理基础篇

    Docker镜像管理基础篇 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Docker Images Docker镜像还有启动容器所需要的文件系统及其内容,因此,其用于创建并启 ...

  2. Devops(四):Docker 镜像管理

    参考 <Docker中上传镜像到docker hub中> <Docker 镜像管理> <通过容器提交镜像(docker commit)以及推送镜像(docker push ...

  3. 2、docker镜像管理

    Docker镜像管理 镜像是Docker容器的基础,想运行一个Docker容器就需要有镜像.我们上面已经学会了使用search搜索镜像.那么这个镜像是怎么创建的呢? 创建镜像 镜像的创建有以下几种方法 ...

  4. Docker学习第一天(Docker入门&&Docker镜像管理)

    简介 今天小区的超市买零食老板给我说再过几天可能就卖完了我有点诧异,老板又说厂家不生产了emmm 今天总算开始docker了! 1.Docker? 1.什么是Docker Docker 是一个开源的应 ...

  5. 三、docker镜像管理

    一.docker镜像管理 1.1.镜像搜索-search 从docker镜像仓库模糊搜索镜像 用法: docker search 镜像关键字 [root@zutuanxue ~]# docker se ...

  6. DOCKER学习_016:Docker镜像仓库和HARBOR的简单安装和管理

    一 镜像仓库介绍 1.1 简介 镜像仓库用于存放 Docker镜像 Docker registry提供镜像仓库服务 一个 Docker registry可以包含多个镜像仓库 仓库分为公共镜像仓库与私有 ...

  7. paas架构之docker——镜像管理

    1. 镜像管理 1.1. 列出镜像 Sudo docker images 1.2. 查看镜像 Sudo docker images xxxx 1.3. 拉取镜像 Sudo docker pull ub ...

  8. Docker镜像管理

    镜像是docker的三大核心概念之一.可以用来创建容器. Docker的镜像实际上由一层一层的文件系统组成,这种层级的文件系统被称为UnionFS.镜像可以基于Dockerfile构建,Dockerf ...

  9. 004.Docker镜像管理

    一 镜像基本操作 镜像是一个包含程序运行必要依赖环境和代码的只读文件,其本质是磁盘上一系列文件的集合.它采用分层的文件系统,将每一次改变以读写层的形式增加到原来的只读文件上.镜像是容器运行的基石. 1 ...

  10. docker镜像管理(二)

    docker镜像 docker镜像含有启动容器所需要的文件系统和内容,因此,其用于创建并启动docker容器 docker镜像采用分层构建机制,最底层为bootfs,其之为rootfs bootfs: ...

随机推荐

  1. c程序设计语言 by K&R(二)指针与数组

    指针与数组 1. c语言只有值传递,没有引用传递 可通过指针交换 #include <stdio.h> #include <stdlib.h> void swap(int* a ...

  2. ASP.NET Core Library – scriban (Template Engine)

    前言 有些项目会需要让 end user 写模板 (rich text) 同时又需要做一些 data binding. 这几乎是 programmer 的工作了... 在 C#, 大可以使用 Razo ...

  3. Hadoop & Redis未授权漏洞实战——Vulfocus服务攻防

    什么是未授权访问漏洞?Hadoop & Redis靶场实战--Vulfocus服务攻防 一.介绍 未授权访问,也称为未经授权的访问或非法访问,是指在没有得到适当权限或授权的情况下,个人或系统访 ...

  4. 大模型应用开发初探 : 通用函数调用Planner

    大家好,我是Edison. 上一篇,我们了解了什么是AI Agent以及如何用Semantic Kernel手搓一个AI Agent.有朋友留言说,自动函数调用对大模型有较高的要求,比如Azure O ...

  5. 线段树与二分操作 vases and flowers ——hdu 4614

    操作1,的关键是找到第一只和最后一只空花瓶,完全可以利用二分法查找,找第一只花瓶可以在[X,N]内查找,第一个位置pos1,最后一只花瓶则在[POS1,N]中找,然后更新[POS1,POS2],全部置 ...

  6. C#爬取动态网页上的信息:B站主页

    目录 简介 获取 HTML 文档 解析 HTML 文档 测试 参考文章 简介 动态内容网站使用 JavaScript 脚本动态检索和渲染数据,爬取信息时需要模拟浏览器行为,否则获取到的源码基本是空的. ...

  7. php7新内容总结(随时更新)

    一.参数和返回值类型申明 可以申明的有:float,int,bool,string,interfaces,array,callable 一般模式: function sum(int ...$ints) ...

  8. git工具:sourcetree使用中的部分问题

    这段时间经常用到这个工具.就当记个笔记,记录一下我的一些问题. 问题一: 如果想要拉取远端更新: 第一步:先登陆sourcetree,点击"抓取". 第二步:在终端输入:git s ...

  9. npy转换为png和nii文件

    #coding:utf-8 import matplotlib.pyplot as plt import numpy as np import os from skimage.transform im ...

  10. 《Programming from the Ground Up》读后感

    之所以看这本书,是想了解一些跟汇编相关的知识,打开这本书后就被作者的观点--"If you don't understand something the first time, reread ...