push到阿里云或者腾讯云的私有仓储,然后使用 docker tag 标记pull拉取镜像push私有仓储pull私有仓储1、登录vps 然后拉取 等待拉取完成
[root@myserver ~]# docker pull mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim 2.2-stretch-slim: Pulling from dotnet/core/aspnet 804555ee0376: Pull complete 970251047358: Pull complete f3d4c41a4fd1: Pull complete bd391c46585f: Pull complete Digest: sha256:ae9a94a778b4c4656f036e1dd858d6c972f6ad4423bdf9c5022e16f28fee5cf9 Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim
2、查看并push私有仓储
以下是阿里云私有仓储push教程,其他私有仓储请按照相应云服务商教程来
--查看拉取成功后的镜像 [root@myserver ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE mcr.microsoft.com/dotnet/core/aspnet 2.2-stretch-slim e7e3b238011c 7 months ago 261MB --按照私有仓储教程push [root@myserver ~]# docker tag e7e3b238011c registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore:2.2-stretch-slim [root@myserver ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE mcr.microsoft.com/dotnet/core/aspnet 2.2-stretch-slim e7e3b238011c 7 months ago 261MB registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore 2.2-stretch-slim e7e3b238011c 7 months ago 261MB -- 执行push 上传 [root@myserver ~]# docker push registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore:2.2-stretch-slim The push refers to repository [registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore] 579a8f1d6a12: Pushed 15e45d99c926: Pushed 0cf75cb98eb2: Pushed 814c70fdae62: Pushed 2.2-stretch-slim: digest: sha256:ae9a94a778b4c4656f036e1dd858d6c972f6ad4423bdf9c5022e16f28fee5cf9 size: 1164 --上传成功
3、使用镜像
-- 按照云服务商私有镜像拉取 [root@localhost docker_mvc]# docker pull registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore:2.2-stretch-slim 2.2-stretch-slim: Pulling from polang_dotnetcore/polang_dotnetcore Digest: sha256:ae9a94a778b4c4656f036e1dd858d6c972f6ad4423bdf9c5022e16f28fee5cf9 Status: Image is up to date for registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore:2.2-stretch-slim registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore:2.2-stretch-slim -- 使用tag标记 [root@localhost docker_mvc]# docker images --查看下载成功的私有镜像 REPOSITORY TAG IMAGE ID CREATED SIZE registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore 2.2-stretch-slim e7e3b238011c 7 months ago 261MB [root@localhost docker_mvc]# docker tag e7e3b238011c mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim --使用tag标记 [root@localhost docker_mvc]# docker images --再次查看 REPOSITORY TAG IMAGE ID CREATED SIZE mcr.microsoft.com/dotnet/core/aspnet 2.2-stretch-slim e7e3b238011c 7 months ago 261MB registry.cn-shenzhen.aliyuncs.com/polang_dotnetcore/polang_dotnetcore 2.2-stretch-slim e7e3b238011c 7 months ago 261MB
本文作者:Cheng
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 本原创文章未经允许不得转载 许可协议。转载请注明出处!