diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle index 3caa02cbaddd7..c8403d8ebd1e8 100644 --- a/distribution/docker/build.gradle +++ b/distribution/docker/build.gradle @@ -295,7 +295,7 @@ void addBuildDockerImageTask(Architecture architecture, DockerBase base) { baseImages = [baseImage] buildArgs = buildArgsMap } else if (base == DockerBase.CENTOS) { - baseImages = ['alpine:latest', base.image] + baseImages = ['alpine:3.13', base.image] } else { baseImages = [base.image] } diff --git a/distribution/docker/src/docker/Dockerfile b/distribution/docker/src/docker/Dockerfile index e55fa8c40e584..2d627c5a519cf 100644 --- a/distribution/docker/src/docker/Dockerfile +++ b/distribution/docker/src/docker/Dockerfile @@ -72,7 +72,7 @@ RUN chmod 0755 /bin/tini # Stage 1. Build curl statically. Installing it from RPM on CentOS pulls in too # many dependencies. ################################################################################ -FROM alpine:latest AS curl +FROM alpine:3.13 AS curl ENV VERSION 7.71.0 ENV TARBALL_URL https://curl.haxx.se/download/curl-\${VERSION}.tar.xz @@ -99,11 +99,15 @@ RUN gpg --import --always-trust "curl-gpg.pub" && \\ gpg --verify "\${TARBALL_PATH}.asc" "\${TARBALL_PATH}" # Unpack and build -RUN tar xfJ "\${TARBALL_PATH}" && \\ - cd "curl-\${VERSION}" && \\ - ./configure --disable-shared --with-ca-fallback --with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt && \\ - make curl_LDFLAGS="-all-static" && \\ - cp src/curl /work/curl && \\ +RUN set -e ; \\ + tar xfJ "\${TARBALL_PATH}" ; \\ + cd "curl-\${VERSION}" ; \\ + if ! ./configure --disable-shared --with-ca-fallback --with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt ; then \\ + [[ -e config.log ]] && cat config.log ; \\ + exit 1 ; \\ + fi ; \\ + make curl_LDFLAGS="-all-static" ; \\ + cp src/curl /work/curl ; \\ strip /work/curl ################################################################################ diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/util/Docker.java b/qa/os/src/test/java/org/elasticsearch/packaging/util/Docker.java index 976f6b6148408..5b9333cabb461 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/util/Docker.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/util/Docker.java @@ -330,7 +330,7 @@ private static void executePrivilegeEscalatedShellCmd(String shellCmd, Path loca args.add("--volume \"" + localPath.getParent() + ":" + containerPath.getParent() + "\""); // Use a lightweight musl libc based small image - args.add("alpine"); + args.add("alpine:3.13"); // And run inline commands via the POSIX shell args.add("/bin/sh -c \"" + shellCmd + "\"");