I have to clone a couple of big repos in my Dockerfile. It really can take an hour to clone a single repo and I want to see standard Git progress output to understand what's going on.

However, when Git is started from the Dockerfile, I see no git clone output whatsoever. The only thing printed to console is:

Cloning into '/root/lib/opencv'...
POST git-upload-pack (gzip 2052 to 1062 bytes)

and then just a silence. While, usually, I expect something like this:

Cloning into 'opencv'...
POST git-upload-pack (gzip 2040 to 1052 bytes)
remote: Counting objects: 158365, done.
Receiving objects:   8% (12670/158365), 2.32 MiB | 255.00 KiB/s
... and so on ...

How to enable git verbose output in docker build? Maybe I have to start some interactive mode?


Solution 1:

As far as I undestand it's not the issue of the Docker, but issue of the git. By default git shows progress if you are in an interactive console. If you are not you could specify additional paremeters to git clone to output progress to stdout:

git clone --progress --verbose .....