1
0

More than 1 year has passed since last update.

AWSトラブルシューティング AWS上でコンテナ起動時に「standard_init_linux.go: exec user process caused: exec format error」が発生

Posted at

現象

  • ECSでFargateを用いて自分で用意したコンテナを実行しようとしたところ、以下のエラーが発生しました。
standard_init_linux.go:228: exec user process caused: exec format error

原因

  • 原因を調査したところ、ビルド環境とAWS Fargateでの実行環境とでCPUアーキテクチャが異なるため、でした。
  • 最近、ビルド環境のマシンがM1Macになったため、ビルド環境のCPUアーキテクチャはarm、Fargate側はx86_64という状態。

対策

  • ホストPC側でDockerビルドする際に、オプションでCPUアーキテクチャを指定する。
docker build --platform linux/amd64 .

*Dockerfile内で定義することもできそうです。
https://matsuand.github.io/docs.docker.jp.onthefly/engine/reference/builder/#from

1
0
1

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
1
0