LoginSignup
1
0

More than 1 year has passed since last update.

[Docker]docker-compose up でコンテナが立ち上がらない

Posted at

docker-compose up -dを打ったときのエラー。
一部のコンテナが立ち上がらなかった。

エラー内容

今回はhogeコンテナが立ち上がらない。他のコンテナは立ち上がっているのに。。。

ERROR: for hoge  Cannot start service hoge: network 4819b288c36316e18ef29e3f0ed22fb84f654ae4f659a2ae87707791d62b2242 not found
ERROR: Encountered errors while bringing up the project.

解決

どうやら前回docker-compose downした際にプロジェクトを止めることができていなかったよう。
--remove-orphansオプションで一旦全て削除してからdocker-compose upするとうまくいった

$ docker-compose down --remove-orphans
$ docker-compose up

*--remove-orphansは未定義コンテナという意味。

具体的な原因はprojectにdocker-compose.ymlが二つ(A,B)あり、AでUpした一方でBでDownさせた際にこのようなことが起こった。

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