Skip to content

Retry wget tasks while building the Docker image #63600

Closed
@dliappis

Description

@dliappis

This was noticed in https://gradle-enterprise.elastic.co/s/trrgg7tocnkw2

with the excerpt showing:

Step 8/48 : RUN wget "https://daniel.haxx.se/mykey.asc" -O "curl-gpg.pub" &&     wget "${TARBALL_URL}.asc" -O "${TARBALL_PATH}.asc" &&     wget "${TARBALL_URL}" -O "${TARBALL_PATH}"
 ---> Running in 517685c84ec3
Connecting to daniel.haxx.se (159.253.31.95:443)
ssl_client: daniel.haxx.se: certificate verification failed: self signed certificate
wget: error getting response: Connection reset by peer
The command '/bin/sh -c wget "https://daniel.haxx.se/mykey.asc" -O "curl-gpg.pub" &&     wget "${TARBALL_URL}.asc" -O "${TARBALL_PATH}.asc" &&     wget "${TARBALL_URL}" -O "${TARBALL_PATH}"' returned a non-zero code: 1

but looking at the [Dockerfile[(https://github.com/elastic/elasticsearch/blob/f491422e1edf79ea08d5657b5035f4a5ee444442/distribution/docker/src/docker/Dockerfile#L65-L67) it appears we aren't retrying while attempting to download with wget.

We should ensure we are trying similarly to how we do things elsewhere e.g.

RUN for iter in {1..10}; do \\
${package_manager} update --setopt=tsflags=nodocs -y && \\
${package_manager} install --setopt=tsflags=nodocs -y \\
nc shadow-utils zip unzip findutils procps-ng && \\
${package_manager} clean all && exit_code=0 && break || exit_code=\$? && echo "${package_manager} error: retry \$iter in 10s" && \\
sleep 10; \\
and
curl --retry 8 -S -L -O https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin} ; \\

Metadata

Metadata

Assignees

Labels

:Delivery/PackagingRPM and deb packaging, tar and zip archives, shell and batch scripts>test-failureTriaged test failures from CITeam:DeliveryMeta label for Delivery team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions