Docker–私有仓库


文章目录

  • Docker--私有仓库
  • 本地私有仓库
  • Harbor私有仓库
  • Harbor的特性
  • Harbor的构成
  • Harbor.cfg配置文件中有两类参数
  • 所需参数和可选参数
  • 所需参数
  • 可选参数
  • Harbor 部署
  • 维护管理Harbor



docker搜索不出来 docker指定仓库搜索_docker搜索不出来

本地私有仓库

docker服务器:192.168.237.141

[root@localhost ~]# systemctl stop firewalld		#关闭防火墙
[root@localhost ~]# setenforce 0					#关闭selinux

[root@localhost ~]# docker pull registry			#下载 registry 镜像
Using default tag: latest
latest: Pulling from library/registry
79e9f2f55bf5: Pull complete 
0d96da54f60b: Pull complete 
5b27040df4a2: Pull complete 
e2ead8259a04: Pull complete 
3790aef225b9: Pull complete 
Digest: sha256:169211e20e2f2d5d115674681eb79d21a217b296b43374b8e39f97fcf866b375
Status: Downloaded newer image for registry:latest
docker.io/library/registry:latest

[root@localhost ~]# vim /etc/docker/daemon.json		#在daemon.json文件中添加私有镜像仓库的地址并重启
{
"insecure-registries": ["192.168.237.141:5000"],
"registry-mirrors": ["https://d4r5l929.mirror.aliyuncs.com"]
}
:wq

[root@localhost ~]# systemctl restart docker		#重启docker服务
[root@localhost ~]# docker run -itd -v /data/registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry:latest		#运行registry容器
16db2a0f26de8b5bd92ccb4902d3cd2bc8a177602bb7fcae0f2eba9e667cff06

------------------------------------------------------------------------------------------------------------
-itd:在容器中打开一个伪终端进行交互操作,并在后台运行
-v:把宿主机的/data/registry目录绑定到容器/var/lib/registry目录(这个目录是registry容器中存放镜像文件的目录),来实现数据的持久化;
-p:映射端口;访问宿主机的5000端口就访问到registry容器的服务了
--restart=always: 这是重启的策略,在容器退出时总是重启容器
--name registry: 创建容器命名为registry
registry:latest:这个是刚才pull下来的镜像.
------------------------------------------------------------------------------------------------------------
Docker容器的重启策略如下:
no:默认策略,在容器退出时不重启容器
on- failure:在容器非正常退出时(退出状态非0),才会重启容器
on- failure:3 :在容器非正常退出时重启容器,最多重启3次
always:在容器退出时总是重启容器
unless-stopped:在容器退出时总是重启容器,但是不考虑在Docker守护进程启动时就已经停止了的容器
------------------------------------------------------------------------------------------------------------

[root@localhost ~]# docker pull centos:7		#下载镜像
7: Pulling from library/centos
Digest: sha256:9d4bcbbb213dfd745b58be38b13b996ebb5ac315fe75711bd618426a630e0987
Status: Image is up to date for centos:7
docker.io/library/centos:7
[root@localhost ~]# docker tag centos:7 192.168.237.141:5000/centos:v1		#重新打标签
[root@localhost ~]# docker images			#查看镜像
REPOSITORY                    TAG       IMAGE ID       CREATED        SIZE
....
192.168.237.141:5000/centos   v1        eeb6ee3f44bd   9 months ago   204MB
....

[root@localhost ~]# docker push 192.168.237.141:5000/centos:v1		#上传镜像
The push refers to repository [192.168.237.141:5000/centos]
174f56854903: Pushed 
v1: digest: sha256:dead07b4d8ed7e29e98de0f4504d87e8880d4347859d839686a31da35a3b532f size: 529

#列出私有仓库的所有镜像
[root@localhost ~]# curl http://192.168.237.141:5000/v2/_catalog
{"repositories":["centos"]}
[root@localhost ~]# curl http://192.168.237.141:5000/v2/centos/tags/list
{"name":"centos","tags":["v1"]}

[root@localhost ~]# docker rmi -f eeb6ee3f44bd		#删除原先的下载
Untagged: 192.168.237.141:5000/centos:v1
Untagged: 192.168.237.141:5000/centos@sha256:dead07b4d8ed7e29e98de0f4504d87e8880d4347859d839686a31da35a3b532f
Untagged: centos:7
Untagged: centos@sha256:9d4bcbbb213dfd745b58be38b13b996ebb5ac315fe75711bd618426a630e0987
Deleted: sha256:eeb6ee3f44bd0b5103bb561b4c16bcb82328cfe5809ab675bb17ab3a16c517c9

[root@localhost ~]# docker pull 192.168.237.141:5000/centos:v1		#从私有镜像重新拉取
v1: Pulling from centos
2d473b07cdd5: Already exists 
Digest: sha256:dead07b4d8ed7e29e98de0f4504d87e8880d4347859d839686a31da35a3b532f
Status: Downloaded newer image for 192.168.237.141:5000/centos:v1
192.168.237.141:5000/centos:v1
[root@localhost ~]# docker images				#查看验证
REPOSITORY                    TAG       IMAGE ID       CREATED        SIZE
.....
192.168.237.141:5000/centos   v1        eeb6ee3f44bd   9 months ago   204MB
.....

Harbor私有仓库

Harbor是VWware公司开源的企业级Docker Reqistry 项目,其目标是帮助用户迅速搭建一个企业级的 Docker Registry服务

Harbor以Docker公司开源的Registry为基础,提供了图形管理UI、基于角色的访问控制(Role Based AccessControl)、AD/LDAP集成、以及审计日志(Auditlogging)等企业用户需求的功能,同时还原生支持中文

Harbor的每个组件都是以Docker容器的形式构建的,使用docker-compose 来对它进行部署。用于部署Harbor 的docker-compose。模板位于harbor / docker-compose.yml

Harbor的特性

  • 基于角色控制:用户和仓库都是基于项目进行组织的,而用户在项目中可以拥有不同的权限
  • 基于镜像的复制策略:镜像可以在多个Harbor实例之间进行复制(同步)
  • 支持LDAP/AD:Harbor可以集成企业内部已有的 AD/LDAP(类似数据库的一张表),用于对已经存在的用户认证和管理
  • 镜像删除和垃圾回收:镜像可以被删除,也可以回收镜像占用的空间
  • 图形化用户界面:用户可以通过浏览器来浏览,搜索镜像仓库以及对项目进行管理
  • 审计管理:所有针对镜像仓库的操作都可以被记录追溯,用于审计管理
  • 支持RESTful API:RESTful API提供给管理员对于Harbor更多的操控,使得与其它管理软件集成变得更容易
  • Harbor和docker registry的关系: Harbor实质上是对docker registry做了封装,扩展了自己的业务模板

Harbor的构成

  • Harbor在架构上主要有 Proxy,Registry,Core services,Database(Harbor-db),Log collector(Harbor-log),Job services六个组件
  • Proxy:是一个nginx的前端代理,Harbor的Registry、UI、Token服务等组件,都处在nginx反向代理后边。该代理将来自浏览器、docker clients的请求转发到后端不同的服务上
  • Registry:负责储存Docker镜像,并处理Docker push/pull命令。由于要对用户进行访问控制,即不同用户对Docker镜像有不同的读写权限,Registry会指向一个Token服务,强制用户的每次Docker pull/push请求都要携带一个合法的Token,Registry会通过公钥对Token进行解密验证
  • Core services: Harbor的核心功能,主要提供以下3个服务:
  1. UI(harbor-ui):提供图形化界面,帮助用户管理Registry上的镜像(image),并对用户进行授权。
  2. WebHook:为了及时获取Registry上image状态变化的情况,在Registry上配置、webhook,把状态变化传递给UI模块。
  3. Token服务:负责根据用户权限给每个Docker push/pull命令签发Token。Docker客户端向Registry服务发起的请求,如果不包含Token,会被重定向到Token服务,获得Token后再重新向 Registry进行请求
  • Database (harbor-db):为core services提供数据库服务,负责储存用户权限、审计日志、Docker镜像分组信息等数据
  • Job services:主要用于镜像复制,本地镜像可以被同步到远程Harbor实例上
  • Log collector(harbor-log):负责收集其他组件的日志到一个地方

Harbor的每个组件都是以Docker容器的形式构建的,因此,使用 Docker Compose来对它进行部署。

总共分为7个容器运行,通过在docker-compose .,yml所在目录中执行 docker-compose ps命令来查看,名称分别为: nginx、harbor-jobservice、harbor-ui、harbor-db、harbor-adminserver、registry、harbor-log。

其中 harbor-adminserver主要是作为一个后端的配置数据管理,并没有太多的其他功能。harbor-ui所要操作的所有数据都通过harbor-adminserver这样一个数据配置管理中心来完成。

Harbor.cfg配置文件中有两类参数

所需参数和可选参数
所需参数

这些参数需要在配置文件 Harbor.cfg中设置。如果用户更新它们并运行install.sh脚本重新安装Harbor,参数将生效。具体参数如下

  • hostname:用于访问用户界面和 register服务。它应该是目标机器的IP地址或完全限定的域名(FQDN),例如 192.168.237.141或hub.wpc.cn,不要使用localhost或127.0.0.1为主机名
  • ui_url_protocol: (http或https,默认为http)用于访问UI和令牌/通知服务的协议。如果公证处于启用状态,则此参数必须为https。
  • max_job_workers:镜像复制作业线程
  • db_password:用于db_auth的MySQL数据库root用户的密码
  • customize_crt:该属性可设置为打开或关闭,默认打开。打开此属性时,准备脚本创建私钥和根证书,用于生成/验证注册表令牌。当由外部来源提供密钥和根证书时,将此属性设置为off
  • ssl_cert: SSL证书的路径,仅当协议设置为https时才应用
  • secretkey path:用于在复制策略中加密或解密远程register密码的密钥路径
可选参数

这些参数对于更新是可选的,即用户可以将其保留为默认值,并在启动Harbor 后在web UI上进行更新。如果进入Harbor.cfg,只会在第一次启动Harbor时生效,随后对这些参数的更新,Harbor.cfg将被忽略

注意:如果选择通过UI设置这些参数,请确保在启动Harbor后立即执行此操作。具体来说,必须在注册或在Harbor中创建任何新用户之前设置所需的 auth_mode。当系统中有用户时(除了默认的 admin用户),auth mode不能被修改,具体参数如下

  • Email:Harbor需要该参数才能向用户发送"密码重置"电子邮件,并且只有在需要该功能时才启用。请注意,默认情况下SSL连接时没有启用。如果SMTP服务器需要SSL,不支持STARTTLS,那么应该通过设置启用SSL email_ssl=TRUE
  • harbor admin password:管理员的初始密码,只在Harbor第一次启动时生效。之后,此设置将被忽略,并且应在UI中设置管理员的密码。请注意,默认的用户名/密码是admin/Harbor12345
  • auth mode:使用的认证类型,默认情况下,它是db_auth,即凭据存储在数据库中。对于LDAP身份验证,请将其设置为ldap_auth
  • self registration:启用/禁用用户注册功能。禁用时,新用户只能由Admin用户创建,只有管理员用户可以在Harbor 中创建新用户。注意:当auth_mode 设置为ldap_auth时,自注册功能将始终处于禁用状态,并且该标志被忽略
  • Token_expiration:由令牌服务创建的令牌的到期时间(分钟),默认为30分钟
  • project creation_restriction:用于控制哪些用户有权创建项目的标志。默认情况下,每个人都可以创建一个项目。如果将其值设置为"adminonly",那么只有admin可以创建项目
  • verify remote_cert:打开或关闭,默认打开。此标志决定了当Harbor与远程register实例通信时是否验证SSL/TLS证书。将此属性设置为 off将绕过SSL/TLS验证,这在远程实例具有自签名或不可信证书时经常使用

另外,默认情况下,Harbor将镜像存储在本地文件系统上。在生产环境中,可以考虑使用其他存储后端而不是本地文件系统,如S3,Openstack,Swif、Ceph等对象存储。但需要更新common/templates/registry/config.yml文件

Harbor的默认镜像存储路径在/data/registry目录下,映射到docker容器里面的/storage目录下。这个参数是在docker-compose.yml中指定的,在docker-compose up -d运行之前修改

如果希望将Docker镜像存储到其他的磁盘路径,可以修改这个参数

Harbor 部署

服务器类型

系统和IP地址

需要安装的组件

Harbor服务器

CentOS7.4(64 位) 192.168.237.141

docker-ce、docker-compose、harbor-offline-v1.2.2

client服务器

CentOS7.4(64 位) 192.168.237.130

docker-ce

Harbor服务器

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# cd /opt
[root@localhost opt]# chmod +x docker-compose		#赋权
[root@localhost opt]# mv docker-compose /usr/local/bin/		#移动
[root@localhost opt]# docker-compose -v				#查看版本
docker-compose version 1.21.1, build 5a3f1a3
[root@localhost opt]# tar zxvf harbor-offline-installer-v1.2.2.tgz -C /usr/local/		#解压到指定目录
[root@localhost opt]# vim /usr/local/harbor/harbor.cfg			#编辑配置文件
###第五行###
hostname = 192.168.80.10

###第59行 默认的用户名/密码为:admin/horbor12345###
harbor_admin_password = Harbor12345
:wq

[root@localhost ~]# vim /etc/sysctl.conf			#开启转发
net.ipv4.ip_forward = 1
:wq
[root@localhost ~]# sysctl -p

[root@localhost ~]# vim /etc/docker/daemon.json				#更改配置文件
{
"registry-mirrors": ["https://d4r5l929.mirror.aliyuncs.com"]
"insecure-registries": ["192.168.237.141"]			#增加私有仓库地址
}
:wq

[root@localhost opt]# cd /usr/local/harbor/
[root@localhost harbor]# ./install.sh			#安装
.....
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating harbor-adminserver ... done
Creating harbor-db          ... done
Creating registry           ... done
Creating harbor-ui          ... done
Creating nginx              ... done
Creating harbor-jobservice  ... done

✔ ----Harbor has been installed and started successfully.----			#安装并启动成功

Now you should be able to visit the admin portal at http://192.168.237.141. 
For more details, please visit https://github.com/vmware/harbor .

[root@localhost harbor]# docker-compose ps			#查看
       Name                     Command               State                                                        Ports                                                      
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
harbor-adminserver   /harbor/harbor_adminserver       Up                                                                                                                      
harbor-db            docker-entrypoint.sh mysqld      Up      3306/tcp                                                                                                        
harbor-jobservice    /harbor/harbor_jobservice        Up                                                                                                                      
harbor-log           /bin/sh -c crond && rm -f  ...   Up      127.0.0.1:1514->514/tcp                                                                                         
harbor-ui            /harbor/harbor_ui                Up                                                                                                                      
nginx                nginx -g daemon off;             Up      0.0.0.0:443->443/tcp,:::443->443/tcp, 0.0.0.0:4443->4443/tcp,:::4443->4443/tcp, 0.0.0.0:80->80/tcp,:::80->80/tcp
registry             /entrypoint.sh serve /etc/ ...   Up      5000/tcp

测试登录
浏览器登录192.168.237.141登录harbor,账号密码为admin,Harbor12345
登上去后,选择左侧项目,可以看到相关信息,点击[+项目],添加项目,项目名称自己写,我的是myproject-wpc,访问级别,不勾选[私有],也是默认私有
#使用Docker命令在本地通过127.0.0.1来登录和推送镜像默认情况下,Registry服务器在80端口上侦听
[root@localhost harbor]# docker login http://127.0.0.1		#登录
Username: admin
Password: Harbor12345
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

测试(下载一个tomcat)
[root@localhost harbor]# docker pull tomcat		#下载一个tomcat镜像
Using default tag: latest
latest: Pulling from library/tomcat
Digest: sha256:9dee185c3b161cdfede1f5e35e8b56ebc9de88ed3a79526939701f3537a52324
Status: Image is up to date for tomcat:latest
docker.io/library/tomcat:latest

[root@localhost harbor]# docker images
....
127.0.0.1/myproject-wpc/tomcat   v1                fb5657adc892   6 months ago   680MB
....

[root@localhost harbor]# docker push 127.0.0.1/myproject-wpc/tomcat:v1
The push refers to repository [127.0.0.1/myproject-wpc/tomcat]
....
v1: digest: sha256:e6d65986e3b0320bebd85733be1195179dbce481201a6b3c1ed27510cfa18351 size: 2422


浏览器找到新增的项目,点击项目,可以看到刚才添加的镜像,右上角的admin点击下拉,可以修改密码

维护管理Harbor

  • 通过Harbor Web创建项目

在Harbor仓库中,任何镜像在被push到regsitry之前都必须有一个自己所属的项目。
单击“+项目”,填写项目名称,项目级别若设置为"私有",则不勾选。如果设置为公共仓库,则所有人对此项目下的镜像拥有读权限,命令行中不需要执行"Docker login"即可下载镜像,镜像操作与Docker Hub一致。

  • 创建Harbor 用户

创建用户并分配权限
在Web管理界面中单击系统管理 --> 用户管理 --> +用户,
填写用户名为"wpc-zhangsan",邮箱为"wpc-zhangsan@wpc.com",全名为"zhangsan",密码为"Abcde123",注释为“管理员”(可省略)。

附:用户创建成功后,单击左侧“…”按钮可将上述创建的用户设置为管理员角色或进行删除操作,本例不作任何设置。

  • 加入刚创建的用户

在Web管理界面中单击项目–>创建的项目–>成员–>[+成员]–>输入wpc-zhangsan–>选择开发人员,添加

客户端

[root@localhost ~]# docker login -u wpc-zhangsan -p Abcde123 http://192.168.237.141		#创建的用户登录
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
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 ~]# docker images
REPOSITORY                       TAG       IMAGE ID       CREATED      SIZE
127.0.0.1/myproject-wpc/tomcat   v1        451d25ef4583   8 days ago   483MB
tomcat                           latest    451d25ef4583   8 days ago   483MB

[root@localhost ~]# docker pull 192.168.237.141/myproject-wpc/tomcat:v1		#harbor仓库中下载一个tomcat
v1: Pulling from myproject-wpc/tomcat
....
Digest: sha256:e6d65986e3b0320bebd85733be1195179dbce481201a6b3c1ed27510cfa18351
Status: Downloaded newer image for 192.168.237.141/myproject-wpc/tomcat:v1
192.168.237.141/myproject-wpc/tomcat:v1

[root@localhost ~]# docker images
REPOSITORY                             TAG       IMAGE ID       CREATED        SIZE
127.0.0.1/myproject-wpc/tomcat         v1        451d25ef4583   8 days ago     483MB
tomcat                                 latest    451d25ef4583   8 days ago     483MB
192.168.237.141/myproject-wpc/tomcat   v1        fb5657adc892   6 months ago   680MB

[root@localhost ~]# docker push 192.168.237.141/myproject-wpc/tomcat:v1		#上传到harbor仓库
The push refers to repository [192.168.237.141/myproject-wpc/tomcat]
....
v1: digest: sha256:e6d65986e3b0320bebd85733be1195179dbce481201a6b3c1ed27510cfa18351 size: 2422

验证
浏览器中点击项目,选择myproject-wpc,查看仓库中镜像是否有刚才上传的,点击日志,查看到wpc-zhangsan上传的记录
  • 修改 Harbor.cfg 配置文件

要更改Harbour的配置文件中的可选参数时,请先停止现有的Harbour实例并更新Harbor.cfg: 然后运行prepare 脚本来填充配置:最后重新创建并启动Harbour 的实例

使用docker-compose管理Harbor时,必须在与docker-compose.yml相同的目录中运行

[root@localhost ~]# cd /usr/local/harbor/
[root@localhost harbor]# docker-compose down -v			#停止harbor
Stopping nginx              ... done
Stopping harbor-jobservice  ... done
Stopping harbor-ui          ... done
Stopping registry           ... done
Stopping harbor-db          ... done
Stopping harbor-adminserver ... done
Stopping harbor-log         ... done
Removing nginx              ... done
Removing harbor-jobservice  ... done
Removing harbor-ui          ... done
Removing registry           ... done
Removing harbor-db          ... done
Removing harbor-adminserver ... done
Removing harbor-log         ... done
Removing network harbor_harbor
[root@localhost harbor]# docker-compose ps				#已经没有镜像了
Name   Command   State   Ports
------------------------------

[root@localhost harbor]# vim harbor.cfg 				#可以根据自己需求,修改配置文件
[root@localhost harbor]# ./prepare 						#运行prepare
Clearing the configuration file: ./common/config/adminserver/env
Clearing the configuration file: ./common/config/ui/env
Clearing the configuration file: ./common/config/ui/app.conf
Clearing the configuration file: ./common/config/ui/private_key.pem
Clearing the configuration file: ./common/config/db/env
Clearing the configuration file: ./common/config/jobservice/env
Clearing the configuration file: ./common/config/jobservice/app.conf
Clearing the configuration file: ./common/config/registry/config.yml
Clearing the configuration file: ./common/config/registry/root.crt
Clearing the configuration file: ./common/config/nginx/nginx.conf
loaded secret from file: /data/secretkey
Generated configuration file: ./common/config/nginx/nginx.conf
Generated configuration file: ./common/config/adminserver/env
Generated configuration file: ./common/config/ui/env
Generated configuration file: ./common/config/registry/config.yml
Generated configuration file: ./common/config/db/env
Generated configuration file: ./common/config/jobservice/env
Generated configuration file: ./common/config/jobservice/app.conf
Generated configuration file: ./common/config/ui/app.conf
Generated certificate, key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt
The configuration files are ready, please use docker-compose to start the service.

[root@localhost harbor]# docker-compose up -d			#重新启动
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating harbor-adminserver ... done
Creating harbor-db          ... done
Creating registry           ... done
Creating harbor-ui          ... done
Creating harbor-jobservice  ... done
Creating nginx              ... done
  • 移除 Harbor 服务容器同时保留镜像数据/数据库,并进行迁移

持久数据,如镜像,数据库等在宿主机的/data/目录下,日志在宿主机的/var/log/Harbor/目录下

[root@localhost ~]# cd /usr/local/harbor/
[root@localhost harbor]# docker-compose down -v
Stopping nginx              ... done
Stopping harbor-jobservice  ... done
Stopping harbor-ui          ... done
Stopping registry           ... done
Stopping harbor-db          ... done
Stopping harbor-adminserver ... done
Stopping harbor-log         ... done
Removing nginx              ... done
Removing harbor-jobservice  ... done
Removing harbor-ui          ... done
Removing registry           ... done
Removing harbor-db          ... done
Removing harbor-adminserver ... done
Removing harbor-log         ... done
Removing network harbor_harbor

[root@localhost harbor]# ls /data/registry/docker/registry/v2/repositories/myproject-wpc	#查看镜像
tomcat
[root@localhost harbor]# cd /data/registry/docker/registry/v2/repositories/myproject-wpc	#进入目录

[root@localhost myproject-wpc]# tar zcvf wpc-registry.tar.gz ./*			#打包备份
./tomcat/
.....
[root@localhost myproject-wpc]# ll
总用量 4
drwxr-xr-x. 5 root root   55 7月   5 19:07 tomcat
-rw-r--r--. 1 root root 1385 7月   6 18:57 wpc-registry.tar.gz
  • 重新部署harbor,需要清除数据
[root@localhost myproject-wpc]# cd /usr/local/harbor/
[root@localhost harbor]# docker-compose down -v
Stopping nginx              ... done
Stopping harbor-jobservice  ... done
Stopping harbor-ui          ... done
Stopping harbor-adminserver ... done
Stopping harbor-db          ... done
Stopping registry           ... done
Stopping harbor-log         ... done
Removing nginx              ... done
Removing harbor-jobservice  ... done
Removing harbor-ui          ... done
Removing harbor-adminserver ... done
Removing harbor-db          ... done
Removing registry           ... done
Removing harbor-log         ... done
Removing network harbor_harbor
[root@localhost harbor]# rm -rf /data/database/		#删除数据
[root@localhost harbor]# ll
总用量 527664
drwxr-xr-x. 4 root root        37 7月   5 18:48 common
-rw-r--r--. 1 root root      1163 10月 20 2017 docker-compose.clair.yml
-rw-r--r--. 1 root root      1988 10月 20 2017 docker-compose.notary.yml
-rw-r--r--. 1 root root      3191 10月 20 2017 docker-compose.yml
-rw-r--r--. 1 root root      4304 10月 20 2017 harbor_1_1_0_template
-rw-r--r--. 1 root root      4344 7月   5 18:47 harbor.cfg
-rw-r--r--. 1 root root 539885476 10月 20 2017 harbor.v1.2.2.tar.gz
-rwxr-xr-x. 1 root root      5332 10月 20 2017 install.sh
-rw-r--r--. 1 root root    371640 10月 20 2017 LICENSE
-rw-r--r--. 1 root root       482 10月 20 2017 NOTICE
-rwxr-xr-x. 1 root root     17592 10月 20 2017 prepare
-rwxr-xr-x. 1 root root      4550 10月 20 2017 upgrade
[root@localhost harbor]# cd /data/registry/docker/registry/v2/repositories/myproject-wpc
[root@localhost myproject-wpc]# ll
总用量 4
drwxr-xr-x. 5 root root   55 7月   5 19:07 tomcat
-rw-r--r--. 1 root root 1385 7月   6 18:57 wpc-registry.tar.gz
[root@localhost myproject-wpc]# mv wpc-registry.tar.gz /opt		#移走备份
[root@localhost myproject-wpc]# cd ~
[root@localhost ~]# rm -rf /data/registry/			#删除数据