从零开始学docker(五)-可用的docker镜像

最近docker镜像都不能访问,目前亲测可用的docker镜像可用,并拉取mysql测试完成。

缺点 docker search 查不到镜像的索引列表,只能手动查询索引目录(解决方案在最后)。

linux服务器vim打开镜像文件daemon.json

java 复制代码
 vim /etc/docker/daemon.json 

添加以下镜像

shell 复制代码
 {
  "registry-mirrors": [
    "https://docker.1panelproxy.com",
    "https://2m11665s.mirror.aliyuncs.com",
    "https://registry.docker-cn.com",
    "https://dockerhub.azk8s.cn",
    "https://docker.mirrors.ustc.edu.cn",
    "http://hub-mirror.c.163.com",
    "https://k8s.gcr.io",
    "https://github-releases.githubusercontent.com",
    "https://vsxcs7sq.mirror.aliyuncs.com",
    "https://ustc-edu-cn.mirror.aliyuncs.com"
   ]
}

重新加载镜像文件

shell 复制代码
 systemctl daemon-reload

重启docker容器

java 复制代码
 systemctl restart docker

测试拉取mysql镜像

java 复制代码
[root@192 ~]# docker pull mysql
Using default tag: latest
latest: Pulling from library/mysql
2c0a233485c3: Pull complete 
cb5a6a8519b2: Pull complete 
570d30cf82c5: Pull complete 
a841bff36f3c: Pull complete 
80ba30c57782: Pull complete 
5e49e1f26961: Pull complete 
ced670fc7f1c: Pull complete 
0b9dc7ad7f03: Pull complete 
cd0d5df9937b: Pull complete 
1f87d67b89c6: Pull complete 
Digest: sha256:0255b469f0135a0236d672d60e3154ae2f4538b146744966d96440318cc822c6
java 复制代码
[root@192 ~]# docker image ls
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
mysql        latest    56a8c14e1404   2 months ago   603MB

查询仓库索引的方法

以前使用docker search命令进行镜像查询,目前此命令查询会报以下错误

解决方案,在docker search 后添加: register.liberx.info/镜像名称

java 复制代码
docker search register.liberx.info/mysql

查询Description的详情

java 复制代码
docker search register.liberx.info/portainer --no-trunc --limit 5

格式化查询

java 复制代码
 docker search register.liberx.info/portainer --no-trunc --limit 5 --format "{{.Name}}: {{.Description}}"

运行docker的图形化界面portainer-ce

java 复制代码
docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

启动页面访问linuxip:9000

tips: 第一次访问需要创建密码

相关推荐
虎头金猫5 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
分布式存储与RustFS5 天前
MinIO 官方 Docker 镜像被移除:依赖它的项目该怎么办
docker·云原生·devops·对象存储·minio·分布式存储
AI职业加油站5 天前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
此冬歌咏5 天前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s
玉&心5 天前
通过Arthas在线诊断K8S中的内存及JVM等使用情况
docker·k8s·arthas
xing-xing5 天前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
-梅5 天前
linux(8) 软硬链接
linux·运维·服务器
赵文宇(温玉)5 天前
CoreDNS的hosts插件的缺行配置导致k8s集群异常
容器·kubernetes·rancher
guo_wen_qiang5 天前
上传本地镜像到harbor中
docker·容器·持续部署
张洛闻Eren5 天前
k8s云原生【第十课】:水平 Pod 自动扩缩容
运维·数据库·云原生·kubernetes·github