LoginSignup
26
8

More than 1 year has passed since last update.

M1 mac docker error: exec user process caused "exec format error"

Last updated at Posted at 2021-07-30

M1 mac でdockerのイメージをビルドし、GKEで利用しようとした所、エラーが発生したので解決方法を書いておく。

エラー内容

GCP側で発生したエラーは以下である。

standard_init_linux.go:211: exec user process caused "exec format error"

原因

このエラーは、dockerfileをビルドした M1 mac とコンテナを実行するマシンのCPUアーキテクチャが異なるために発生する。

解決策

amd64のCPUで実行できるようにdocker buildにオプションを指定する。
Dockerfileが存在するディレクトリで以下のコマンドを実行する。

docker build --platform amd64 -t NAME(ここには好きな名前をつける) .

参考記事

ECSのタスク起動時に「standard_init_linux.go」関連のエラーが出た場合の対処方法
docker, apple m1, nginx and standard_init_linux.go:211: exec user process caused "exec format error"

26
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
8