Centos 7安装Docker镜像仓库-Harbor
下载安装包并导入镜像
# 进入文件下载目录
cd /root/software/
# 下载安装文件
# 如果下载失败可以本地下载,下载后上传至服务器,https://github.com/goharbor/harbor/releases
wget https://storage.googleapis.com/harbor-releases/harbor-offline-installer-v2.1.0.tgz
# 解压文件
tar xvf harbor-offline-installer-v2.1.0.tgz -C /usr/local/
# 导入docker镜像
cd /usr/local/harbor
docker image load -i harbor.v2.1.0.tar.gz
导入镜像完成后如下所示,以goharbor为前缀的是Harbor要使用的镜像:
REPOSITORY TAG IMAGE ID CREATED SIZE
goharbor/chartmuseum-photon v2.1.0 5bad3dce5fd5 6 days ago 172MB
goharbor/redis-photon v2.1.0 45fa455a8eeb 6 days ago 68.7MB
goharbor/trivy-adapter-photon v2.1.0 9b443d147b3d 6 days ago 106MB
goharbor/clair-adapter-photon v2.1.0 cee42542dfb2 6 days ago 57.9MB
goharbor/clair-photon v2.1.0 9741a40b433c 6 days ago 167MB
goharbor/notary-server-photon v2.1.0 e20ff73edec7 6 days ago 139MB
goharbor/notary-signer-photon v2.1.0 2b783b793805 6 days ago 136MB
goharbor/harbor-registryctl v2.1.0 98f466a61ebb 6 days ago 132MB
goharbor/registry-photon v2.1.0 09c818fabdd3 6 days ago 80.1MB
goharbor/nginx-photon v2.1.0 470ffa4a837e 6 days ago 40.1MB
goharbor/harbor-log v2.1.0 402802990707 6 days ago 82.1MB
goharbor/harbor-jobservice v2.1.0 ff65bef832b4 6 days ago 165MB
goharbor/harbor-core v2.1.0 26047bcb9ff5 6 days ago 147MB
goharbor/harbor-portal v2.1.0 5e97d5e230b9 6 days ago 49.5MB
goharbor/harbor-db v2.1.0 44c0be92f223 6 days ago 164MB
goharbor/prepare v2.1.0 58d0e7cee8cf 6 days ago 160MB
quay.io/coreos/flannel v0.13.0-rc2 79dd6d6368e2 6 days ago 57.2MB
k8s.gcr.io/kube-proxy v1.18.5 a1daed4e2b60 2 months ago 117MB
k8s.gcr.io/kube-apiserver v1.18.5 08ca24f16874 2 months ago 173MB
k8s.gcr.io/kube-controller-manager v1.18.5 8d69eaf196dc 2 months ago 162MB
k8s.gcr.io/kube-scheduler v1.18.5 39d887c6621d 2 months ago 95.3MB
k8s.gcr.io/pause 3.2 80d28bedfe5d 7 months ago 683kB
k8s.gcr.io/coredns 1.6.7 67da37a9a360 7 months ago 43.8MB
k8s.gcr.io/etcd 3.4.3-0 303ce5db0e90 11 months ago 288MB
修改配置文件
# 进入安装包加压后目录
cd /usr/local/harbor
# 拷贝配置模板
cp harbor.yml.tmpl harbor.yml
# 编辑配置文件
vim harbor.yml
修改后配置文件如下所示:
# 修改IP地址
# 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: 10.170.128.9
# 修改端口号
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 83
# 注释https相关内容
# https related config
#https:
# https port for harbor, default is 443
#port: 443
# The path of cert and key files for nginx
#certificate: /your/certificate/path
#private_key: /your/private/key/path
检测harbor
cd /usr/local/harbor
./prepare
输出结果如下:
prepare base dir is set to /usr/local/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Generated configuration file: /config/portal/nginx.conf
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/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
Generated and saved secret to file: /data/secret/keys/secretkey
Successfully called func: create_root_cert
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
安装harbor
cd /usr/local/harbor
./install.sh
当显示下面结果时,证明已经安装完成:
Creating redis ... done
Creating harbor-core ... done
Creating network "harbor_harbor" with the default driver
Creating nginx ... done
Creating redis ...
Creating registry ...
Creating harbor-db ...
Creating harbor-portal ...
Creating registryctl ...
Creating harbor-core ...
Creating nginx ...
Creating harbor-jobservice ...
----Harbor has been installed and started successfully.----
查看相关容器运行结果
docker ps
执行结果如下:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7310212b3283 goharbor/harbor-jobservice:v2.1.0 "/harbor/entrypoint.…" About a minute ago Up About a minute (healthy) harbor-jobservice
b0dfde9a5176 goharbor/nginx-photon:v2.1.0 "nginx -g 'daemon of…" About a minute ago Up About a minute (healthy) 0.0.0.0:83->8080/tcp nginx
ad83a154eef4 goharbor/harbor-core:v2.1.0 "/harbor/entrypoint.…" About a minute ago Up 59 seconds (healthy) harbor-core
715f26c96edd goharbor/harbor-portal:v2.1.0 "nginx -g 'daemon of…" About a minute ago Up About a minute (healthy) harbor-portal
93ae5f5a4ef0 goharbor/harbor-db:v2.1.0 "/docker-entrypoint.…" About a minute ago Up About a minute (healthy) harbor-db
10c07afdfa76 goharbor/harbor-registryctl:v2.1.0 "/home/harbor/start.…" About a minute ago Up About a minute (healthy) registryctl
8b5295f4be2d goharbor/redis-photon:v2.1.0 "redis-server /etc/r…" About a minute ago Up About a minute (healthy) redis
2058a727da79 goharbor/registry-photon:v2.1.0 "/home/harbor/entryp…" About a minute ago Up About a minute (healthy) registry
8117d47b1cd7 goharbor/harbor-log:v2.1.0 "/bin/sh -c /usr/loc…" About a minute ago Up About a minute (healthy) 127.0.0.1:1514->10514/tcp harbor-log
设置harbor开启启动
# 创建开启启动服务文件
vim /lib/systemd/system/harbor.service
开机启动服务文件内容:
[Unit]
Description=Harbor
After=docker.service systemd-networkd.service systemd-resolved.service
Requires=docker.service
Documentation=http://github.com/vmware/harbor
[Service]
Type=simple
Restart=on-failure
RestartSec=5
ExecStart=/usr/bin/docker-compose -f /usr/local/harbor/docker-compose.yml up
ExecStop=/usr/bin/docker-compose -f /usr/local/harbor/docker-compose.yml down
[Install]
WantedBy=multi-user.target
# 启动harbor
systemctl start harbor
# 设置开机启动
systemctl enable harbor
访问镜像仓库
# 地址
http://10.170.128.9:83/
备注,不用执行:docke-compose相关命令
# 在该目录下执行
cd /usr/local/harbor
docker-compose up -d # 后台启动,如果容器不存在根据镜像自动创建
docker-compose down -v # 停止容器并删除容器
docker-compose start # 启动容器,容器不存在就无法启动,不会自动创建镜像
docker-compose stop # 停止容器
Centos 7安装Docker镜像仓库-Harbor的更多相关文章
- docker 镜像仓库 Harbor 部署 以及 跨数据复制
docker 镜像仓库 Harbor 部署 跨数据复制 Harbor 是 Vmwar 公司开源的 企业级的 Docker Registry 管理项目 它主要 提供 Dcoker Registry 管理 ...
- 离线手动部署docker镜像仓库——harbor仓库(HTTPS)
实验环境: harbor服务器系统:CentOS Linux release 7.5.1804 (Core)harbor服务器IP:10.1.12.114harbor版本:v1.5.0docker版本 ...
- Docker镜像仓库Harbor之Swagger REST API整合配置
转载自:https://cloud.tencent.com/developer/article/1010618 1.Swagger 介绍 Swagger 是一个规范和完整的框架,用于生成.描述.调用和 ...
- 企业级Docker镜像仓库Harbor部署与使用
yum install docker 官网地址:https://docs.docker.com/compose/install/ 运行此命令以下载Docker Compose的当前稳定版本 1 sud ...
- Docker镜像仓库Harbor搭建及配置
一.harbor简介 Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器,通过添加一些企业必需的功能特性,例如安全.标识和管理等,扩展了开源Docker Distribut ...
- Docker镜像仓库Harbor之搭建及配置
目录 Harbor介绍环境.软件准备Harbor服务搭建Harbor跨数据复制配置FAQ1.Harbor 介绍 Docker容器应用的开发和运行离不开可靠的镜像管理,虽然Docker官方也提供了公共的 ...
- Docker镜像仓库Harbor部署
一.Harbor组件 组件 功能 harbor-adminserver 配置管理中心 harbor-db Mysql数据库 harbor-jobservice 负责镜像复制 harbor-log 记录 ...
- Docker镜像仓库Harbor安装
export VERSION=18.06 && curl -fsSL http://rainbond-pkg.oss-cn-shanghai.aliyuncs.com/releases ...
- Docker(二):Docker镜像仓库Harbor搭建
安装docker-compose 因为docker-compose下载容易失败, 所以选择从github下载方式安装. [root@harbor ~]# mv docker-compose-Linux ...
- Docker镜像仓库Harbor搭建
园子里面已经有人写过了.也写得很好,我这里只记录下我遇到的问题 Harbor 依赖: 1:docker 2:docker-compose 怎么安装就不说了. 然后是安装Harbor github:ht ...
随机推荐
- Springboot集成MyBatis进行开发
引入相关的依赖 <dependency> <groupId>junit</groupId> <artifactId>junit</artifact ...
- Kubernetes入门实践(ConfigMap/Secret)
Kubernetes中用于管理配置信息的两种对象: ConfigMap和Secret,可使用它们来灵活地配置和定制应用.应用程序有很多类别的配置信息,从数据安全的角度看可分为明文配置和机密配置,明文配 ...
- day03-Redis的客户端
Redis的Java客户端 在Redis官网中提供了各种语言的客户端,地址:Get started using Redis clients | Redis Redis的Java客户端: 1.Jedis ...
- 这是一篇记录——django-xadmin重新开发记录
利用下面的代码把django的版本换成和xadmin2适配的版本,注意xadmin最新版本出了3.0但是就是一个纯前端的框架,和之前的版本差异较大. 因为此时距离ddl不到24小时,所以使用旧的版本. ...
- 关于linux下Qt5.7.0安装中文输入法无法显示的问题
关于linux下Qt5.7.0安装中文输入法无法显示的问题 本文是以我自己系统ubuntu-x64 + fcitx + Qt5.7.0为例: sudo apt-get install fcitx-fr ...
- Web服务器压力测试工具 - HULK
HULK是一种web的拒绝服务攻击工具.它能够在web服务器上产生许多单一的伪造流量,能绕开引擎的缓存,因此能够直接攻击服务器的资源池.hulk的特别之处在于:对于每一个请求都是独特的,能够绕开引擎的 ...
- springcloud~Sentinel
介绍 随着微服务的流行,服务和服务之间的稳定性变得越来越重要.Sentinel 是面向分布式.多语言异构化服务架构的流量治理组件,主要以流量为切入点,从流量路由.流量控制.流量整形.熔断降级.系统自适 ...
- 2022-04-20:小团去参加军训,军训快要结束了, 长官想要把大家一排n个人分成m组,然后让每组分别去参加阅兵仪式, 只能选择相邻的人一组,不能随意改变队伍中人的位置, 阅兵仪式上会进行打分,其中
2022-04-20:小团去参加军训,军训快要结束了, 长官想要把大家一排n个人分成m组,然后让每组分别去参加阅兵仪式, 只能选择相邻的人一组,不能随意改变队伍中人的位置, 阅兵仪式上会进行打分,其中 ...
- 2021-10-14:被围绕的区域。给你一个 m x n 的矩阵 board ,由若干字符 ‘X‘ 和 ‘O‘ ,找到所有被 ‘X‘ 围绕的区域,并将这些区域里所有的 ‘O‘ 用 ‘X‘ 填充。力扣1
2021-10-14:被围绕的区域.给你一个 m x n 的矩阵 board ,由若干字符 'X' 和 'O' ,找到所有被 'X' 围绕的区域,并将这些区域里所有的 'O' 用 'X' 填充.力扣1 ...
- ET介绍——CSharp协程
什么是协程 说到协程,我们先了解什么是异步,异步简单说来就是,我要发起一个调用,但是这个被调用方(可能是其它线程,也可能是IO)出结果需要一段时间,我不想让这个调用阻塞住调用方的整个线程,因此传给被调 ...