Docker推送镜像到镜像库

一、设置本地Docker环境

设置本地Docker环境,解决https的限制:主要配置insecure-registries

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
    "buildkit": true
  },
  "insecure-registries": [
    "http://10.x.x.98",
    "0.0.0.0/0"
  ],
  "registry-mirrors": [
    "http://10.x.x.98"
  ]
}

 

二、Docker Login镜像库

docker login 10.x.x.98

输入用户名和密码

三、加载镜像

docker load -i x-x-arm64.tar 
0a24540c1e5a: Loading layer [==================================================>]  7.746MB/7.746MB
9033c31946f6: Loading layer [==================================================>]  1.536kB/1.536kB
9fa7434969b8: Loading layer [==================================================>]  24.58kB/24.58kB
e7d7836d37b8: Loading layer [==================================================>]  206.1MB/206.1MB
d83adc617a6d: Loading layer [==================================================>]  293.5MB/293.5MB
16c6f31fbe60: Loading layer [==================================================>]  12.29kB/12.29kB
a2c3000615dd: Loading layer [==================================================>]  81.59MB/81.59MB
44b73441998a: Loading layer [==================================================>]  6.656kB/6.656kB
f30879accbb1: Loading layer [==================================================>]  39.47MB/39.47MB
17ddf9ac3dc4: Loading layer [==================================================>]  186.4kB/186.4kB
6cc6a1bb99ab: Loading layer [==================================================>]   37.4MB/37.4MB
Loaded image: x.x.x.x/x/x-x:v2.6.1

四、镜像标签

docker tag x.x.x.x/x/x-x:v2.6.1 10.x.x.98/x/x-x:v2.6.1.arm64

docker images | grep x-x                                                                                        
10.x.x.98/x/x-x           v2.6.1.arm64                   9560dfb5d148   4 weeks ago     663MB
x.x.x.x/x/x-x             v2.6.1                         9560dfb5d148   4 weeks ago     663MB

五、推送镜像

docker push 10.x.x.98/x/x-x:v2.6.1.arm64

The push refers to repository [10.x.x.98/x/x-x]
6cc6a1bb99ab: Pushed 
17ddf9ac3dc4: Pushed 
f30879accbb1: Pushed 
44b73441998a: Pushed 
a2c3000615dd: Pushed 
16c6f31fbe60: Pushed 
d83adc617a6d: Pushed 
e7d7836d37b8: Pushed 
9fa7434969b8: Pushed 
9033c31946f6: Pushed 
0a24540c1e5a: Pushed 
v2.6.1.arm64: digest: sha256:301068bf640435193bb4443ecdfd191f1a433e96daf2ea3ddd39a0efc2008d47 size: 2629

你可能感兴趣的:(K8S,docker,容器,运维)