从零开始学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 小时前
Linux性能调优 详解磁盘工作流程及性能指标
linux·运维·服务器·性能调优
企鹅侠客5 小时前
Linux性能调优 再谈磁盘性能指标和进程级IO
linux·运维·服务器·性能调优
虚伪的空想家6 小时前
云镜像,虚拟机镜像怎么转换成容器镜像
服务器·docker·容器·k8s·镜像·云镜像·虚机
不过普通话一乙不改名6 小时前
Linux 网络收包的进阶之路:从普通 socket 到 AF_XDP 零拷贝
linux·运维·网络
在路上@Amos6 小时前
Linux 命令行查看 串口hex数据
linux·运维·服务器
人工智能训练6 小时前
Linux 系统核心快捷键表(可打印版)
linux·运维·服务器·人工智能·ubuntu·容器·openeuler
x***13397 小时前
使用Docker快速搭建Redis主从复制
redis·docker·容器
czc1318 小时前
4K QPS 博客社区:CCBlog 全栈开源,Springboot项目实战,Docker一键部署
spring boot·redis·docker·开源·vue·rabbitmq
dualven_in_csdn8 小时前
【疑难问题】某些win11机器 网卡统计也会引起dns client 占用cpu问题
运维·服务器·网络
sanduo1128 小时前
docker 构建编排过程中常见问题
运维·docker·容器