使用Docker解决microK8s registry.k8s.io/pause:3.7镜像拉取失败问题

使用Docker解决microK8s registry.k8s.io/pause:3.7镜像拉取失败问题

1. 安装docker

apt update
apt install docker.io

2. 查找镜像

root@testk8s:/home/test/下载# docker search pause:3.7

NAME                 DESCRIPTION                      STARS     OFFICIAL   AUTOMATED
hongshixing/pause    fork from k8s.gcr.io/pause:3.7   0                 
qazwsxqwe123/pause   k8s.gcr.io/pause:3.7             0

3. 下载镜像

root@testk8s:/home/test/下载# docker image pull qazwsxqwe123/pause:3.7
3.7: Pulling from qazwsxqwe123/pause
7582c2cc65ef: Pull complete 
Digest: sha256:445a99db22e9add9bfb15ddb1980861a329e5dff5c88d7eec9cbf08b6b2f4eb1
Status: Downloaded newer image for qazwsxqwe123/pause:3.7
docker.io/qazwsxqwe123/pause:3.7

4. 输出镜像包

root@testk8s:/home/test/下载# docker image list
REPOSITORY           TAG       IMAGE ID       CREATED         SIZE
qazwsxqwe123/pause   3.7       221177c6082a   11 months ago   711kB

root@testk8s:/home/test/下载# docker image tag qazwsxqwe123/pause:3.7 registry.k8s.io/pause:3.7

root@testk8s:/home/test/下载# docker image list
REPOSITORY              TAG       IMAGE ID       CREATED         SIZE
qazwsxqwe123/pause      3.7       221177c6082a   11 months ago   711kB
registry.k8s.io/pause   3.7       221177c6082a   11 months ago   711kB

root@testk8s:/home/test/下载# docker save -o pause37.tar registry.k8s.io/pause
root@testk8s:/home/test/下载# ll
总用量 1424
drwxr-xr-x  2 test test   4096 28 11:31 ./
drwxr-xr-x 14 test test   4096 26 14:30 ../
-rw-------  1 root  root  721408 28 11:31 pause37.tar
-rwxr-xr-x  1 test test 721408 26 15:05 pause.tar*

5. 导入镜像

ctr image import pause37.tar

6. 重启microk8s

microk8s stop && microk8s start

7. 启动成功

root@testk8s:/home/test/下载# microk8s status
microk8s is running
high-availability: no
  datastore master nodes: 127.0.0.1:19001
  datastore standby nodes: none
addons:
  enabled:
    ha-cluster           # (core) Configure high availability on the current node
    helm                 # (core) Helm - the package manager for Kubernetes
    helm3                # (core) Helm 3 - the package manager for Kubernetes
  disabled:
    cert-manager         # (core) Cloud native certificate management
    community            # (core) The community addons repository
    dashboard            # (core) The Kubernetes dashboard
    dns                  # (core) CoreDNS
    gpu                  # (core) Automatic enablement of Nvidia CUDA
    host-access          # (core) Allow Pods connecting to Host services smoothly
    hostpath-storage     # (core) Storage class; allocates storage from host directory
    ingress              # (core) Ingress controller for external access
    kube-ovn             # (core) An advanced network fabric for Kubernetes
    mayastor             # (core) OpenEBS MayaStor
    metallb              # (core) Loadbalancer for your Kubernetes cluster
    metrics-server       # (core) K8s Metrics Server for API access to service metrics
    minio                # (core) MinIO object storage
    observability        # (core) A lightweight observability stack for logs, traces and metrics
    prometheus           # (core) Prometheus operator for monitoring and logging
    rbac                 # (core) Role-Based Access Control for authorisation
    registry             # (core) Private image registry exposed on localhost:32000
    storage              # (core) Alias to hostpath-storage add-on, deprecated

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在 CentOS 上使用 Podman 启动 Minikube 并遇到 "Error: initializing source docker://gcr.io/k8s-minikube/kicbase:v0.0.39: pinging container registry gcr.io: Get "https://gcr.io/v2/": dial tcp 74.125.23.82:443: i/o timeout" 错误,说明 Podman 无法从 `gcr.io` 上拉取镜像。 这个错误通常是由于网络连接问题导致的。你可以尝试以下解决方法: 1. 检查网络连接: 确保你的网络连接正常,并且可以访问互联网。尝试使用浏览器或其他网络工具访问 `https://gcr.io/v2/`,看看是否可以成功连接。 2. 检查防火墙设置: 检查你的系统防火墙或网络防火墙设置,确保允许与 `gcr.io` 的通信。如果有防火墙规则限制对特定 IP 或端口的访问,你可能需要相应地进行配置。 3. 使用代理: 如果你的网络使用代理,请确保 Podman 可以通过代理连接到 `gcr.io`。你可以设置相应的代理环境变量,以便 Podman 使用正确的代理配置。 ``` export HTTP_PROXY=http://proxy.example.com:port export HTTPS_PROXY=http://proxy.example.com:port ``` 将 `proxy.example.com` 和 `port` 替换为你的代理服务器和端口。 4. 更换镜像源: 如果你无法访问 `gcr.io`,可以尝试使用其他镜像源。你可以通过修改 Podman 的配置文件来指定其他镜像源,例如 Docker Hub 或其他私有镜像仓库。 首先,打开 Podman 的配置文件 `/etc/containers/registries.conf`: ``` sudo vi /etc/containers/registries.conf ``` 然后,将 `gcr.io` 替换为其他镜像源的地址。例如,将其替换为 Docker Hub 的地址: ``` [registries.search] registries = ['docker.io'] ``` 保存并关闭文件。然后重新启动 Podman 并尝试启动 Minikube。 如果问题仍然存在,请确保你的系统满足 Minikube 和 Podman 的最低要求,并参考 Minikube 和 Podman 的官方文档或社区支持寻求进一步的帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值