Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker build npm error logs

If a npm install command fails while building a Dockerfile, how can I view the contents of npm-debug.log? My problems are exacerbating because they only take place on Elastic Beanstalk app uploads, but the question still applies for local docker builds.

like image 848
eunoia Avatar asked Jun 12 '14 19:06

eunoia


1 Answers

The best way would be to run docker build --rm=false . in order to keep intermediary image and start bash from the last success build step then run the npm install from there.

Alternatively, you can also docker commit <id> with the id of the container which ran npm install. Example:

Step 9 : RUN  npm install
---> Running in 2955a741027a
blablabla
FAIL
$> docker commit 2955a741027a test && docker run -it test cat /path/to/npm-debug.log
like image 77
creack Avatar answered Nov 07 '22 10:11

creack