Review overlapping use of wget and curl

Use one download tool when it meets the same requirements.

Description

If a Dockerfile installs both wget and curl, check which features each download needs.

Potential impact

Keeping a second tool for the same downloads adds packages to maintain and can increase image size.

Remediation

Keep the tool that handles all required downloads and make each command fail on download errors. Keep both if other build steps need features specific to each.

Examples

The first example uses wget for the first file and curl for the second. The revision keeps ca-certificates and uses curl -fsSL for both. Replace the example.com URLs with verified artifact locations.

Before

dockerfile
FROM debian:12

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl wget \
    && rm -rf /var/lib/apt/lists/*

RUN wget https://example.com/file1.tar.gz
RUN curl -fsSL https://example.com/file2.tar.gz -o file2.tar.gz

After

dockerfile
FROM debian:12

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl \
    && rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://example.com/file1.tar.gz -o file1.tar.gz \
    && curl -fsSL https://example.com/file2.tar.gz -o file2.tar.gz

References