Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin Alpine Linux version in Docker builds #74169

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion distribution/docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down
16 changes: 10 additions & 6 deletions distribution/docker/src/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "\"");
Expand Down