skip to Main Content

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?

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search