I'm building a Docker image from a Dockerfile
, but I dont know if when I execute the npm install
command, the server is installing the dependencies from packege.json
. I want to check in real time the progress of the dependencies installation, is it possible?
CMD:docker build -t angular-frontend:prod .
OUTPUT:
Sending build context to Docker daemon 1.264 MB
Step 1 : FROM node:carbon
---> 99bbd77c18fe
Step 2 : WORKDIR /app
---> Running in 1d914a408725
---> fca47246ff16
Removing intermediate container 1d914a408725
Step 3 : COPY package.json /app/
---> 793227e711d4
Removing intermediate container 1f9c5341747e
Step 4 : RUN npm install
---> Running in ddee013be29c
What do I want: See whats happening inside the container. Any hints?
First of all, to list all running containers, use the docker ps command. Then, with the docker logs command you can list the logs for a particular container. Most of the time you'll end up tailing these logs in real time, or checking the last few logs lines.
This is not a Docker problem. Docker outputs the logs during build. For instance, if you do RUN composer update
in your Dockerfile, then you get the output. For example, here's our RUN composer update
output during Dockerfile build on codeship:
See? The output is right there! So, what you need is to tell your npm
to log verbosely:
RUN npm install --loglevel verbose
This should output the logs in real time and also save your log into npm-debug.log
file.
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