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

More than 3 years have passed since last update.

docker-compose runでstandard_init_linux.go:219 原因と解決

Last updated at Posted at 2021-06-07

#始めに
myappディレクトリ(各自アプリ名)を作成し、その配下に
Dockerfile
docker-compose.yml
Gemfile
Gemfile.lockを用意してあります。

#問題

$ docker-compose run web rails new . --force --no-deps --database=mysql --skip-test --webpacker

を実行すると、

standard_init_linux.go:219: exec user process caused: exec format error

のエラーが出て、新たにアプリが作成できない。

#解決
shebangが抜けていたことが原因だと分かった。
新たに、entrypoint.shファイルを作成し、

entrypoint.sh
#!/bin/bash
set -e

# Remove a potentially pre-existing server.pid for Rails.
rm -f /myapp/tmp/pids/server.pid

# Then exec the container's main process (what's set as CMD in the Dockerfile).
exec "$@"

を記述。
再度、

$ docker-compose run web rails new . --force --no-deps --database=mysql --skip-test --webpacker

を実行し、無事にアプリが作成できた。
#参考記事
https://qiita.com/nsy_13/items/9fbc929f173984c30b5d
https://teratail.com/questions/170342

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