Dockerfile: Avoid wget Without Progress or Quiet Mode

Problem

Using wget without a progress or quiet option produces noisy output and can make Docker build logs hard to read.

Description

By default, wget uses a progress display that is convenient for local interactive terminals but not ideal in CI or Docker build logs. The output can be too verbose, and progress rendering may reduce log clarity when troubleshooting failures.

To keep logs stable and easier to parse, configure wget explicitly. Use --progress=dot:giga when you still want visible progress, or use -q / -nv (--quiet / --no-verbose) when minimal output is preferred.

Solution

Always pass one of these options when using wget in Dockerfile RUN instructions:

  • --progress=dot:giga for concise progress output
  • -nv (--no-verbose) for reduced output with key messages
  • -q (--quiet) for fully silent output

Problematic code

FROM ubuntu:24.04
USER nobody
RUN wget https://example.com/tool.tar.gz -O /tmp/tool.tar.gz

Verified code

FROM ubuntu:24.04
USER nobody
RUN wget --progress=dot:giga https://example.com/tool.tar.gz -O /tmp/tool.tar.gz

Alternative verified forms:

RUN wget -nv https://example.com/tool.tar.gz -O /tmp/tool.tar.gz
# or
RUN wget -q https://example.com/tool.tar.gz -O /tmp/tool.tar.gz
  • https://protsenko.dev/infrastructure-security/standardise-remote-get/
  • https://protsenko.dev/infrastructure-security/curl-bashing-detected/
  • https://protsenko.dev/infrastructure-security/update-and-install-single-run/

Source of the description

  • GNU Wget Manual: https://www.gnu.org/software/wget/manual/wget.html