可以将映像从 Docker 推送到嵌入式 Harbor 注册表 上的项目。嵌入式 Harbor 注册表 中的项目对应于 主管集群 上的 vSphere 命名空间。
前提条件
此外,获取对以下命名空间具有写入权限的用户帐户:与要将映像推送到其中的 Harbor 注册表 上的项目对应的命名空间。
最后,需要一个可推送到注册表的本地映像。以下命令将从 Docker Hub 中提取 hello-world 映像。您将需要一个帐户来提取映像。
docker run hello-world
预期结果:
Hello from Docker! This message shows that your installation appears to be working correctly.
使用
docker images
命令验证映像。
docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest bf756fb1ae65 10 months ago 13.3kB
过程
示例
docker tag busybox:latest <container-registry-IP>/<namespace-name>/busybox:latest docker push <container-registry-IP>/busybox/busybox:latest
下一步做什么
使用 Harbor 注册表中的映像部署 vSphere Pod。请参见使用嵌入式 Harbor 注册表 将应用程序部署到 vSphere Pod。