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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With