LoginSignup
22
14

More than 5 years have passed since last update.

docker-compose upするとコンテナが一瞬でexited with code 1する話

Posted at

WindowsにVagrant(VirtualBox) + Dockerで開発環境を構築していた際に上記の現象に遭遇した。VMのOSはCoreOS。

具体的には、docker-compose run {コンテナ名} bashは通るのに、docker-compose upすると
コンテナが一瞬でexited with code 1するという状態。

その時に出ていたログはこちら。
standard_init_linux.go:178: exec user process caused "no such file or directory"

色々と調べまくっていたのですが、こちらで原因を発見。

原因は改行コードで、コンテナの起動時に実行しているstart.shを秀丸でいじっていたことが原因。
いつの間にか改行コードがCRLF(Windowsの標準)になっていた模様。LF(Linux/UNIXの標準)に変更したところ、起動ができました。

22
14
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
22
14