🌊

M1 Mac で `qemu: uncaught target signal 11 (Segmentation fault)` で落ちる

2023/05/02に公開1

motivation

  • M1 Mac の特定の環境で Docker Desktop 上で Docker を動作させると qemu: uncaught target signal 11 (Segmentation fault) エラーが発生することがある
  • 解決したい

solution

ref. https://github.com/docker/for-mac/issues/5123

I had the same issue using M1 chip with MacOS Monterey 12.5.
After upgrading to MacOS Ventura 13.3 and selecting
Use Rosetta for x86/amd64 emulation on Apple Silicon
in Docker Desktop -> Settings -> Features in development, the error disappeared and everything worked fine.
  • Mac の OS を Ventura (13.x) に更新
  • Docker Desktop のバージョンを最新版の更新 (今回試した時のバージョンは 4.19.0)
  • Docker Desktop の以下の設定にチェックを入れる
    • Docker Desktop -> Settings -> Features in development -> Use Rosetta for x86/amd64 emulation on Apple Silicon

case

act コマンドを用いてローカル環境での GitHub Actions の動作確認をしようとした時に落ちた(hadolint の動作検証)
→ 上記対応をした結果動くようになった

before

※出力内容から絵文字は消してます

[Dockerfile/hadolint]   docker run image=act-hadolint-hadolint-action-v3-1-0-dockeraction:latest platform=linux/amd64 entrypoint=[] cmd=["./dockerfiles/Dockerfile_ubuntu_job"]
[DockerfileLint/dockerfile_lint]   add-matcher /root/problem-matcher.json
| qemu: uncaught target signal 11 (Segmentation fault) - core dumped
| 
| Hadolint output saved to: /dev/stdout
[Dockerfile/hadolint]   ::remove-matcher owner=brpaz/hadolint-action::
[Dockerfile/hadolint]   Failure - Main hadolint/hadolint-action@v3.1.0
[Dockerfile/hadolint]   ::set-env:: HADOLINT_RESULTS=
[Dockerfile/hadolint]   ::set-output:: results=
[Dockerfile/hadolint] exit with `FAILURE`: 139
[Dockerfile/hadolint] Job failed

after

[Dockerfile/hadolint]   docker run image=act-hadolint-hadolint-action-v3-1-0-dockeraction:latest platform=linux/amd64 entrypoint=[] cmd=["./dockerfiles/Dockerfile_application_job"]
(snip.)
[Dockerfile/hadolint]   Success - Main hadolint/hadolint-action@v3.1.0
[Dockerfile/hadolint]   ::set-env:: HADOLINT_RESULTS=./dockerfiles/Dockerfile_application_job:31 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
./dockerfiles/Dockerfile_application_job:38 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
[Dockerfile/hadolint]   ::set-output:: results=./dockerfiles/Dockerfile_application_job:31 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
./dockerfiles/Dockerfile_application_job:38 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
[Dockerfile/hadolint] Job succeeded

Discussion

S.S.S.S.

In the docker new version(4.25.0 (126437)), I can not find this option.
Do you have a unique solution?