文章目录
- 1. 镜像转存需求
- 2. 注册并登陆 killercoda URL
- 3. 打开playground
- 4. 在线拉取K8S镜像并打上标签
- 5. 推送K8S镜像到Docker私有仓库
- 6. 登陆Docker私有仓库查看
1. 镜像转存需求
因K8S镜像在不开代理的情况下,拉取超时、下载缓慢,导致镜像拉取不下来。现在通过在线交互学习平台,进行拉取,后转存到docker私有仓库,再进行拉取,可以解决镜像拉取、下载失败等问题。
2. 注册并登陆 killercoda URL
注册URL:Killercoda Interactive Environments
- 选择登陆方式
- 输入邮箱地址
- 前往邮件后台,查收邮件。
- 点击
click here to login
。
- 授权等待中…
- 注册登陆完成。
3. 打开playground
4. 在线拉取K8S镜像并打上标签
controlplane $ docker pull k8s.gcr.io/autoscaling/vpa-admission-controller:0.13.0
0.13.0: Pulling from autoscaling/vpa-admission-controller
fc251a6e7981: Pull complete
da7e855a5a9b: Pull complete
Digest: sha256:c857dcbfc071bcdd25bd9835955eda2c05e8846f638d0556475e4b40f2fbd294
Status: Downloaded newer image for k8s.gcr.io/autoscaling/vpa-admission-controller:0.13.0
k8s.gcr.io/autoscaling/vpa-admission-controller:0.13.0
controlplane $ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/autoscaling/vpa-admission-controller 0.13.0 b285911b0ebb 13 months ago 53.9MB
xybdiy/vpa-admission-controller 0.12.0 f4325d883003 18 months ago 53.9MB
k8s.gcr.io/autoscaling/vpa-admission-controller 0.12.0 f4325d883003 18 months ago 53.9MB
controlplane $ docker tag k8s.gcr.io/autoscaling/vpa-admission-controller:0.13.0 xybdiy/vpa-admission-controller:0.13.0
controlplane $
controlplane $ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
xybdiy/vpa-admission-controller 0.13.0 b285911b0ebb 13 months ago 53.9MB
k8s.gcr.io/autoscaling/vpa-admission-controller 0.13.0 b285911b0ebb 13 months ago 53.9MB
k8s.gcr.io/autoscaling/vpa-admission-controller 0.12.0 f4325d883003 18 months ago 53.9MB
xybdiy/vpa-admission-controller 0.12.0 f4325d883003 18 months ago 53.9MB
controlplane $
5. 推送K8S镜像到Docker私有仓库
controlplane $ docker login
Authenticating with existing credentials...
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
controlplane $ docker push xybdiy/vpa-admission-controller:0.13.0
The push refers to repository [docker.io/xybdiy/vpa-admission-controller]
3fe018b48e98: Pushed
cb60fb9b862c: Pushed
0.13.0: digest: sha256:28b0ca918c58debf94334c56404223490c475daa2abb2d91bdfc15533ca8df5e size: 739
6. 登陆Docker私有仓库查看
URL:https://hub.docker.com/