0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

!/bin/bashを記載しているのにentrypint.shでerrorが発生する場合の解決策

Last updated at Posted at 2024-05-18

!/bin/bashを記載しているのにentrypint.shでerrorが発生する場合の解決策

発生した事象

docker compose runでrails newをする際に、以下のエラーが発生

exec /usr/bin/entrypoint.sh: exec format error

原因

いろいろ調べてみて、entrypoint.shに#!/bin/bashを記載すると良いとかplatform: linux/amd64を指定してあげれば良いという記事があった。
どちらもやってみたが、解決はできなかった。

そこで、再度他の方が書いているentrypoint.shの記載と再度見比べてみる。一部違う部分があった。

解決策

他の方は一行目に#!/bin/bashが記載してあったが、エラーが発生したentrypoint.shは一行目に別のコメントを#で残していて2行目に#!/bin/bashを記載していた。

これを削除するとエラーが解決した。

# コメント ← 記載していた部分を削除
#!/bin/bash
set -e
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?