Apple M2 Pro芯片 + docker-compose up + mysql、elasticsearch pull失败问题的解法

背景

  • (1)从github上git clone了一个基于Spring Boot的Java项目,查看readme,发现要在项目的根目录下,执行“docker-compose up”。
  • (2)执行“docker-compose up”的前提是,在macos上要安装并启动docker。
  • (3)根目录下有一个docker-compose.yml的配置文件,里面有rabbit、mysql、elasticsearch的image说明。
  • (4)执行“docker-compose up”,mysql、elasticsearch pull失败问题。

解决办法

1 mysql pull失败

  • (1)报错:no matching manifest for linux/arm64/v8 in the manifest list entries
  • (2)google搜索后,发现相关的stackoverflow文章
  • (3)尝试后,解决了问题,具体如下
    之前的配置写法:
  mysql57:
    image: mysql:5.7
    container_name: common-mistakes-mysql57
    ...

现在的配置写法,增加:platform: linux/x86_64

  mysql57:
    platform: linux/x86_64
    image: mysql:5.7
    container_name: common-mistakes-mysql57
    ...

2 elasticsearch pull失败问题

  • (1)报错:Error response from daemon: Head “https://docker.elastic.co/v2/elasticsearch/elasticsearch/manifests/7.5.2”: Get “https://docker-auth.elastic.co/auth?scope=repository%3Aelasticsearch%2Felasticsearch%3Apull&service=token-service”: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
  • (2)google搜索关键字:docker-compose up elasticsearch Error response from daemon,发现发现相关的stackoverflow文章
  • (3)尝试后,解决了问题,具体如下
    打开docker客户端的设置,如下图勾选“Use containerd for pulling and storing images”,点击“Apply & restart”
    在这里插入图片描述

最后执行:docker-compose up,成功!

  • stackoverflow就是牛啊!
  • 31
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值