harbor仓库具体使用方法

**[root@server9 harbor]# docker-compose ps**
      Name                     Command                  State                          Ports                   
---------------------------------------------------------------------------------------------------------------
harbor-core         /harbor/harbor_core              Up (healthy)                                              
harbor-db           /docker-entrypoint.sh            Up (healthy)   5432/tcp                                   
harbor-jobservice   /harbor/harbor_jobservice  ...   Up (healthy)                                              
harbor-log          /bin/sh -c /usr/local/bin/ ...   Up (healthy)   127.0.0.1:1514->10514/tcp                  
harbor-portal       nginx -g daemon off;             Up (healthy)   8080/tcp                                   
nginx               nginx -g daemon off;             Up (healthy)   0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp
redis               redis-server /etc/redis.conf     Up (healthy)   6379/tcp                                   
registry            /home/harbor/entrypoint.sh       Up (healthy)   5000/tcp                                   
registryctl         /home/harbor/start.sh            Up (healthy)      

                                        
**[root@server9 harbor]# docker-compose logs**
Attaching to harbor-jobservice, nginx, harbor-core, registryctl, harbor-db, harbor-portal, registry, redis, harbor-log
harbor-core    | WARNING: no logs are available with the 'syslog' log driver
harbor-db      | WARNING: no logs are available with the 'syslog' log driver
harbor-jobservice | WARNING: no logs are available with the 'syslog' log driver
harbor-portal  | WARNING: no logs are available with the 'syslog' log driver
nginx          | WARNING: no logs are available with the 'syslog' log driver
redis          | WARNING: no logs are available with the 'syslog' log driver
registry       | WARNING: no logs are available with the 'syslog' log driver
registryctl    | WARNING: no logs are available with the 'syslog' log driver
[root@server9 harbor]# docker-compose rm
Going to remove harbor-jobservice, nginx, harbor-core, registryctl, harbor-db, harbor-portal, registry, redis, harbor-log
Are you sure? [yN] y
Removing harbor-jobservice ... done
Removing nginx             ... done
Removing harbor-core       ... done
Removing registryctl       ... done
Removing harbor-db         ... done
Removing harbor-portal     ... done
Removing registry          ... done
Removing redis             ... done
Removing harbor-log        ... done
[root@server9 harbor]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

把里面的所有容器都删掉,然后加一些功能,重新安装。

[root@server9 harbor]# docker-compose down

停止现在所有的容器并删除除容器外,镜像网络存储全部删除
在这里插入图片描述

✔ ----Harbor has been installed and started successfully.----
[root@server9 harbor]# docker-compose ps
      Name                     Command                       State                                     Ports                           
---------------------------------------------------------------------------------------------------------------------------------------
chartmuseum         ./docker-entrypoint.sh           Up (healthy)            9999/tcp                                                  
clair               ./docker-entrypoint.sh           Up (healthy)            6060/tcp, 6061/tcp                                        
clair-adapter       /clair-adapter/clair-adapter     Up (health: starting)   8080/tcp                                                  
harbor-core         /harbor/harbor_core              Up (health: starting)                                                             
harbor-db           /docker-entrypoint.sh            Up (healthy)            5432/tcp                                                  
harbor-jobservice   /harbor/harbor_jobservice  ...   Up (health: starting)                                                             
harbor-log          /bin/sh -c /usr/local/bin/ ...   Up (healthy)            127.0.0.1:1514->10514/tcp                                 
harbor-portal       nginx -g daemon off;             Up (healthy)            8080/tcp                                                  
nginx               nginx -g daemon off;             Up (health: starting)   0.0.0.0:4443->4443/tcp, 0.0.0.0:80->8080/tcp,             
                                                                             0.0.0.0:443->8443/tcp                                     
notary-server       /bin/sh -c migrate-patch - ...   Up  (正在启动中)                                                                              
notary-signer       /bin/sh -c migrate-patch - ...   Up                                                                                
redis               redis-server /etc/redis.conf     Up (healthy)            6379/tcp                                                  
registry            /home/harbor/entrypoint.sh       Up (healthy)            5000/tcp                                                  
registryctl         /home/harbor/start.sh            Up (healthy)                                                                      
[root@server9 harbor]# docker ps 
CONTAINER ID        IMAGE                                                     COMMAND                  CREATED             STATUS                             PORTS                                                                 NAMES
dff63bec9aa2        goharbor/harbor-jobservice:v1.10.1                        "/harbor/harbor_jobs…"   35 seconds ago      Up 23 seconds (health: starting)                                                                         harbor-jobservice
6f266e19d9db        goharbor/nginx-photon:v1.10.1                             "nginx -g 'daemon of…"   36 seconds ago      Up 23 seconds (health: starting)   0.0.0.0:4443->4443/tcp, 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp   nginx
54d831880b16        goharbor/notary-server-photon:v0.6.1-v1.10.1              "/bin/sh -c 'migrate…"   40 seconds ago      Up 28 seconds                                                                                            notary-server
92c083eacd2c        goharbor/clair-adapter-photon:v1.0.1-v1.10.1              "/clair-adapter/clai…"   42 seconds ago      Up 33 seconds (healthy)            8080/tcp                                                              clair-adapter
2d8d4b23b818        goharbor/notary-signer-photon:v0.6.1-v1.10.1              "/bin/sh -c 'migrate…"   46 seconds ago      Up 41 seconds                                                                                            notary-signer
ff1a219c3200        goharbor/harbor-core:v1.10.1                              "/harbor/harbor_core"    46 seconds ago      Up 36 seconds (healthy)                                                                                  harbor-core
c767704fc790        goharbor/clair-photon:v2.1.1-v1.10.1                      "./docker-entrypoint…"   46 seconds ago      Up 42 seconds (healthy)            6060-6061/tcp                                                         clair
b680722ae654        goharbor/registry-photon:v2.7.1-patch-2819-2553-v1.10.1   "/home/harbor/entryp…"   55 seconds ago      Up 48 seconds (healthy)            5000/tcp                                                              registry
4e5daad005bf        goharbor/harbor-db:v1.10.1                                "/docker-entrypoint.…"   55 seconds ago      Up 46 seconds (healthy)            5432/tcp                                                              harbor-db
976296f8f95f        goharbor/harbor-registryctl:v1.10.1                       "/home/harbor/start.…"   55 seconds ago      Up 51 seconds (healthy)                                                                                  registryctl
2c34e467afe7        goharbor/chartmuseum-photon:v0.9.0-v1.10.1                "./docker-entrypoint…"   55 seconds ago      Up 51 seconds (healthy)            9999/tcp                                                              chartmuseum
26148632a08a        goharbor/harbor-portal:v1.10.1                            "nginx -g 'daemon of…"   55 seconds ago      Up 49 seconds (healthy)            8080/tcp                                                              harbor-portal
f9dea0ec61dd        goharbor/redis-photon:v1.10.1                             "redis-server /etc/r…"   55 seconds ago      Up 47 seconds (healthy)            6379/tcp                                                              redis
f02d1084d3f6        goharbor/harbor-log:v1.10.1                               "/bin/sh -c /usr/loc…"   57 seconds ago      Up 55 seconds (healthy)            127.0.0.1:1514->10514/tcp                                             harbor-log

等它完全启动起来
在这里插入图片描述
在这里插入图片描述

测试功能

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
library默认是公开的,当不为公开时,你拉取不支持匿名拉取,只能登陆后才能拉取

[root@server9 harbor]# docker tag registry:latest reg.westos.org/library/registry
[root@server9 harbor]# docker push reg.westos.org/library/registry
The push refers to repository [reg.westos.org/library/registry]
7b9a3910f3c3: Pushed 
3764c3e89288: Pushed 
b4592cba0628: Pushed 
de9819405bcf: Pushed 
9a5d14f9f550: Pushed 
latest: digest: sha256:42043edfae481178f07aa077fa872fcc242e276d302f4ac2026d9d2eb65b955f size: 1363

在这里插入图片描述
自动扫描

在这里插入图片描述内容信任是没有签名的镜像不允许部署到我们的生产环境中

选择这个功能以后,阻止潜在漏洞镜像,
扫描你的镜像后,有漏洞的话,会给你的镜像漏洞评级,
当如果有漏洞的镜像部署到生产环境

在这里插入图片描述

[root@server10 docker]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              d1a364dc548d        5 days ago          133MB
[root@server10 docker]# docker pull game2048
Using default tag: latest
Error response from daemon: pull access denied for game2048, repository does not exist or may require 'docker login': denied: requested access to the resource is denied


说没有登陆
因为把内容信任点开了
在这里插入图片描述在这里插入图片描述
在这里插入图片描述

私有仓库下载不了后,docker能连接外网的话会自动到外网下载。

在这里插入图片描述registry外网有

GitHub 加速计划 / ha / harbor
23.24 K
4.68 K
下载
Harbor 是一个开源的容器镜像仓库,用于存储和管理 Docker 镜像和其他容器镜像。 * 容器镜像仓库、存储和管理 Docker 镜像和其他容器镜像 * 有什么特点:支持多种镜像格式、易于使用、安全性和访问控制
最近提交(Master分支:3 个月前 )
bccfd5fb Signed-off-by: stonezdj <stone.zhang@broadcom.com> 6 天前
d39d9797 Signed-off-by: yminer <miner.yang@broadcom.com> Co-authored-by: yminer <miner.yang@broadcom.com> 7 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐