Open stevencaocao opened 2 years ago
這是可能你本地Docker配寘的問題,可以通過下麵的參攷方法進行配寘:
方法一: [root@linux-08]# vi /usr/lib/systemd/system/docker.service ExecStart=/usr/bin/dockerd --insecure-registry 192.168.1.191:5000
[root@linux-08]# systemctl daemon-reload && systemctl restart docker
方法二: [root@linux-08]# vi /etc/docker/daemon.json { "registry-mirrors": ["https://registry.docker-cn.com"], "insecure-registries": ["192.168.1.191:5000"] }
[root@linux-08]# systemctl daemon-reload && systemctl restart docker
方法三: [root@linux-08]# cat /etc/docker/daemon.json { "registry-mirrors": [ "https://registry.docker-cn.com" ] } { "insecure-registry":["192.168.1.191:5000"] }
[root@linux-08]# systemctl daemon-reload && systemctl restart docker
更多配寘請查看Docker官方檔案。
你好!
我看了上面三种方法,都是常规安装docker和docker registry的解决办法, 使用kube-install一件安装k8s环境后,安装目录不清楚是哪一个,另外docker服务也并不是docker.service,找不到这个服务。具体看如下在node机器上的操作日志
[root@k8s ~]# find / -name docker.service /tmp/.kubeinstalltemp/data/k8s.cluster1/sys/0x0000000000base/docker/templates/docker.service [root@k8s ~]# find / -name docker find: ‘/proc/6132’: 没有那个文件或目录 /run/containerd/io.containerd.runtime.v2.task/k8s.io/8c5d65185bf730c9265c7439c7c81079e8c94e1f140d6a4d032f34bf00a1c898/rootfs/etc/docker /tmp/.kubeinstalltemp/data/k8s.cluster1/sys/0x0000000000base/docker /opt/kube-install/k8s/runtime/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/20/fs/etc/docker /opt/kube-install/k8s/runtime/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/169/fs/etc/docker [root@k8s ~]# systemctl daemon-reload && systemctl restart docker Failed to restart docker.service: Unit not found.
你好! 问题已解决,由于我安装的k8s是1.24,容器改用containerd我还以为是docker,因此找不到以上docker配置及服务。 推送和拉取镜像使用ctr -n=k8s.io images push --plain-http=true 192.168.1.191:5000/镜像名称:镜像tag就可以了。 另外web页面里面给的例子少了--plain-http=true,因此按照例子做不成功。
由于我安装的k8s是1.24,容器改用containerd我还以为是docker,因此找不到以上docker配置及服务。
如果你想使用docker的話,可以部署v1.23及以下版本。 由於k8s v1.24版本已經默認不支持docker了,所以我們相容了官方推薦的containerd。
你好! 1.24,容器改用containerd。另外web页面里面给的例子少了--plain-http=true,因此按照例子做不成功。
Thank you very much for your feedback!
我們已經修復了這個問題,新發佈的版本中將不會有這個誤會的提示。
ERRO[0000] server "192.168.1.191:5000" does not seem to support HTTPS error="failed to do request: Head \"https://192.168.1.191:5000/v2/alpine/blobs/sha256:43773d1dba76c4d537b494a8454558a41729b92aa2ad0feb23521c3e58cd0440\": http: server gave HTTP response to HTTPS client" INFO[0000] Hint: you may want to try --insecure-registry to allow plain HTTP (if you are in a trusted network) FATA[0000] failed to do request: Head "https://192.168.1.191:5000/v2/alpine/blobs/sha256:43773d1dba76c4d537b494a8454558a41729b92aa2ad0feb23521c3e58cd0440": http: server gave HTTP response to HTTPS client