diff --git a/Dockerfile b/Dockerfile index a346ab9abc..b535555255 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,9 @@ ARG CMAKE_VERSION=3.25.2 -ARG OPENJDK_VERSION=11.0.13 -ARG OPENJDK_VERSION_SUFFIX=8 +ARG OPENJDK_MAJOR_VERSION=17 +ARG OPENJDK_FULL_VERSION=17.0.8 +ARG OPENJDK_VERSION_SUFFIX=7 # Manually prepare a recent enough version of CMake. # This should be used on platforms where the default package manager @@ -47,23 +48,29 @@ RUN set -xe; (echo "$hash /cmake.sh" | sha256sum -c) # Manually prepare OpenJDK for the current architecture. FROM alpine:latest AS openjdk-amd64 -ARG OPENJDK_VERSION +ARG OPENJDK_MAJOR_VERSION +ARG OPENJDK_FULL_VERSION ARG OPENJDK_VERSION_SUFFIX -ENV hash=3b1c0c34be4c894e64135a454f2d5aaa4bd10aea04ec2fa0c0efe6bb26528e30 -ADD https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${OPENJDK_VERSION}%2B${OPENJDK_VERSION_SUFFIX}/OpenJDK11U-jdk_x64_linux_hotspot_${OPENJDK_VERSION}_${OPENJDK_VERSION_SUFFIX}.tar.gz \ - /tmp/OpenJDK11U.tar.gz +ENV hash=aa5fc7d388fe544e5d85902e68399d5299e931f9b280d358a3cbee218d6017b0 +ADD https://github.com/adoptium/temurin${OPENJDK_MAJOR_VERSION}-binaries/releases/download/jdk-${OPENJDK_FULL_VERSION}%2B${OPENJDK_VERSION_SUFFIX}/OpenJDK${OPENJDK_MAJOR_VERSION}U-jdk_x64_linux_hotspot_${OPENJDK_FULL_VERSION}_${OPENJDK_VERSION_SUFFIX}.tar.gz \ + /tmp/OpenJDK${OPENJDK_MAJOR_VERSION}U.tar.gz FROM alpine:latest AS openjdk-arm64 -ARG OPENJDK_VERSION +ARG OPENJDK_MAJOR_VERSION +ARG OPENJDK_FULL_VERSION ARG OPENJDK_VERSION_SUFFIX -ENV hash=a77013bff10a5e9c59159231dd5c4bd071fc4c24beed42bd49b82803ba9506ef -ADD https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${OPENJDK_VERSION}%2B${OPENJDK_VERSION_SUFFIX}/OpenJDK11U-jdk_aarch64_linux_hotspot_${OPENJDK_VERSION}_${OPENJDK_VERSION_SUFFIX}.tar.gz \ - /tmp/OpenJDK11U.tar.gz +ENV hash=c43688163cfdcb1a6e6fe202cc06a51891df746b954c55dbd01430e7d7326d00 +ADD https://github.com/adoptium/temurin${OPENJDK_MAJOR_VERSION}-binaries/releases/download/jdk-${OPENJDK_FULL_VERSION}%2B${OPENJDK_VERSION_SUFFIX}/OpenJDK${OPENJDK_MAJOR_VERSION}U-jdk_aarch64_linux_hotspot_${OPENJDK_FULL_VERSION}_${OPENJDK_VERSION_SUFFIX}.tar.gz \ + /tmp/OpenJDK${OPENJDK_MAJOR_VERSION}U.tar.gz FROM openjdk-${BUILDARCH} as openjdk-install -RUN set -xe; (echo "$hash /tmp/OpenJDK11U.tar.gz" | sha256sum -c) +ARG OPENJDK_MAJOR_VERSION +RUN set -xe; (echo "$hash /tmp/OpenJDK${OPENJDK_MAJOR_VERSION}U.tar.gz" | sha256sum -c) +RUN set -xe; \ + mkdir -p /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk && \ + tar -xf /tmp/OpenJDK${OPENJDK_MAJOR_VERSION}U.tar.gz -C /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk --strip-components=1 # ====================================== @@ -71,13 +78,15 @@ RUN set -xe; (echo "$hash /tmp/OpenJDK11U.tar.gz" | sha256sum -c) # ====================================== FROM centos:7 AS centos7-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; yum -y update && \ yum -y install git systemd \ autoconf libtool libcurl-devel libtool-ltdl-devel openssl-devel yajl-devel \ - gcc gcc-c++ make bison flex file systemd-devel zlib-devel gtest-devel rpm-build java-11-openjdk-devel \ + gcc gcc-c++ make bison flex file systemd-devel zlib-devel gtest-devel rpm-build \ expect rpm-sign zip - ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk/ +COPY --from=openjdk-install /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk +ENV JAVA_HOME /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ COPY --from=cmake-install-recent /cmake.sh /cmake.sh RUN set -x; bash /cmake.sh --skip-license --prefix=/usr/local @@ -172,13 +181,14 @@ COPY --from=centos7-build /google-cloud-ops-agent*.rpm / # ====================================== FROM rockylinux:8 AS centos8-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; yum -y update && \ dnf -y install 'dnf-command(config-manager)' && \ yum config-manager --set-enabled powertools && \ yum -y install git systemd \ autoconf libtool libcurl-devel libtool-ltdl-devel openssl-devel yajl-devel \ - gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros java-11-openjdk-devel \ + gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros java-${OPENJDK_MAJOR_VERSION}-openjdk-devel \ expect rpm-sign zip tzdata-java SHELL ["/bin/bash", "-c"] @@ -271,6 +281,7 @@ COPY --from=centos8-build /google-cloud-ops-agent*.rpm / # ====================================== FROM rockylinux:9 AS rockylinux9-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; dnf -y update && \ dnf -y install 'dnf-command(config-manager)' && \ @@ -278,10 +289,10 @@ RUN set -x; dnf -y update && \ dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ dnf -y install git systemd \ autoconf libtool libcurl-devel libtool-ltdl-devel openssl-devel yajl-devel \ - gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros java-11-openjdk-devel \ + gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros java-${OPENJDK_MAJOR_VERSION}-openjdk-devel \ expect rpm-sign zip tzdata-java - ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk/ + ENV JAVA_HOME /usr/lib/jvm/java-${OPENJDK_MAJOR_VERSION}-openjdk/ SHELL ["/bin/bash", "-c"] @@ -373,12 +384,13 @@ COPY --from=rockylinux9-build /google-cloud-ops-agent*.rpm / # ====================================== FROM debian:bookworm AS bookworm-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-17-jdk zip + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip SHELL ["/bin/bash", "-c"] @@ -470,12 +482,13 @@ COPY --from=bookworm-build /google-cloud-ops-agent*.deb / # ====================================== FROM debian:bullseye AS bullseye-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip SHELL ["/bin/bash", "-c"] @@ -567,12 +580,15 @@ COPY --from=bullseye-build /google-cloud-ops-agent*.deb / # ====================================== FROM debian:buster AS buster-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip + devscripts cdbs pkg-config zip +COPY --from=openjdk-install /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk +ENV JAVA_HOME /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ SHELL ["/bin/bash", "-c"] @@ -664,6 +680,7 @@ COPY --from=buster-build /google-cloud-ops-agent*.deb / # ====================================== FROM opensuse/archive:42.3 AS sles12-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; \ # The 'OSS Update' repo signature is no longer valid, so verify the checksum instead. @@ -682,12 +699,8 @@ RUN set -x; \ zypper -n install bison>3.4 && \ # Allow fluent-bit to find systemd ln -fs /usr/lib/systemd /lib/systemd - COPY --from=openjdk-install /tmp/OpenJDK11U.tar.gz /tmp/OpenJDK11U.tar.gz - RUN set -xe; \ - mkdir -p /usr/local/java-11-openjdk && \ - tar -xf /tmp/OpenJDK11U.tar.gz -C /usr/local/java-11-openjdk --strip-components=1 - - ENV JAVA_HOME /usr/local/java-11-openjdk/ +COPY --from=openjdk-install /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk +ENV JAVA_HOME /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ COPY --from=cmake-install-recent /cmake.sh /cmake.sh RUN set -x; bash /cmake.sh --skip-license --prefix=/usr/local @@ -782,8 +795,9 @@ COPY --from=sles12-build /google-cloud-ops-agent*.rpm / # ====================================== FROM opensuse/leap:15.1 AS sles15-build-base +ARG OPENJDK_MAJOR_VERSION -RUN set -x; zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros java-11-openjdk-devel unzip zip +RUN set -x; zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros unzip zip # Add agent-vendor.repo to install >3.4 bison RUN echo $'[google-cloud-monitoring-sles15-vendor] \n\ name=google-cloud-monitoring-sles15-vendor \n\ @@ -798,6 +812,8 @@ RUN set -x; zypper -n install git systemd autoconf automake flex libtool libcurl zypper -n install bison>3.4 && \ # Allow fluent-bit to find systemd ln -fs /usr/lib/systemd /lib/systemd +COPY --from=openjdk-install /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk +ENV JAVA_HOME /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ COPY --from=cmake-install-recent /cmake.sh /cmake.sh RUN set -x; bash /cmake.sh --skip-license --prefix=/usr/local @@ -892,12 +908,13 @@ COPY --from=sles15-build /google-cloud-ops-agent*.rpm / # ====================================== FROM ubuntu:focal AS focal-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip SHELL ["/bin/bash", "-c"] @@ -989,12 +1006,13 @@ COPY --from=focal-build /google-cloud-ops-agent*.deb / # ====================================== FROM ubuntu:jammy AS jammy-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip SHELL ["/bin/bash", "-c"] @@ -1086,12 +1104,13 @@ COPY --from=jammy-build /google-cloud-ops-agent*.deb / # ====================================== FROM ubuntu:lunar AS lunar-build-base +ARG OPENJDK_MAJOR_VERSION RUN set -x; apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip debhelper + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip debhelper SHELL ["/bin/bash", "-c"] diff --git a/Dockerfile.windows b/Dockerfile.windows index 732b3fdaa8..efdd4a497a 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -115,15 +115,15 @@ RUN cmake --build . --config Release; ` # a required build flag to support jmx receiver in operations-collector ############################################################################### -ADD https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_windows_hotspot_11.0.12_7.msi /local/jdk-11-windows-x64.msi -RUN Start-Process -Wait 'msiexec' -ArgumentList '/i C:\local\jdk-11-windows-x64.msi ADDLOCAL=FeatureMain INSTALLDIR=C:\Java\ /log c:\java_install64.log' +ADD https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8%2B7/OpenJDK17U-jdk_x64_windows_hotspot_17.0.8_7.msi /local/jdk-17-windows-x64.msi +RUN Start-Process -Wait 'msiexec' -ArgumentList '/i C:\local\jdk-17-windows-x64.msi ADDLOCAL=FeatureMain INSTALLDIR=C:\Java\ /log c:\java_install64.log' COPY submodules/opentelemetry-java-contrib /work/submodules/opentelemetry-java-contrib WORKDIR /work/submodules/opentelemetry-java-contrib RUN ./gradlew --no-daemon :jmx-metrics:build; ` - Copy-Item -Path jmx-metrics/build/libs/opentelemetry-jmx-metrics-*-alpha.jar -Destination /work/out/bin/opentelemetry-java-contrib-jmx-metrics.jar; + Copy-Item -Path jmx-metrics/build/libs/opentelemetry-jmx-metrics-*-alpha-SNAPSHOT.jar -Destination /work/out/bin/opentelemetry-java-contrib-jmx-metrics.jar; ############################################################################### # Build OT collector diff --git a/builds/otel.sh b/builds/otel.sh index 271f226f5d..2d59b5d20f 100755 --- a/builds/otel.sh +++ b/builds/otel.sh @@ -6,7 +6,7 @@ DESTDIR="${DESTDIR}${otel_dir}" cd submodules/opentelemetry-java-contrib mkdir -p "$DESTDIR" ./gradlew --no-daemon :jmx-metrics:build -cp jmx-metrics/build/libs/opentelemetry-jmx-metrics-*-alpha.jar "$DESTDIR/opentelemetry-java-contrib-jmx-metrics.jar" +cp jmx-metrics/build/libs/opentelemetry-jmx-metrics-*-alpha-SNAPSHOT.jar "$DESTDIR/opentelemetry-java-contrib-jmx-metrics.jar" # Rename LICENSE file because it causes issues with file hash consistency due to an unknown # issue with the debuild/rpmbuild processes. Something is unzipping the jar in a case-insensitive diff --git a/dockerfiles/compile.go b/dockerfiles/compile.go index 364d479a93..3c4faf200d 100644 --- a/dockerfiles/compile.go +++ b/dockerfiles/compile.go @@ -61,6 +61,14 @@ COPY --from=cmake-install-recent /cmake.sh /cmake.sh RUN set -x; bash /cmake.sh --skip-license --prefix=/usr/local ` +// installJava is used on platforms where the default package manager +// does not provide an implementation of Java of a sufficient version as +// required by the JMX metrics gatherer build. +// The openjdk-install layer is defined in template-header. +const installJava = ` +COPY --from=openjdk-install /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk +ENV JAVA_HOME /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/` + var dockerfileArguments = []templateArguments{ { from_image: "centos:7", @@ -68,9 +76,8 @@ var dockerfileArguments = []templateArguments{ install_packages: `RUN set -x; yum -y update && \ yum -y install git systemd \ autoconf libtool libcurl-devel libtool-ltdl-devel openssl-devel yajl-devel \ - gcc gcc-c++ make bison flex file systemd-devel zlib-devel gtest-devel rpm-build java-11-openjdk-devel \ - expect rpm-sign zip - ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk/` + installCMake, + gcc gcc-c++ make bison flex file systemd-devel zlib-devel gtest-devel rpm-build \ + expect rpm-sign zip` + installJava + installCMake, package_build: "RUN ./pkg/rpm/build.sh", tar_distro_name: "centos-7", package_extension: "rpm", @@ -83,7 +90,7 @@ var dockerfileArguments = []templateArguments{ yum config-manager --set-enabled powertools && \ yum -y install git systemd \ autoconf libtool libcurl-devel libtool-ltdl-devel openssl-devel yajl-devel \ - gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros java-11-openjdk-devel \ + gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros java-${OPENJDK_MAJOR_VERSION}-openjdk-devel \ expect rpm-sign zip tzdata-java`, package_build: "RUN ./pkg/rpm/build.sh", tar_distro_name: "centos-8", @@ -98,10 +105,10 @@ var dockerfileArguments = []templateArguments{ dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ dnf -y install git systemd \ autoconf libtool libcurl-devel libtool-ltdl-devel openssl-devel yajl-devel \ - gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros java-11-openjdk-devel \ + gcc gcc-c++ make cmake bison flex file systemd-devel zlib-devel gtest-devel rpm-build systemd-rpm-macros java-${OPENJDK_MAJOR_VERSION}-openjdk-devel \ expect rpm-sign zip tzdata-java - ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk/`, + ENV JAVA_HOME /usr/lib/jvm/java-${OPENJDK_MAJOR_VERSION}-openjdk/`, package_build: "RUN ./pkg/rpm/build.sh", tar_distro_name: "rockylinux-9", package_extension: "rpm", @@ -113,7 +120,7 @@ var dockerfileArguments = []templateArguments{ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-17-jdk zip`, + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip`, package_build: "RUN ./pkg/deb/build.sh", tar_distro_name: "debian-bookworm", package_extension: "deb", @@ -125,7 +132,7 @@ var dockerfileArguments = []templateArguments{ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip`, + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip`, package_build: "RUN ./pkg/deb/build.sh", tar_distro_name: "debian-bullseye", package_extension: "deb", @@ -137,7 +144,7 @@ var dockerfileArguments = []templateArguments{ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip`, + devscripts cdbs pkg-config zip` + installJava, package_build: "RUN ./pkg/deb/build.sh", tar_distro_name: "debian-buster", package_extension: "deb", @@ -163,13 +170,7 @@ var dockerfileArguments = []templateArguments{ # If this bug happens to trigger in the future, adding a "zypper -n download" of a subset of the packages can avoid the segfault. zypper -n install bison>3.4 && \ # Allow fluent-bit to find systemd - ln -fs /usr/lib/systemd /lib/systemd - COPY --from=openjdk-install /tmp/OpenJDK11U.tar.gz /tmp/OpenJDK11U.tar.gz - RUN set -xe; \ - mkdir -p /usr/local/java-11-openjdk && \ - tar -xf /tmp/OpenJDK11U.tar.gz -C /usr/local/java-11-openjdk --strip-components=1 - - ENV JAVA_HOME /usr/local/java-11-openjdk/` + installCMake, + ln -fs /usr/lib/systemd /lib/systemd` + installJava + installCMake, package_build: "RUN ./pkg/rpm/build.sh", tar_distro_name: "sles-12", package_extension: "rpm", @@ -178,7 +179,7 @@ var dockerfileArguments = []templateArguments{ from_image: "opensuse/leap:15.1", target_name: "sles15", // TODO: Add ARM support to agent-vendor.repo. - install_packages: `RUN set -x; zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros java-11-openjdk-devel unzip zip + install_packages: `RUN set -x; zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros unzip zip # Add agent-vendor.repo to install >3.4 bison RUN echo $'[google-cloud-monitoring-sles15-vendor] \n\ name=google-cloud-monitoring-sles15-vendor \n\ @@ -192,7 +193,7 @@ var dockerfileArguments = []templateArguments{ zypper -n update && \ zypper -n install bison>3.4 && \ # Allow fluent-bit to find systemd - ln -fs /usr/lib/systemd /lib/systemd` + installCMake, + ln -fs /usr/lib/systemd /lib/systemd` + installJava + installCMake, package_build: "RUN ./pkg/rpm/build.sh", tar_distro_name: "sles-15", package_extension: "rpm", @@ -204,7 +205,7 @@ var dockerfileArguments = []templateArguments{ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip`, + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip`, package_build: "RUN ./pkg/deb/build.sh", tar_distro_name: "ubuntu-focal", package_extension: "deb", @@ -216,7 +217,7 @@ var dockerfileArguments = []templateArguments{ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip`, + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip`, package_build: "RUN ./pkg/deb/build.sh", tar_distro_name: "ubuntu-jammy", package_extension: "deb", @@ -228,7 +229,7 @@ var dockerfileArguments = []templateArguments{ DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \ autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \ build-essential cmake bison flex file libsystemd-dev \ - devscripts cdbs pkg-config openjdk-11-jdk zip debhelper`, + devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip debhelper`, package_build: "RUN ./pkg/deb/build.sh", tar_distro_name: "ubuntu-lunar", package_extension: "deb", diff --git a/dockerfiles/template b/dockerfiles/template index dfc06f84c1..dcbd9d2f20 100644 --- a/dockerfiles/template +++ b/dockerfiles/template @@ -3,6 +3,7 @@ # ====================================== FROM {from_image} AS {target_name}-build-base +ARG OPENJDK_MAJOR_VERSION {install_packages} diff --git a/dockerfiles/template-header b/dockerfiles/template-header index 29f5e406a0..96474b4aca 100644 --- a/dockerfiles/template-header +++ b/dockerfiles/template-header @@ -21,8 +21,9 @@ ARG CMAKE_VERSION=3.25.2 -ARG OPENJDK_VERSION=11.0.13 -ARG OPENJDK_VERSION_SUFFIX=8 +ARG OPENJDK_MAJOR_VERSION=17 +ARG OPENJDK_FULL_VERSION=17.0.8 +ARG OPENJDK_VERSION_SUFFIX=7 # Manually prepare a recent enough version of CMake. # This should be used on platforms where the default package manager @@ -47,20 +48,26 @@ RUN set -xe; (echo "$hash /cmake.sh" | sha256sum -c) # Manually prepare OpenJDK for the current architecture. FROM alpine:latest AS openjdk-amd64 -ARG OPENJDK_VERSION +ARG OPENJDK_MAJOR_VERSION +ARG OPENJDK_FULL_VERSION ARG OPENJDK_VERSION_SUFFIX -ENV hash=3b1c0c34be4c894e64135a454f2d5aaa4bd10aea04ec2fa0c0efe6bb26528e30 -ADD https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${OPENJDK_VERSION}%2B${OPENJDK_VERSION_SUFFIX}/OpenJDK11U-jdk_x64_linux_hotspot_${OPENJDK_VERSION}_${OPENJDK_VERSION_SUFFIX}.tar.gz \ - /tmp/OpenJDK11U.tar.gz +ENV hash=aa5fc7d388fe544e5d85902e68399d5299e931f9b280d358a3cbee218d6017b0 +ADD https://github.com/adoptium/temurin${OPENJDK_MAJOR_VERSION}-binaries/releases/download/jdk-${OPENJDK_FULL_VERSION}%2B${OPENJDK_VERSION_SUFFIX}/OpenJDK${OPENJDK_MAJOR_VERSION}U-jdk_x64_linux_hotspot_${OPENJDK_FULL_VERSION}_${OPENJDK_VERSION_SUFFIX}.tar.gz \ + /tmp/OpenJDK${OPENJDK_MAJOR_VERSION}U.tar.gz FROM alpine:latest AS openjdk-arm64 -ARG OPENJDK_VERSION +ARG OPENJDK_MAJOR_VERSION +ARG OPENJDK_FULL_VERSION ARG OPENJDK_VERSION_SUFFIX -ENV hash=a77013bff10a5e9c59159231dd5c4bd071fc4c24beed42bd49b82803ba9506ef -ADD https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${OPENJDK_VERSION}%2B${OPENJDK_VERSION_SUFFIX}/OpenJDK11U-jdk_aarch64_linux_hotspot_${OPENJDK_VERSION}_${OPENJDK_VERSION_SUFFIX}.tar.gz \ - /tmp/OpenJDK11U.tar.gz +ENV hash=c43688163cfdcb1a6e6fe202cc06a51891df746b954c55dbd01430e7d7326d00 +ADD https://github.com/adoptium/temurin${OPENJDK_MAJOR_VERSION}-binaries/releases/download/jdk-${OPENJDK_FULL_VERSION}%2B${OPENJDK_VERSION_SUFFIX}/OpenJDK${OPENJDK_MAJOR_VERSION}U-jdk_aarch64_linux_hotspot_${OPENJDK_FULL_VERSION}_${OPENJDK_VERSION_SUFFIX}.tar.gz \ + /tmp/OpenJDK${OPENJDK_MAJOR_VERSION}U.tar.gz FROM openjdk-${BUILDARCH} as openjdk-install -RUN set -xe; (echo "$hash /tmp/OpenJDK11U.tar.gz" | sha256sum -c) +ARG OPENJDK_MAJOR_VERSION +RUN set -xe; (echo "$hash /tmp/OpenJDK${OPENJDK_MAJOR_VERSION}U.tar.gz" | sha256sum -c) +RUN set -xe; \ + mkdir -p /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk && \ + tar -xf /tmp/OpenJDK${OPENJDK_MAJOR_VERSION}U.tar.gz -C /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk --strip-components=1 diff --git a/submodules/opentelemetry-java-contrib b/submodules/opentelemetry-java-contrib index fb48ce68be..47f05dee61 160000 --- a/submodules/opentelemetry-java-contrib +++ b/submodules/opentelemetry-java-contrib @@ -1 +1 @@ -Subproject commit fb48ce68be4ab56f94624d79e9c9b0d2241db179 +Subproject commit 47f05dee61af2b912489932096dcaea12c054f15