title: Qemu error when running gem install bundler on Docker with Apple Silicon M1
body: <p>When I run <code>docker-compose up</code> I'm getting the following error</p>
  <pre><code>qemu: uncaught target signal 6 (Aborted) - core dumped
  </code></pre>
  <p>This is happening when docker-compose is running the command <code>bundle install</code></p>
  <pre><code> =&gt; ERROR [5/6] RUN bundle install --jobs 4 --path .bundle/                                                                                                                  4.2s
  ------
   &gt; [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
  </code></pre>
  <p>According to this github issue thread on docker's github – <strong>its a qemu related bug</strong>:</p>
  <p><a href="https://github.com/docker/for-mac/issues/5148#issuecomment-784992663" rel="noreferrer">https://github.com/docker/for-mac/issues/5148#issuecomment-784992663</a></p>
  <p>It mentions that qemu is the upstream component Docker use for running Intel (amd64) containers on M1 (arm64) chips. I checked the qemu repo fora related issues with no luck:</p>
  <p><a href="https://gitlab.com/qemu-project/qemu/-/issues?scope=all&amp;utf8=%E2%9C%93&amp;state=opened&amp;search=uncaught+target+signal+6" rel="noreferrer">https://gitlab.com/qemu-project/qemu/-/issues?scope=all&amp;utf8=%E2%9C%93&amp;state=opened&amp;search=uncaught+target+signal+6</a></p>
  <p>In my docker-compose file I've passed the following config which helped me fix a couple M1 related issue on docker. But this isn't working for this specific issue.</p>
  <pre><code>web:
      platform: linux/amd64
      ...
  </code></pre>
  <p>This issue is happening on the following environment</p>
  <ul>
  <li>Macbook Pro M1 2020</li>
  <li>Mac OS Big Sur 11.2.3</li>
  <li>docker-compose version 1.29.1</li>
  <li>docker engine: 20.10.6</li>
  <li>docker desktop 3.3.3(64133)</li>
  </ul>
  <p>I've also opened an issue on qemu repo as well:
  <a href="https://gitlab.com/qemu-project/qemu/-/issues/340" rel="noreferrer">https://gitlab.com/qemu-project/qemu/-/issues/340</a></p>
  <p>Any ideas on how to fix this?</p>