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?

More than 3 years have passed since last update.

docker-composeでアプリのコンテナが立ち上がらず困惑しました!というお話

Posted at

ある日、開発途中のrailsアプリを立ち上げようと

docker-compose up

しようとしたら、

Cannot start service webpacker: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"./bin/webpack-dev-server\": stat ./bin/webpack-dev-server: no such file or directory": unknown

というエラーでて、
アプリのコンテナが、extend with 0で落ちました。

その後、エラー文を調べると以下記事を見つけ解決にいたりました!
docker-compose upしようとしたら「Cannot start service」 - Qiita

結果からいうと
以前、gitignoreを編集しているときに
bin/以下ファイルを何を思ったか追加してて、ディレクトリごと削除していたんです。

で、
docker-composeファイル内のcommandで指定している"bin/webpack-dev-server"コマンドを実行しようとしても、そもそもdocker-composeでマウントするディレクトリにないですけど!
と注意を受けていた訳でした。

原因がわかったので、解決

git log
でbinファイルを削除してしまったコミットIDを調べる。

git revert [コミットID]
コミットを取り消す

docker-compose up
無事起動を確認

慢心ですね。
gitignoreの扱いには注意。

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