首页 > 其他分享 >Docker运行hello-world镜像失败或超时

Docker运行hello-world镜像失败或超时

时间:2024-08-28 14:49:40浏览次数:5  
标签:daemon hello https world Docker docker

 

测试docker是否运行成功执行docker run hello-world时,报错网络连接失败

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Retrying in 10 seconds
docker: error pulling image configuration: download failed after attempts=6: dial tcp 128.242.245.93:443: connect: connection refused.
See 'docker run --help'.

 

原因就是我们的镜像源不行,需要更换镜像源 但是我们就算知道原因,去找度娘会发现大部分都是说更换阿里的镜像源,但是我们尝试之后并没有作用

配置加速地址:设置registry mirror

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://do.nark.eu.org",
"https://dc.j8.work",
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://docker.mirrors.ustc.edu.cn",
"https://docker.nju.edu.cn"
]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
systemctl status docker

 

重启完docker之后检查registry mirror刚刚配置的加速地址是否成功

可以看到我们已经配置成功:
Registry Mirrors:
https://do.nark.eu.org/
https://dc.j8.work/
https://docker.m.daocloud.io/
https://dockerproxy.com/
https://docker.mirrors.ustc.edu.cn/
https://docker.nju.edu.cn/
Live Restore Enabled: false

运行docker run hello-world,成功运行

 

[root@localhost ~]# docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

 

参考:https://blog.csdn.net/m0_51193794/article/details/141396742

 

标签:daemon,hello,https,world,Docker,docker
From: https://www.cnblogs.com/paul-liang/p/18384633

相关文章

  • 使用 pnpm workspace 和 standalone 模式构建 Next.js 的 Docker 镜像
    引言本文将探讨如何利用pnpmworkspace和standalone模式来构建Next.js应用程序的轻量级Docker镜像。这种方法通过仅在node_modules目录中包含必要的文件,显著减少了最终Docker镜像的大小。Standalone模式简介通常情况下,所有在dependencies中列出的包都会......
  • 在Docker中升级时区规则
    背景最近,由于部分国家和地区取消了了夏令时,导致我们的系统中的定时任务出现了提前执行的情况。这个问题的根源在于,我们当前使用的Java开发工具包(JDK)内置的时区规则数据已经过期,无法及时反映各地区时区调整的最新变化。为了解决这一问题,在不升级整个JDK版本的......
  • 《HelloGitHub》第 101 期
    兴趣是最好的老师,HelloGitHub让你对编程感兴趣!简介HelloGitHub分享GitHub上有趣、入门级的开源项目。github.com/521xueweihan/HelloGitHub这里有实战项目、入门教程、黑科技、开源书籍、大厂开源项目等,涵盖多种编程语言Python、Java、Go、C/C++、Swift...让你在短......
  • 码农必看!《Hello 算法》
    码农必看!《Hello算法》动画图解、一键运行的数据结构与算法教程下载地址夸克:https://pan.quark.cn/s/12b1e0c4747e如果夸克网盘空间不足,可以参考这篇文章免费扩容20T夸克免费扩容20T本书是一份开源、免费的数据结构与算法入门教程,特别适合新手。书中包含14种编程语言......
  • Docker下使用llama.cpp部署带Function calling和Json Mode功能的Mistral 7B模型
    Docker下使用llama.cpp部署带Functioncalling和JsonMode功能的Mistral7B模型说明:首次发表日期:2024-08-27参考:https://www.markhneedham.com/blog/2024/06/23/mistral-7b-function-calling-llama-cpp/https://github.com/abetlen/llama-cpp-python?tab=readme-ov-file#fu......
  • docker 安装后第一次启动时报错
    启动服务:systemctlstartdocker发生错误未能启动查看日志:systemctlstatusdockerjournalctl-xe发现错误:DependencyfailedforDockerApplicationContainerEngine.应该是有依赖服务未启动成功查看依赖服务:systemctllist-dependenciesdocker.service发现是docker.s......
  • docker和containerd的区别
    目录容器运行时Docker:原先的翘楚Containerd:K8s生态系统的标配容器运行时接口(CRI)Kubernetes与dockershim当前支持的CRI后端Dockershim调用关系对比常用命令容器运行时容器运行时(ContainerRuntime)是一种负责在操作系统层面创建和管理容器的软件工具或组件。它是容器化技术的......
  • Docker在CentOS上的安装
    一、yum方式安装更新软件包索引:sudoyumcheck-update安装所需的软件包,以支持通过HTTPS使用Docker仓库:sudoyuminstall-yyum-utilsdevice-mapper-persistent-datalvm2添加Docker的官方YUM仓库:sudoyum-config-manager--add-repohttps://download./linux/cent......
  • Docker常用命令大全2-表格总结的 Docker 命令:
    Docker容器命令命令 描述dockerps 列出所有运行中的容器dockerps-a 列出所有容器(不考虑状态)dockerps-s 列出所有运行中的容器及文件大小dockerps-q 列出运行中容器的IDdockerps-aq 列出所有容器的ID(不考虑状态)dockerps--filter'key=value' 过滤容器列表doc......
  • Docker常用命令大全
    一、docker运行管理类启动dockersystemctlstartdocker关闭dockersystemctlstopdocker重新启动dockersystemctlrestartdockerdocker设置自启动systemctlenabledocker查看docker运行状态systemctlstatusdocker查看docker版本号等信息dock......