Skip to content

Commit a2a2667

Browse files
authored
Download jdk to a temp file to make sure retries work (#48249)
* Download jdk to a temp file to make sure retries work Note that retries will not work if the conncetion is refused. The version of curl in the base image does not support `--retry-connrefused` * Add -S to curl arguments
1 parent 399ce4e commit a2a2667

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

distribution/docker/src/docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ FROM centos:7 AS builder
1616
ENV PATH /usr/share/elasticsearch/bin:$PATH
1717
ENV JAVA_HOME /opt/jdk-${jdkVersion}
1818

19-
RUN curl -L --retry 8 -s ${jdkUrl} | tar -C /opt -zxf -
19+
RUN curl -L --retry 8 -s -S ${jdkUrl} --continue-at - --output /tmp/jdk.tar.gz && \
20+
tar -C /opt -zxf /tmp/jdk.tar.gz && \
21+
rm -Rf /tmp/jdk.tar.gz
2022

2123
# Replace OpenJDK's built-in CA certificate keystore with the one from the OS
2224
# vendor. The latter is superior in several ways.

0 commit comments

Comments
 (0)