Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Apple Silicon M1在Docker上运行gem install bundler时出现Qemu错误_Docker_Docker Compose_Bundler_Qemu_Apple M1 - Fatal编程技术网

使用Apple Silicon M1在Docker上运行gem install bundler时出现Qemu错误

使用Apple Silicon M1在Docker上运行gem install bundler时出现Qemu错误,docker,docker-compose,bundler,qemu,apple-m1,Docker,Docker Compose,Bundler,Qemu,Apple M1,当我运行docker compose up时,出现以下错误 qemu: uncaught target signal 6 (Aborted) - core dumped 当docker compose运行命令bundle install => ERROR [5/6] RUN bundle install --jobs 4 --path .bundle/

当我运行
docker compose up
时,出现以下错误

qemu: uncaught target signal 6 (Aborted) - core dumped
当docker compose运行命令
bundle install

 => ERROR [5/6] RUN bundle install --jobs 4 --path .bundle/                                                                                                                  4.2s
------
 > [5/6] RUN bundle install --jobs 4 --path .bundle/:
#10 4.170 Fetching gem metadata from https://rubygems.org/.[BUG] Segmentation fault at 0x0000418f81e2b0
#10 4.177 ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux]
#10 4.177
#10 4.177 SEGV received in SEGV handler
#10 4.178 -- Control frame information -----------------------------------------------
#10 4.178 SEGV received in SEGV handler
#10 4.178 SEGV received in SEGV handler
#10 4.178 qemu: uncaught target signal 6 (Aborted) - core dumped
#10 4.192 Aborted
------
executor failed running [/bin/sh -c bundle install --jobs 4 --path .bundle/]: exit code: 134
根据docker的github上的这个github问题线程–这是一个与qemu相关的错误

它提到qemu是Docker用于在M1(arm64)芯片上运行Intel(amd64)容器的上游组件。我检查了与qemu回购协议相关的问题,但运气不佳:

在我的docker compose文件中,我传递了以下配置,它帮助我修复了docker上的几个M1相关问题。但这并不能解决这个具体问题

web:
    platform: linux/amd64
    ...
此问题发生在以下环境中

  • MacBookPro M1 2020
  • Mac OS Big Sur 11.2.3
  • docker compose版本1.29.1
  • docker引擎:20.10.6
  • docker desktop 3.3.3(64133)
我还就qemu回购发行了一期债券:


有没有办法解决这个问题?

我找到了一个黑客。这是解决这一具体问题的一种方法。我通过在我的
Dockerfile.yml
顶部添加以下行来更新可能已经过时的图像源,从而修复了此问题

FROM ruby:2.3.4
如果您在另一个库中遇到类似问题,我建议您在Docker Hub上查找映像,并确保它们支持所需的体系结构:amd64或arm65等


有关qemu错误的更多信息,请遵循以下gitlab问题线程: