Skip to content

Commit 4702973

Browse files
authored
Pin Alpine Linux version in Docker builds (#74169)
Alpine Linux 3.14.0 is incompatible with older versions of Docker, so pin the version that we use to 3.13. At some point in the future, it will be possible to upgrade Alpine. Also when compiling curl, if the configure step fails and a config.log file exists, then dump it out before exiting to assist diagnosis.
1 parent 8055f68 commit 4702973

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

distribution/docker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void addBuildDockerImageTask(Architecture architecture, DockerBase base) {
295295
baseImages = [baseImage]
296296
buildArgs = buildArgsMap
297297
} else if (base == DockerBase.CENTOS) {
298-
baseImages = ['alpine:latest', base.image]
298+
baseImages = ['alpine:3.13', base.image]
299299
} else {
300300
baseImages = [base.image]
301301
}

distribution/docker/src/docker/Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ RUN chmod 0755 /bin/tini
7272
# Stage 1. Build curl statically. Installing it from RPM on CentOS pulls in too
7373
# many dependencies.
7474
################################################################################
75-
FROM alpine:latest AS curl
75+
FROM alpine:3.13 AS curl
7676
7777
ENV VERSION 7.71.0
7878
ENV TARBALL_URL https://curl.haxx.se/download/curl-\${VERSION}.tar.xz
@@ -99,11 +99,15 @@ RUN gpg --import --always-trust "curl-gpg.pub" && \\
9999
gpg --verify "\${TARBALL_PATH}.asc" "\${TARBALL_PATH}"
100100
101101
# Unpack and build
102-
RUN tar xfJ "\${TARBALL_PATH}" && \\
103-
cd "curl-\${VERSION}" && \\
104-
./configure --disable-shared --with-ca-fallback --with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt && \\
105-
make curl_LDFLAGS="-all-static" && \\
106-
cp src/curl /work/curl && \\
102+
RUN set -e ; \\
103+
tar xfJ "\${TARBALL_PATH}" ; \\
104+
cd "curl-\${VERSION}" ; \\
105+
if ! ./configure --disable-shared --with-ca-fallback --with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt ; then \\
106+
[[ -e config.log ]] && cat config.log ; \\
107+
exit 1 ; \\
108+
fi ; \\
109+
make curl_LDFLAGS="-all-static" ; \\
110+
cp src/curl /work/curl ; \\
107111
strip /work/curl
108112
109113
################################################################################

qa/os/src/test/java/org/elasticsearch/packaging/util/Docker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ private static void executePrivilegeEscalatedShellCmd(String shellCmd, Path loca
330330
args.add("--volume \"" + localPath.getParent() + ":" + containerPath.getParent() + "\"");
331331

332332
// Use a lightweight musl libc based small image
333-
args.add("alpine");
333+
args.add("alpine:3.13");
334334

335335
// And run inline commands via the POSIX shell
336336
args.add("/bin/sh -c \"" + shellCmd + "\"");

0 commit comments

Comments
 (0)