Home > Mobile >  Wget progress in script
Wget progress in script

Time:04-12

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?

CodePudding user response:

You can use SED to replace all your wget to use progress bar and quiet mode.

sed "/^wget/ s/$/ -q --show-progress /g" setup.sh

CodePudding user response:

non-tty(...)I'd prefer to have the wget progress 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=bar was 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.

  • Related