docker(镜像加速器)
接上篇:docker(centos7.9安装docker)
1、注册一个属于自己的阿里云账户(可复用淘宝账户)
https://promotion.aliyun.com/ntms/act/kubernetes.html
2、获得加速器地址链接
3、粘贴脚本直接执行
-- 当前在 /etc/docker 目录下 [root@hadoop100 docker]# pwd /etc/docker -- 直接脚本,配置镜像加速器 [root@hadoop100 docker]# tee /etc/docker/daemon.json <<-'EOF' > { > "registry-mirrors": ["https://59aqvy0q.mirror.aliyuncs.com"] > } > EOF { "registry-mirrors": ["https://59aqvy0q.mirror.aliyuncs.com"] } -- 激活配置文件 [root@hadoop100 docker]# systemctl daemon-reload -- 重启docker [root@hadoop100 docker]# systemctl restart docker [root@hadoop100 docker]#
4、重启docker服务器
docker run hello-world
-- 运行hello-world,能打印出消息,说明docker配置了镜像加速器能成功运行 [root@hadoop100 docker]# 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/ [root@hadoop100 docker]#
run干了什么?
为什么docker会比VM虚拟机快
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)