LoginSignup
0
0

More than 3 years have passed since last update.

dockerのcontainerが起動後すぐに停止してしまう問題を見つける方法

Last updated at Posted at 2020-11-26
$ docker-compose logs

このコマンドで、docker起動時のログを見る事ができます。
僕の場合は、vueがすぐに停止してしまい、こんなエラーが出てきました。

front_1  | npm ERR! errno ENOENT
front_1  | npm ERR! app@0.1.0 serve: `vue-cli-service serve`
front_1  | npm ERR! spawn ENOENT
front_1  | npm ERR! 
front_1  | npm ERR! Failed at the app@0.1.0 serve script.
front_1  | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
front_1  | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
front_1  | 
front_1  | npm ERR! A complete log of this run can be found in:
front_1  | npm ERR!     /root/.npm/_logs/2020-11-26T00_35_26_684Z-debug.log
front_1  | 
front_1  | > app@0.1.0 serve /app
front_1  | > vue-cli-service serve
front_1  | 
front_1  | sh: vue-cli-service: not found
front_1  | npm ERR! code ELIFECYCLE
front_1  | npm ERR! syscall spawn
front_1  | npm ERR! file sh
front_1  | npm ERR! errno ENOENT
front_1  | npm ERR! app@0.1.0 serve: `vue-cli-service serve`
front_1  | npm ERR! spawn ENOENT
front_1  | npm ERR! 
front_1  | npm ERR! Failed at the app@0.1.0 serve script.
front_1  | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
front_1  | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
front_1  | 
front_1  | npm ERR! A complete log of this run can be found in:
front_1  | npm ERR!     /root/.npm/_logs/2020-11-26T00_36_01_318Z-debug.log
front_1  | mba:project hoge$ 

原因がわかったので、これをググります。

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