'Wget progress in script
I have a Dockerfile which clones a repo and runs a shell script that exists inside that repo ...
Example
RUN git clone https://github.com/DaehwanKimLab/hisat-genotype.git /hisatgenotype
WORKDIR /hisatgenotype
RUN ["/bin/bash", "setup.sh", "-r"]
The problem I have is that the script uses wget but because docker executes it as non-tty, the resulting progress is displayed in dot mode.
This exceeds the buffer for the log not allowing me to see everything that's happening during the docker build.
I'd prefer to have the wget progress be displayed as a bar, but how can I pass this to the script?
Solution 1:[1]
non-tty(...)I'd prefer to have the
wgetprogress be displayed as a bar
According to wget man page
When the output is not a TTY, the progress bar always falls back to "dot", even if
--progress=barwas passed to Wget during invocation. This behaviour can be overridden and the "bar" output forced by using the "force" parameter as--progress=bar:force.
So you should add --progress=bar:force to your wget call.
Solution 2:[2]
You can use SED to replace all your wget to use progress bar and quiet mode.
sed -i "/wget ftp:/ s/$/ -q --show-progress/" setup.sh
Also, add the -i to apply the change in the file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Daweo |
| Solution 2 |
