Harbor安装

安装
安装一些必要的系统工具:

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
添加软件源信息:

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新 yum 缓存:

sudo yum makecache fast
安装 Docker-ce:(企业版  社区版)

sudo yum -y install docker-ce
启动 Docker 后台服务

sudo systemctl start docker
测试运行 hello-world

docker run hello-world
docker-compose
a.下载二进制文件
# curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
如果需要安装其他版本的话,请修改上面命令中的版本号。

b.赋予二进制文件可执行权限
# chmod +x /usr/local/bin/docker-compose
c.根据自己的情况决定是否安装命令补全功能
# yum install bash-completion
# curl -L https://raw.githubusercontent.com/docker/compose/1.16.1/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
重新登陆后就生效了

# docker-compose
build    config   down     exec     images   logs     port     pull     restart  run      start    top      up
bundle   create   events   help     kill     pause    ps       push     rm       scale    stop     unpause  version
d.测试是否安装成功
# docker-compose --version
docker-compose version 1.16.1, build 6d1ac21

pip yum安装

# yum install python-pip
# pip install  docker-compose
测试:

# docker-compose --version
卸载docker-compose
对应上面两种安装方法:
二进制:

# rm  /usr/local/bin/docker-compose
pip:

# pip uninstall  docker-compose

卸载

如果是二进制包方式安装的,删除二进制文件即可:
sudo rm /usr/local/bin/docker-compose
如果通过Python pip工具安装的,则执行如下命令删除:
sudo pip uninstall docker-compose
Harbor安装

harbor软件网址:https://github.com/vmware/harbor/releases

  此页面提供源码安装和二进制安装下载地址,不建议方式

  镜像网址:http://harbor.orientsoft.cn/

  此页面只提供离线下载安装包,建议此种方式。

#下载离线安装软件
wget http://harbor.orientsoft.cn/harbor-v1.3.0-rc4/harbor-offline-installer-v1.3.0-rc4.tgz
#解压文件
tar -zxf harbor-offline-installer-v1.3.0-rc4.tgz
#解压后的文件夹是harbor

解压完成后:修改配置文件harbor.conf,如果是测试环境基本不用什么更改配置,主要就是hostname

[[email protected]_master harbor]# vim harbor.cfg 

## Configuration file of Harbor

#The IP address or hostname to access admin UI and registry service.
#DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
#主机地址,不可以设置为127或者localhost

hostname = 10.10.90.105

#The protocol for accessing the UI and token/notification service, by default it is http.
#It can be set to https if ssl is enabled on nginx.
ui_url_protocol = http

#The password for the root user of mysql db, change this before any production use.
#mysql密码
db_password = root123

#Maximum number of job workers in job service
max_job_workers = 3 

#Determine whether or not to generate certificate for the registry‘s token.
#If the value is on, the prepare script creates new root cert and private key
#for generating token to access the registry. If the value is off the default key/cert will be used.
#This flag also controls the creation of the notary signer‘s cert.
customize_crt = on

#The path of cert and key files for nginx, they are applied only the protocol is set to https
ssl_cert = /data/cert/server.crt
ssl_cert_key = /data/cert/server.key

#The path of secretkey storage
secretkey_path = /data

#Admiral‘s url, comment this attribute, or set its value to NA when Harbor is standalone
admiral_url = NA

#The password of the Clair‘s postgres database, only effective when Harbor is deployed with Clair.
#Please update it before deployment, subsequent update will cause Clair‘s API server and Harbor unable to access Clair‘s database.
clair_db_password = password

#Log files are rotated log_rotate_count times before being removed. If count is 0, old versions are removed rather than rotated.
log_rotate_count = 50
#Log files are rotated only if they grow bigger than log_rotate_size bytes. If size is followed by k, the size is assumed to be in kilobytes.
#If the M is used, the size is in megabytes, and if G is used, the size is in gigabytes. So size 100, size 100k, size 100M and size 100G
#are all valid.
log_rotate_size = 200M

#NOTES: The properties between BEGIN INITIAL PROPERTIES and END INITIAL PROPERTIES
#only take effect in the first boot, the subsequent changes of these properties
#should be performed on web ui

#************************BEGIN INITIAL PROPERTIES************************

#Email account settings for sending out password resetting emails.

#Email server uses the given username and password to authenticate on TLS connections to host and act as identity.
#Identity left blank to act as username.
email_identity = 

email_server = smtp.mydomain.com
email_server_port = 25
email_username = [email protected]
email_password = abc
email_from = admin <[email protected]>
email_ssl = false
email_insecure = false

##The initial password of Harbor admin, only works for the first time when Harbor starts.
#It has no effect after the first launch of Harbor.
#Change the admin password from UI after launching Harbor.
#这里是web登录页面的密码,可以更改
harbor_admin_password = Harbor12345

##By default the auth mode is db_auth, i.e. the credentials are stored in a local database.
#Set it to ldap_auth if you want to verify a user‘s credentials against an LDAP server.
auth_mode = db_auth

#The url for an ldap endpoint.
ldap_url = ldaps://ldap.mydomain.com

#A user‘s DN who has the permission to search the LDAP/AD server.
#If your LDAP/AD server does not support anonymous search, you should configure this DN and ldap_search_pwd.
#ldap_searchdn = uid=searchuser,ou=people,dc=mydomain,dc=com

#the password of the ldap_searchdn
#ldap_search_pwd = password

#The base DN from which to look up a user in LDAP/AD
ldap_basedn = ou=people,dc=mydomain,dc=com

#Search filter for LDAP/AD, make sure the syntax of the filter is correct.
#ldap_filter = (objectClass=person)

# The attribute used in a search to match a user, it could be uid, cn, email, sAMAccountName or other attributes depending on your LDAP/AD
ldap_uid = uid 

#the scope to search for users, 1-LDAP_SCOPE_BASE, 2-LDAP_SCOPE_ONELEVEL, 3-LDAP_SCOPE_SUBTREE
ldap_scope = 3 

#Timeout (in seconds)  when connecting to an LDAP Server. The default value (and most reasonable) is 5 seconds.
ldap_timeout = 5

#Turn on or off the self-registration feature
self_registration = on

#The expiration time (in minute) of token created by token service, default is 30 minutes
token_expiration = 30

#The flag to control what users have permission to create projects
#The default value "everyone" allows everyone to creates a project.
#Set to "adminonly" so that only admin user can create project.
project_creation_restriction = everyone

#The follow configurations are for Harbor HA mode only

#the address of the mysql database.
db_host = mysql

#The port of mysql database host
db_port = 3306

#The user name of mysql database
db_user = root
#************************END INITIAL PROPERTIES************************
#The following attributes only need to be set when auth mode is uaa_auth
uaa_endpoint = uaa.mydomain.org
uaa_clientid= id
uaa_clientsecret= secret
uaa_ca_root= /path/to/uaa_ca.pem
#############

Harbor配置文件

启动harbor,修改完配置文件就可以执行该目录下的install.sh文件即可,程序会自动启动相关镜像,因为harbor是用你镜像进行安装的。

[[email protected]_master harbor]# ./install.sh 

https://www.cnblogs.com/netsa/p/8124708.html

原文地址:https://www.cnblogs.com/wudequn/p/11482392.html

时间: 2024-08-03 19:14:58

Harbor安装的相关文章

Docker私服仓库Harbor安装

Harbor安装那里还是很简单,就是在Docker Login那里掉坑里去了,搞半天,写博客的时候,又重新安装了一遍 1.准备两台服务器 centos7 harbor 10.19.46.15 client 10.19.44.31 2.harbor需要安装docker和docker-composere,client只需要安装docker Docker安装 yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-m

Harbor安装配置(HTTPS)

1.下载harbor git clone https://github.com/vmware/harbor 2.安装docker.docker-compose pip uninstall docker docker-py; pip install docker pip install docker-compose 3.修改/data/harbor/make/harbor.cfg hostname = registry.niudingfeng.com ui_url_protocol = https

docker18.ce harbor 安装

安装最新版的docker可以参考docker的官网 https://docs.docker.com/install/linux/docker-ce/centos/ 一.安装docker 安装依赖 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 安装源 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-

Docker(三)私有仓库Harbor安装和配置

(一).概述Harbor是开源registry仓库,相比docker官方拥有更丰富的权限权利和完善的架构设计,适用大规模docker集群部署提供仓库服务. 下载地址:https://github.com/goharbor/harbor/releases (二).安装和配置.由于harbor包括docker,docker-composere和client只需安装docker即可(Docker-Compose项目是Docker官方的开源项目,负责实现对Docker容器集群的快速编排.Harbor 的

Harbor 安装

下载 wget https://storage.googleapis.com/harbor-releases/release-1.9.0/harbor-offline-installer-v1.9.0.tgz 解压至 /usr/local/harbor 修改harbor.yml文件 IP地址或者域名 hostname: 192.168.1.170 挂载的位置 data_volume: /usr/local/harbor/data 日志的位置 log: location: /usr/local/h

centos7 安装harbor docker镜像库

安装docker,git yum install docker  docker-logrotate git -y 安装docker-compose yum install python-pip -y pip install --upgrade pip pip install docker-compose pip install --upgrade backports.ssl_match_hostname 下载harbor git clone https://github.com/vmware/h

docker(14):centos7 安装docker hub harbor,可视化registry

1,Harbor 容器应用的开发和运行离不开可靠的镜像管理.从安全和效率等方面考虑,部署在私有环境内的Registry是非常必要的.Project Harbor是由VMware公司中国团队为企业用户设计的Registry server开源项目,包括了权限管理(RBAC).LDAP.审计.管理界面.自我注册.HA等企业必需的功能,同时针对中国用户的特点,设计镜像复制和中文支持等功能,欢迎使用和反馈意见. 还是一个vmware开源的项目呢.但是界面上有点老气. 2,下载安装 项目地址: https:

Harbor 使用 Helm 一键安装

安装 Harbor Harbor 支持多种安装方式,源码目录下面默认有一个安装脚本(make/install.sh),采用 docker-compose 的形式运行 Harbor 各个组件,和前面的课程一样,我们这里依然还是将 Harbor 安装到 Kubernetes 集群中,如果我们对 Harbor 的各个组件之间的运行关系非常熟悉,同样的,我们可以自己手动编写资源清单文件进行部署,不过 Harbor 源码目录中也为我们提供了生成这些资源清单的脚本文件了(make/kubernetes/k8

Harbor的安装和基本使用

Harbor是一个开源的云原生registry工程.Harbor对开源的Docker Distribution扩进行了扩展,支持registries之间镜像的复制功能,而且还提供了一些高级的安全方面的功能,例如用户管理,访问控制和行为审计.详细的说明可以参照官网[1]. Harbor的安装 通常,将Harbor安装在linux上.在安装Harbor之前,必须确保机器上已经安装了docker 17.06.0-ce+和docker-compose 1.18.0+. 从官网[2]上下载安装文件.安装文