From 30d88f9c2478592b922319afc178ff6c35521643 Mon Sep 17 00:00:00 2001 From: David Venable Date: Fri, 17 Nov 2023 12:34:51 -0800 Subject: [PATCH] Use Amazon Linux 2023 as the base image for the Data Prepper Docker image. This install Temurin for the Amazon Linux 2 distribution. Resolves #3505. (#3671) Signed-off-by: David Venable --- release/docker/Dockerfile | 13 +++++++++---- release/docker/adoptium.repo | 6 ++++++ release/docker/build.gradle | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 release/docker/adoptium.repo diff --git a/release/docker/Dockerfile b/release/docker/Dockerfile index c4c138c0a6..dcc586dc52 100644 --- a/release/docker/Dockerfile +++ b/release/docker/Dockerfile @@ -1,4 +1,5 @@ -FROM eclipse-temurin:17-jre-jammy +FROM public.ecr.aws/amazonlinux/amazonlinux:2023 + ARG PIPELINE_FILEPATH ARG CONFIG_FILEPATH ARG ARCHIVE_FILE @@ -9,9 +10,13 @@ ENV ENV_CONFIG_FILEPATH=$CONFIG_FILEPATH ENV ENV_PIPELINE_FILEPATH=$PIPELINE_FILEPATH # Update all packages -RUN apt -y update -RUN apt -y install bash bc -RUN apt -y full-upgrade +RUN dnf -y update +RUN dnf -y install bash bc +RUN dnf -y upgrade + +# Setup the Adoptium package repo and install Temurin Java +ADD adoptium.repo /etc/yum.repos.d/adoptium.repo +RUN dnf -y install temurin-17-jdk RUN mkdir -p /var/log/data-prepper ADD $ARCHIVE_FILE /usr/share diff --git a/release/docker/adoptium.repo b/release/docker/adoptium.repo new file mode 100644 index 0000000000..c54ffe9b4a --- /dev/null +++ b/release/docker/adoptium.repo @@ -0,0 +1,6 @@ +[adoptium] +name=Adoptium +baseurl=https://packages.adoptium.net/artifactory/rpm/amazonlinux/2/$basearch +enabled=1 +gpgcheck=1 +gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public diff --git a/release/docker/build.gradle b/release/docker/build.gradle index be96705aaf..1816364b6c 100644 --- a/release/docker/build.gradle +++ b/release/docker/build.gradle @@ -12,6 +12,7 @@ docker { tag "${project.rootProject.name}", "${project.version}" files project(':release:archives:linux').tasks.getByName('linuxx64DistTar').archivePath files "${project.projectDir}/config/default-data-prepper-config.yaml", "${project.projectDir}/config/default-keystore.p12" + files 'adoptium.repo' buildArgs(['ARCHIVE_FILE' : project(':release:archives:linux').tasks.getByName('linuxx64DistTar').archiveFileName.get(), 'ARCHIVE_FILE_UNPACKED' : project(':release:archives:linux').tasks.getByName('linuxx64DistTar').archiveFileName.get().replace('.tar.gz', ''), 'CONFIG_FILEPATH' : '/usr/share/data-prepper/config/data-prepper-config.yaml',