控制台 => 容器服务 => 镜像仓库 => 我的镜像
不能直接创建镜像,需先创建命名空间!
如果您不需要自动化构建的过程,目前就可以使用了,您只需要将您的镜像,打一个tag ,然后login、push到该命名空间下即可!
$ sudo docker login --username={APPID} ccr.ccs.tencentyun.com $ docker tag {您目前镜像的ID或name:tag} ccr.ccs.tencentyun.com/{命名空间名字}/{您需要的镜像名字}:{tag} $ docker push ccr.ccs.tencentyun.com/{命名空间名字}/{您需要的镜像名字}:{tag}
这种方式直接push上去,会自动加入到我的镜像中。
# docker login 登录 [root@VM-1-5-centos ~]# sudo docker login --username={APPID} ccr.ccs.tencentyun.com 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 # 这里我没有构建自己的镜像,所以直接pull一个公共的镜像 [root@VM-1-5-centos ~]# docker pull mysql:5.7 5.7: Pulling from library/mysql 8559a31e96f4: Pull complete d51ce1c2e575: Pull complete c2344adc4858: Pull complete fcf3ceff18fc: Pull complete 16da0c38dc5b: Pull complete b905d1797e97: Pull complete 4b50d1c6b05c: Pull complete d85174a87144: Pull complete a4ad33703fa8: Pull complete f7a5433ce20d: Pull complete 3dcd2a278b4a: Pull complete Digest: sha256:32f9d9a069f7a735e28fd44ea944d53c61f990ba71460c5c183e610854ca4854 Status: Downloaded newer image for mysql:5.7 # docker tag [root@VM-1-5-centos ~]# docker tag mysql:5.7 ccr.ccs.tencentyun.com/image-testing/test-mysql:v5.7 [root@VM-1-5-centos ~]# docker push ccr.ccs.tencentyun.com/image-testing/test-mysql:v5.7 The push refers to repository [ccr.ccs.tencentyun.com/image-testing/test-mysql] c90a34afcab0: Pushed ac7657905788: Pushed 8f0182ef7c8c: Pushed 91ae264962fb: Pushed 3a2464d8e0c0: Pushed 44853bb67274: Pushed 61cbb8ea6481: Pushed 66c45123fd43: Pushed c3f46b20a0d3: Pushed 365386a39e0e: Pushed 13cb14c2acd3: Pushed v5.7: digest: sha256:0563b36ec2d1a262f79e1d8562e61f642a0f64f93306d8a709047cdea0444d0a size: 2621
推送成功!
如需从代码仓库GitHub 或 GItLab 中自动构建,则可以进行下一步,自动构建镜像
这里就是刚刚上一步执行那些操作的指引;
使用立即构建可以通过 Dockerfile 的形式进行构建,或者构建配置使用公共代码托管平台的代码构建!
Dockerfile构建
在这个页面使用Dockerfile 个人觉得及其不方便一些需要的COPY操作无法实现,也不便于自动化。
我这里由于没有创建TKE集群中的具体控制器以及服务,所以无法选中需更新的服务!
原创声明,本文系作者授权云+社区发表,未经许可,不得转载。
如有侵权,请联系 yunjia_community@tencent.com 删除。
我来说两句