Skip to content

Commit

Permalink
Only add binutils for JDK images
Browse files Browse the repository at this point in the history
binutils is needed for jlink to be able to use objcopy, but jlink
doesn't exist in JRE builds.

Signed-off-by: Elliott Hillary <[email protected]>
  • Loading branch information
ElliottH committed Mar 2, 2024
1 parent 17c0e49 commit 2ff27a8
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 20 deletions.
3 changes: 0 additions & 3 deletions 17/jre/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
3 changes: 0 additions & 3 deletions 17/jre/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 0 additions & 3 deletions 17/jre/ubuntu/focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 0 additions & 3 deletions 17/jre/ubuntu/jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 0 additions & 3 deletions 21/jre/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
3 changes: 0 additions & 3 deletions 21/jre/ubuntu/jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions docker_templates/partials/binutils.j2
Original file line number Diff line number Diff line change
@@ -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 -%}
{% endif -%}

0 comments on commit 2ff27a8

Please sign in to comment.