Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view logs for a docker image?

In the docker world, one can easily see logs for docker container (that is, a running image). But during image creation, one usually issues multiple commands. For example npm install commands in node projects. It would be beneficial to see logs for those commands as well. I quickly searched from the documentation, but didn't find how one can obtain logs for docker image. Is it possible?

like image 850
Ville Miekk-oja Avatar asked Jun 15 '16 10:06

Ville Miekk-oja


People also ask

Where are the docker container logs?

By default, Docker stores log files in a dedicated directory on the host using the json-file log driver. The log file directory is /var/lib/docker/containers/<container_id> on the host where the container is running.


1 Answers

Had the same problem, I solved it using

docker build --no-cache --progress=plain -t my-image . 
like image 82
diegocl02 Avatar answered Sep 19 '22 15:09

diegocl02