diff --git a/core/docker/Dockerfile b/core/docker/Dockerfile index e089bbd5628c..0bde07dfeaf5 100644 --- a/core/docker/Dockerfile +++ b/core/docker/Dockerfile @@ -11,16 +11,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM registry.access.redhat.com/ubi8/ubi +ARG AZUL_DOCKER_TAG +FROM azul/zulu-openjdk:$AZUL_DOCKER_TAG ENV JAVA_HOME /usr/lib/jvm/zulu17 + RUN \ set -xeu && \ - yum -y -q install https://cdn.azul.com/zulu/bin/zulu-repo-1.0.0-1.noarch.rpm && \ - yum -y -q install python3 zulu17-jdk less && \ - yum -q clean all && \ - rm -rf /var/cache/yum && \ - alternatives --set python /usr/bin/python3 && \ + apt-get update -q && \ + apt-get install -y -q less python3 curl && \ + rm -rf /var/lib/apt/lists/* && \ groupadd trino --gid 1000 && \ useradd trino --uid 1000 --gid 1000 --create-home && \ mkdir -p /usr/lib/trino /data/trino && \ diff --git a/core/docker/build.sh b/core/docker/build.sh index 859fd3ebc80e..b267f4dbfd79 100755 --- a/core/docker/build.sh +++ b/core/docker/build.sh @@ -10,13 +10,15 @@ Builds the Trino Docker image -h Display help -a Build the specified comma-separated architectures, defaults to amd64,arm64 -r Build the specified Trino release version, downloads all required artifacts +-j Azul JDK version as published in https://hub.docker.com/r/azul/zulu-openjdk EOF } ARCHITECTURES=(amd64 arm64) TRINO_VERSION= +AZUL_DOCKER_TAG="17.0.4" -while getopts ":a:h:r:" o; do +while getopts ":a:h:r:j:" o; do case "${o}" in a) IFS=, read -ra ARCHITECTURES <<< "$OPTARG" @@ -24,6 +26,9 @@ while getopts ":a:h:r:" o; do r) TRINO_VERSION=${OPTARG} ;; + j) + AZUL_DOCKER_TAG=${OPTARG} + ;; h) usage exit 0 @@ -70,14 +75,15 @@ cp -R default "${WORK_DIR}/" TAG_PREFIX="trino:${TRINO_VERSION}" for arch in "${ARCHITECTURES[@]}"; do - echo "๐Ÿซ™ Building the image for $arch" + echo "๐Ÿซ™ Building the image for $arch using azul/zulu-openjdk:${AZUL_DOCKER_TAG} as a base" docker build \ "${WORK_DIR}" \ --pull \ --platform "linux/$arch" \ -f Dockerfile \ -t "${TAG_PREFIX}-$arch" \ - --build-arg "TRINO_VERSION=${TRINO_VERSION}" + --build-arg "TRINO_VERSION=${TRINO_VERSION}" \ + --build-arg "AZUL_DOCKER_TAG=${AZUL_DOCKER_TAG}" done echo "๐Ÿงน Cleaning up the build context directory"