From 2ff27a86c0cbd929867f2271df6d7b67a5f0fc24 Mon Sep 17 00:00:00 2001 From: Elliott Hillary Date: Fri, 1 Mar 2024 21:55:46 +0000 Subject: [PATCH] Only add binutils for JDK images binutils is needed for jlink to be able to use objcopy, but jlink doesn't exist in JRE builds. Signed-off-by: Elliott Hillary --- 17/jre/alpine/Dockerfile | 3 --- 17/jre/centos/Dockerfile | 3 --- 17/jre/ubuntu/focal/Dockerfile | 3 --- 17/jre/ubuntu/jammy/Dockerfile | 3 --- 21/jre/alpine/Dockerfile | 3 --- 21/jre/ubuntu/jammy/Dockerfile | 3 --- docker_templates/partials/binutils.j2 | 4 ++-- 7 files changed, 2 insertions(+), 20 deletions(-) diff --git a/17/jre/alpine/Dockerfile b/17/jre/alpine/Dockerfile index a5544ecdb..964681d01 100644 --- a/17/jre/alpine/Dockerfile +++ b/17/jre/alpine/Dockerfile @@ -36,9 +36,6 @@ RUN set -eux; \ ca-certificates p11-kit-trust \ # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 musl-locales musl-locales-lang \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ tzdata \ ; \ rm -rf /var/cache/apk/* diff --git a/17/jre/centos/Dockerfile b/17/jre/centos/Dockerfile index 74bd18b3c..3807d9615 100644 --- a/17/jre/centos/Dockerfile +++ b/17/jre/centos/Dockerfile @@ -29,9 +29,6 @@ RUN set -eux; \ yum install -y \ gzip \ tar \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 curl \ wget \ diff --git a/17/jre/ubuntu/focal/Dockerfile b/17/jre/ubuntu/focal/Dockerfile index 617e8086b..f2e321241 100644 --- a/17/jre/ubuntu/focal/Dockerfile +++ b/17/jre/ubuntu/focal/Dockerfile @@ -38,9 +38,6 @@ RUN set -eux; \ # utilities for keeping Ubuntu and OpenJDK CA certificates in sync # https://github.com/adoptium/containers/issues/293 ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ tzdata \ # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 locales \ diff --git a/17/jre/ubuntu/jammy/Dockerfile b/17/jre/ubuntu/jammy/Dockerfile index 0ee058d78..e67cad081 100644 --- a/17/jre/ubuntu/jammy/Dockerfile +++ b/17/jre/ubuntu/jammy/Dockerfile @@ -38,9 +38,6 @@ RUN set -eux; \ # utilities for keeping Ubuntu and OpenJDK CA certificates in sync # https://github.com/adoptium/containers/issues/293 ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ tzdata \ # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 locales \ diff --git a/21/jre/alpine/Dockerfile b/21/jre/alpine/Dockerfile index 06302d05b..77bb6fdad 100644 --- a/21/jre/alpine/Dockerfile +++ b/21/jre/alpine/Dockerfile @@ -36,9 +36,6 @@ RUN set -eux; \ ca-certificates p11-kit-trust \ # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 musl-locales musl-locales-lang \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ tzdata \ ; \ rm -rf /var/cache/apk/* diff --git a/21/jre/ubuntu/jammy/Dockerfile b/21/jre/ubuntu/jammy/Dockerfile index 19eb15469..4fa5f9272 100644 --- a/21/jre/ubuntu/jammy/Dockerfile +++ b/21/jre/ubuntu/jammy/Dockerfile @@ -38,9 +38,6 @@ RUN set -eux; \ # utilities for keeping Ubuntu and OpenJDK CA certificates in sync # https://github.com/adoptium/containers/issues/293 ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ tzdata \ # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 locales \ diff --git a/docker_templates/partials/binutils.j2 b/docker_templates/partials/binutils.j2 index 9a1aa8da3..d81e9ce8c 100644 --- a/docker_templates/partials/binutils.j2 +++ b/docker_templates/partials/binutils.j2 @@ -1,5 +1,5 @@ - {% if version|int >= 13 -%} + {% if image_type == "jdk" and version|int >= 13 -%} # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory binutils \ - {% endif -%} \ No newline at end of file + {% endif -%}