- 启动harbor 安装步骤省略。如需手动启动Harbor,可在Harbor安装路径下执行:
docker-compose up -d
在harbor的web界面中,新建项目,给出名称,比如greenplum
- 在 Docker 上配置 Harbor 仓库 2.1 docker登录harbor
[root@k8s-master data]# docker login http://10.10.10.187
Username: admin
Password:
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
2.2 登录成功后,推送image 注意: 首先应确保docker的镜像名称,包含了harbor域名或IP,然后是项目名称。如本例中,harbor没有配置域名,所以直接使用了IP地址。前面新建了项目名称为greenplum,所以镜像标签为:10.10.10.187/greenplum/kyv10:v1
[root@k8s-master data]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
flannel/flannel v0.22.3 e23f7ca36333 9 days ago 70.2MB
10.10.10.187/greenplum/kyv10 v1 399f3fd46947 2 weeks ago 2.9GB
greenplum/kyv10 v1 399f3fd46947 2 weeks ago 2.9GB
registry.k8s.io/kube-apiserver v1.28.2 cdcab12b2dd1 2 weeks ago 126MB
registry.k8s.io/kube-controller-manager v1.28.2 55f13c92defb 2 weeks ago 122MB
registry.k8s.io/kube-proxy v1.28.2 c120fed2beb8 2 weeks ago 73.1MB
registry.k8s.io/kube-scheduler v1.28.2 7a5d9d67a13f 2 weeks ago 60.1MB
flannel/flannel-cni-plugin v1.2.0 a55d1bad692b 2 months ago 8.04MB
registry.k8s.io/etcd 3.5.9-0 73deb9a3f702 4 months ago 294MB
registry.k8s.io/coredns/coredns v1.10.1 ead0a4a53df8 7 months ago 53.6MB
registry.k8s.io/pause 3.9 e6f181688397 11 months ago 744kB
[root@k8s-master data]# docker push 10.10.10.187/greenplum/kyv10:v1
The push refers to repository [10.10.10.187/greenplum/kyv10]
c3adef76b0e6: Pushed
81e320ae50c4: Pushed
7ffb9897d0fb: Pushed
8f57c562b905: Pushed
8dd3e85b3fd4: Pushed
04aae1afb0e7: Pushed
62eaefe677e9: Pushed
80d05bc81c2c: Pushed
f8c11ed06258: Pushed
4e6aa888087d: Pushed
v1: digest: sha256:4c8d8d0d77dd73e1d9f72de22c195052b6e7b20a043bd4b35f3027da98531724 size: 2436
- 完成后可在harbor的web页面中,看到推送的镜像