docker 安装harbor

1.下载镜像依赖docker pull vmware/harbor-jobservice:v1.1.2

docker pull vmware/harbor-ui:v1.1.2

docker pull vmware/harbor-adminserver:v1.1.2

docker pull vmware/harbor-db:v1.1.2

docker pull vmware/registry:2.6.1-photon

docker pull vmware/harbor-notary-db:mariadb-10.1.10

docker pull vmware/nginx:1.11.5-patched

docker pull vmware/notary-photon:signer-0.5.0

docker pull vmware/notary-photon:server-0.5.0

docker pull vmware/harbor-log:v1.1.2

docker pull photon:1.0

2.Docker-compose 安装安装方式一#1、下载指定版本的docker-compose

$ curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

#2、对二进制文件赋可执行权限

$ sudo chmod +x /usr/local/bin/docker-compose

#3、测试下docker-compose是否安装成功

$ docker-compose --version

docker-compose version 1.13.0, build 1719ceb安装方式二:

推荐使用pip安装docker-compose#安装pip

yum -y install epel-release

yum -y install python-pip

#确认版本

pip --version

#更新pip

pip install --upgrade pip

#安装 docker-compose

pip install docker-compose

docker-compose version

3.下载Harbor安装文件

1、在线安装包$ wget https://github.com/vmware/harbor/releases/download/v1.1.2/harbor-online-installer-v1.1.2.tgz

$ tar xvf harbor-online-installer-v1.1.2.tgz

2、离线安装包$ wget https://github.com/vmware/harbor/releases/download/v1.1.2/harbor-offline-installer-v1.1.2.tgz

$ tar xvf harbor-offline-installer-v1.1.2.tgz

我们这里选择离线安装包进行安装,由于github 下载地址速度较慢,也可通过下面百度云下载

4.修改Harbor配置

habor 域名设置为 harbor.demo.comcd harbor

vi 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.

hostname = harbor.demo.com

#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.

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

#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.mxhichina.com

email_server_port = 25

email_username = harbor@demo.com

email_password = 123456

email_from = harbor

email_ssl = 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.

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

#Determine whether the job service should verify the ssl cert when it connects to a remote registry.

#Set this flag to off when the remote registry uses a self-signed or untrusted certificate.

verify_remote_cert = on

#************************END INITIAL PROPERTIES************************

#############

默认是80端口,如果端口占用,我们可以去修改docker-compose.yml文件中,对应服务映射本地的端口9999。

docker-compose.ymlproxy:

image: vmware/nginx:1.11.5-patched

container_name: nginx

restart: always

volumes:

- ./common/config/nginx:/etc/nginx:z

networks:

- harbor

ports:

- 9999:80

- 443:443

- 4443:4443

depends_on:

- mysql

- registry

- ui

- log

logging:

driver: "syslog"

options:

启动 Harbor

修改完配置文件后,在的当前目录执行./install.sh

5.配置NGINXcd /etc/nginx/

vi nginx.conf

server {

listen 80;

server_name harbor.demo.com;

root /usr/share/nginx/html;

include /etc/nginx/default.d/*.conf;

location / {

# 设置最大允许上传单个的文件大小

client_max_body_size 1024m;

proxy_redirect off;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://localhost:9999;

index index.html index.htm;

}

error_page 404 /404.html;

location = /40x.html {

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

}

}#检查配置是否正确

nginx -t

#重启服务

sudo systemctl restart nginx

6.访问harbor 并提交镜像

这是因为docker1.3.2版本开始默认docker registry使用的是https,我们设置Harbor默认http方式,所以当执行用docker login、pull、push等命令操作非https的docker regsitry的时就会报错。docker login harbor.demo.com

Username: admin

Password:

Error response from daemon: Get https://harbor.demo.com/v2/: dial tcp 10.220.107.52:443: connect: connection refused

解决办法:#修改docker启动配置

vi /lib/systemd/system/docker.service

#修改前

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

#修改后

ExecStart=/usr/bin/dockerd --insecure-registry harbor.demo.com -H fd:// --containerd=/run/containerd/containerd.sock

7.harbor 重启cd /usr/local/harbor

1、停止Harbor

$ docker-compose down -v

Stopping nginx ... done

Stopping harbor-jobservice ... done

......

Removing harbor-log ... done

Removing network harbor_harbor

2、启动Harbor

$ docker-compose up -d

Creating network "harbor_harbor" with the default driver

Creating harbor-log ...

......

Creating nginx

Creating harbor-jobservice ... done

8.日志查看

日志存储位置 /var/log/harbor/本文由博客群发一文多发等运营工具平台 OpenWrite 发布

docker harbor 域名_docker 安装Harbor相关推荐

  1. docker harbor 域名_docker registry harbor

    部署 harbor 安装方式: offline 软件安装需求:docker 1.10.0+ and docker-compose 1.6.0+ docker 我们选用官方的 repo , yum in ...

  2. desktop docker 无法卸载_docker 安装教程和常见问题

    docker能干什么? 简单的说docker 是一个非常方便的环境搭建工具.比如想搭建一个mongodb服务,但是许多服务没有方便的安装包.这时你只需要5行命令就能完成三部搭建mongo,和mongo ...

  3. docker harbor 域名_Docker镜像仓库Harbor部署

    一.Harbor组件 组件 功能 harbor-adminserver 配置管理中心 harbor-db Mysql数据库 harbor-jobservice 负责镜像复制 harbor-log 记录 ...

  4. docker $PWD路径_Docker安装Jenkins+Shell脚本自动化部署项目

    本文同名博客老炮说Java:https://www.laopaojava.com/,每天更新Spring/SpringMvc/SpringBoot/实战项目等文章资料 Sentinel+Nacos 是 ...

  5. apache2 docker 无法访问_Docker 安装 Apache

    Docker 安装 Apache 方法一.docker pull httpd 查找 Docker Hub 上的 httpd 镜像: 可以通过 Sort by 查看其他版本的 httpd,默认是最新版本 ...

  6. docker+mysql+授权_docker安装mysql, 授权远程连接

    以最新版本实例 docker search mysql //查找mysql镜像 docker pull mysql:5.7 //拉取镜像 (指定版本号. 默认是latest, 去掉 " :5 ...

  7. Kubernetes - - k8s - v1.12.3 使用Helm安装harbor

    1,Helm 介绍 核心术语: Chart:一个helm程序包 Repository:Charts仓库,https/http 服务器 Release:特定的Chart部署与目标集群上的一个实例 Cha ...

  8. Linux在线安装harbor镜像仓库

    前言 在之前的文章中已经搭建好了k8s集群跟KubeSphere的可视化系统,但是在实际应用上我们服务的镜像推送都需要在集群的所有节点上手动进行docker build,非常不方便.所以我们需要一个私 ...

  9. 【K8S】基于Docker+K8S+GitLab/SVN+Jenkins+Harbor搭建持续集成交付环境(环境搭建篇)

    写在前面 最近在 K8S 1.18.2 版本的集群上搭建DevOps环境,期间遇到了各种坑.目前,搭建环境的过程中出现的各种坑均已被填平,特此记录,并分享给大家! 服务器规划 IP 主机名 节点 操作 ...

最新文章

  1. 这款库克寄予厚望的苹果产品,只活了2年
  2. bin(x) 将整数x转换为二进制字符串
  3. Codeforces Round #732 (Div. 1Div. 2)
  4. 一个form 如何做两次提交_如何做一个自信魅力的女人
  5. 超链接a标签的伪类选择器问题,Link标签与visited标签的失效问题(问题介绍与解决方法)。以下全部内容跟可通过鼠标左键选取后,复制到编辑器中直接运行。
  6. 注册flash.ocx inno setup (转)
  7. 第三天:完善数据层(controller)真正对接数据库Mysql
  8. VS2010 Visual Assist X破解方法
  9. int 、long 和long long 区别
  10. Sql Server Report Builder 计算标准偏差
  11. 码蹄集第23周赛(买礼物,召唤神龙,大促销,轨道探测)
  12. 圆弧的函数c语言,VC++中Arc函数画圆弧
  13. 微信小程序退出功能(退回到微信)
  14. DBCP C3PO Druid三种数据库连接
  15. linux无法删除软件,Linux某些软件无法卸载问题
  16. java验证11位手机号_JAVA怎样用数组实现输入手机号码为11位
  17. 【VS开发】设备控制台 (DevCon.exe) 示例
  18. XMeters使用介绍
  19. 程序员35岁只能“安于现状”失业?这是过来人最棒的建议!能否“自救”...(含发展路线)
  20. 有了智能名片你也可以轻松投放信息流广告

热门文章

  1. Robolectric 探索之路
  2. Spring的ID增长器使用示例(MySql数据库)
  3. linux安装步骤_图解 Debian 10(Buster)安装步骤 | Linux 中国
  4. python比较两个列表的重合度_#源代码#超几何分布算法介绍及python下的实现代码...
  5. visual studio odbc数据源设计器_商业智能BI应该支持哪些类型的数据源?
  6. 作用域链涉及了什么计算机底层知识,你必须知道的Javascript知识点之深入理解作用域链的介绍...
  7. 用python把相同名称的放在一起,python实现将具有相同名称的文件放入相应的文件夹中,把,对应,内...
  8. 水松纸缺陷在线检测系统
  9. 机器视觉技术在薄膜检测系统的应用
  10. MaxCompute 图计算用户手册(下)