2016-09-09 19:52:54 -04:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
# or more contributor license agreements. See the NOTICE file
|
|
|
|
# distributed with this work for additional information
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2020-02-19 19:10:57 -05:00
|
|
|
#
|
|
|
|
# Dockerfile used as the build and test environment, amenable to Yetus.
|
|
|
|
#
|
|
|
|
# Built in multiple stages so as to avoid re-downloading large binaries when
|
|
|
|
# tweaking unrelated aspects of the image.
|
2019-09-14 15:03:02 -04:00
|
|
|
|
2020-02-19 19:10:57 -05:00
|
|
|
# start with a minimal image into which we can download remote tarballs
|
2023-02-02 22:24:12 -05:00
|
|
|
FROM ubuntu:22.04 AS base_image
|
2020-02-19 19:10:57 -05:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get -qq install --no-install-recommends -y \
|
2022-10-31 23:30:45 -04:00
|
|
|
ca-certificates=20211016 \
|
|
|
|
curl='7.81.0-*' \
|
|
|
|
locales='2.35-*' \
|
2020-03-12 19:11:53 -04:00
|
|
|
##
|
|
|
|
# install dependencies from system packages.
|
|
|
|
# be careful not to install any system packages (i.e., findbugs) that will
|
|
|
|
# pull in the default-jre.
|
|
|
|
#
|
|
|
|
# bring the base image into conformance with the expectations imposed by
|
|
|
|
# Yetus and our personality file of what a build environment looks like.
|
2022-10-31 23:30:45 -04:00
|
|
|
bash='5.1-*' \
|
|
|
|
build-essential=12.9ubuntu3 \
|
|
|
|
diffutils='1:3.8-*' \
|
|
|
|
git='1:2.34.1-*' \
|
|
|
|
rsync='3.2.3-*' \
|
|
|
|
tar='1.34+dfsg-*' \
|
|
|
|
wget='1.21.2-*' \
|
2020-03-12 19:11:53 -04:00
|
|
|
# install the dependencies required in order to enable the sundry precommit
|
|
|
|
# checks/features provided by Yetus plugins.
|
2022-10-31 23:30:45 -04:00
|
|
|
bats='1.2.1-*' \
|
|
|
|
libperl-critic-perl='1.140-*' \
|
|
|
|
python3='3.10.6-*' \
|
|
|
|
python3-pip='22.0.2+dfsg-*' \
|
|
|
|
python3-setuptools='59.6.0-*' \
|
|
|
|
ruby=1:3.0* \
|
|
|
|
ruby-dev=1:3.0* \
|
|
|
|
shellcheck='0.8.0-*' \
|
2020-03-12 19:11:53 -04:00
|
|
|
&& \
|
|
|
|
apt-get clean && \
|
2022-11-03 06:06:10 -04:00
|
|
|
rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& \
|
|
|
|
python3 -mpip install --upgrade pip && \
|
|
|
|
python3 -mpip install pylint==2.15.5 \
|
|
|
|
&& \
|
|
|
|
gem install --no-document \
|
|
|
|
rake:13.0.3 \
|
|
|
|
rubocop:1.37.1 \
|
|
|
|
ruby-lint:2.3.1 \
|
|
|
|
&& \
|
|
|
|
locale-gen en_US.UTF-8
|
2020-02-19 19:10:57 -05:00
|
|
|
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
|
|
|
|
|
|
|
|
##
|
|
|
|
# download sundry dependencies
|
|
|
|
#
|
|
|
|
|
2023-02-02 22:24:12 -05:00
|
|
|
FROM base_image AS spotbugs_download_image
|
2022-10-28 06:40:40 -04:00
|
|
|
ENV SPOTBUGS_VERSION '4.7.3'
|
2020-03-11 22:18:09 -04:00
|
|
|
ENV SPOTBUGS_URL "https://repo.maven.apache.org/maven2/com/github/spotbugs/spotbugs/${SPOTBUGS_VERSION}/spotbugs-${SPOTBUGS_VERSION}.tgz"
|
2022-10-28 06:40:40 -04:00
|
|
|
ENV SPOTBUGS_SHA512 '09a9fe0e5a6ec8e9d6d116c361b5c34c9d0560c0271241f02fadee911952adfcd69dc184f6de1cc4d4a8fe2c84c162689ea9a691dcae0779935eedf390fcc4ad'
|
2020-02-19 19:10:57 -05:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
2020-03-11 22:18:09 -04:00
|
|
|
RUN curl --location --fail --silent --show-error --output /tmp/spotbugs.tgz "${SPOTBUGS_URL}" && \
|
2022-09-14 11:27:51 -04:00
|
|
|
echo "${SPOTBUGS_SHA512} */tmp/spotbugs.tgz" | sha512sum -c -
|
2020-02-19 19:10:57 -05:00
|
|
|
|
2023-02-02 22:24:12 -05:00
|
|
|
FROM base_image AS hadolint_download_image
|
2022-10-31 23:30:45 -04:00
|
|
|
ENV HADOLINT_VERSION '2.10.0'
|
2020-02-19 19:10:57 -05:00
|
|
|
ENV HADOLINT_URL "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-Linux-x86_64"
|
2022-10-31 23:30:45 -04:00
|
|
|
ENV HADOLINT_SHA512 '4816c95243bedf15476d2225f487fc17465495fb2031e1a4797d82a26db83a1edb63e4fed084b80cef17d5eb67eb45508caadaf7cd0252fb061187113991a338'
|
2020-02-19 19:10:57 -05:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN curl --location --fail --silent --show-error --output /tmp/hadolint "${HADOLINT_URL}" && \
|
2022-10-31 23:30:45 -04:00
|
|
|
echo "${HADOLINT_SHA512} */tmp/hadolint" | sha512sum -c -
|
2020-02-19 19:10:57 -05:00
|
|
|
|
2023-02-02 22:24:12 -05:00
|
|
|
FROM base_image AS maven_download_image
|
2022-10-31 23:30:45 -04:00
|
|
|
ENV MAVEN_VERSION='3.8.6'
|
2020-02-19 19:10:57 -05:00
|
|
|
ENV MAVEN_URL "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
|
2022-10-31 23:30:45 -04:00
|
|
|
ENV MAVEN_SHA512 'f790857f3b1f90ae8d16281f902c689e4f136ebe584aba45e4b1fa66c80cba826d3e0e52fdd04ed44b4c66f6d3fe3584a057c26dfcac544a60b301e6d0f91c26'
|
2020-02-19 19:10:57 -05:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN curl --location --fail --silent --show-error --output /tmp/maven.tar.gz "${MAVEN_URL}" && \
|
2020-04-05 15:53:44 -04:00
|
|
|
echo "${MAVEN_SHA512} */tmp/maven.tar.gz" | sha512sum -c -
|
2020-02-19 19:10:57 -05:00
|
|
|
|
2023-02-02 22:24:12 -05:00
|
|
|
FROM base_image AS openjdk8_download_image
|
2022-10-31 23:30:45 -04:00
|
|
|
ENV OPENJDK8_URL 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u352-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u352b08.tar.gz'
|
|
|
|
ENV OPENJDK8_SHA256 '1633bd7590cb1cd72f5a1378ae8294451028b274d798e2a4ac672059a2f00fee'
|
2020-02-19 19:10:57 -05:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN curl --location --fail --silent --show-error --output /tmp/adoptopenjdk8.tar.gz "${OPENJDK8_URL}" && \
|
|
|
|
echo "${OPENJDK8_SHA256} */tmp/adoptopenjdk8.tar.gz" | sha256sum -c -
|
|
|
|
|
2023-02-02 22:24:12 -05:00
|
|
|
FROM base_image AS openjdk11_download_image
|
2022-10-31 23:30:45 -04:00
|
|
|
ENV OPENJDK11_URL 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.17%2B8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.17_8.tar.gz'
|
|
|
|
ENV OPENJDK11_SHA256 'b8d46ed08ef4859476fe6421a7690d899ed83dce63f13fd894f994043177ef3c'
|
2020-02-19 19:10:57 -05:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN curl --location --fail --silent --show-error --output /tmp/adoptopenjdk11.tar.gz "${OPENJDK11_URL}" && \
|
|
|
|
echo "${OPENJDK11_SHA256} */tmp/adoptopenjdk11.tar.gz" | sha256sum -c -
|
|
|
|
|
|
|
|
##
|
|
|
|
# build the final image
|
|
|
|
#
|
|
|
|
|
2023-02-02 22:24:12 -05:00
|
|
|
FROM base_image
|
2020-02-19 19:10:57 -05:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
|
|
|
|
# hadolint ignore=DL3010
|
2023-02-02 22:24:12 -05:00
|
|
|
COPY --from=spotbugs_download_image /tmp/spotbugs.tgz /tmp/spotbugs.tgz
|
2020-03-11 22:18:09 -04:00
|
|
|
RUN tar xzf /tmp/spotbugs.tgz -C /opt && \
|
|
|
|
ln -s "/opt/$(tar -tf /tmp/spotbugs.tgz | head -n1 | cut -d/ -f1)" /opt/spotbugs && \
|
2021-03-10 01:52:56 -05:00
|
|
|
chmod -R a+x /opt/spotbugs/bin/* && \
|
2020-03-11 22:18:09 -04:00
|
|
|
rm /tmp/spotbugs.tgz
|
2020-02-19 19:10:57 -05:00
|
|
|
|
2023-02-02 22:24:12 -05:00
|
|
|
COPY --from=hadolint_download_image /tmp/hadolint /tmp/hadolint
|
2020-02-19 19:10:57 -05:00
|
|
|
RUN mv /tmp/hadolint /usr/local/bin && \
|
|
|
|
chmod a+x /usr/local/bin/hadolint
|
|
|
|
|
|
|
|
# hadolint ignore=DL3010
|
2023-02-02 22:24:12 -05:00
|
|
|
COPY --from=maven_download_image /tmp/maven.tar.gz /tmp/maven.tar.gz
|
2020-02-19 19:10:57 -05:00
|
|
|
RUN tar xzf /tmp/maven.tar.gz -C /opt && \
|
|
|
|
ln -s "/opt/$(dirname "$(tar -tf /tmp/maven.tar.gz | head -n1)")" /opt/maven && \
|
|
|
|
rm /tmp/maven.tar.gz
|
|
|
|
|
|
|
|
##
|
|
|
|
# ensure JVMs are available under `/usr/lib/jvm` and prefix each installation
|
|
|
|
# as `java-` so as to conform with Yetus's assumptions.
|
|
|
|
#
|
2020-03-06 12:18:12 -05:00
|
|
|
# when updating java or maven versions here, consider also updating
|
|
|
|
# `dev-support/hbase_docker/Dockerfile` as well.
|
|
|
|
#
|
2020-02-19 19:10:57 -05:00
|
|
|
|
|
|
|
# hadolint ignore=DL3010
|
2023-02-02 22:24:12 -05:00
|
|
|
COPY --from=openjdk8_download_image /tmp/adoptopenjdk8.tar.gz /tmp/adoptopenjdk8.tar.gz
|
2020-02-19 19:10:57 -05:00
|
|
|
RUN mkdir -p /usr/lib/jvm && \
|
|
|
|
tar xzf /tmp/adoptopenjdk8.tar.gz -C /usr/lib/jvm && \
|
|
|
|
ln -s "/usr/lib/jvm/$(basename "$(tar -tf /tmp/adoptopenjdk8.tar.gz | head -n1)")" /usr/lib/jvm/java-8-adoptopenjdk && \
|
|
|
|
ln -s /usr/lib/jvm/java-8-adoptopenjdk /usr/lib/jvm/java-8 && \
|
|
|
|
rm /tmp/adoptopenjdk8.tar.gz
|
|
|
|
|
|
|
|
# hadolint ignore=DL3010
|
2023-02-02 22:24:12 -05:00
|
|
|
COPY --from=openjdk11_download_image /tmp/adoptopenjdk11.tar.gz /tmp/adoptopenjdk11.tar.gz
|
2020-02-19 19:10:57 -05:00
|
|
|
RUN mkdir -p /usr/lib/jvm && \
|
|
|
|
tar xzf /tmp/adoptopenjdk11.tar.gz -C /usr/lib/jvm && \
|
|
|
|
ln -s "/usr/lib/jvm/$(basename "$(tar -tf /tmp/adoptopenjdk11.tar.gz | head -n1)")" /usr/lib/jvm/java-11-adoptopenjdk && \
|
|
|
|
ln -s /usr/lib/jvm/java-11-adoptopenjdk /usr/lib/jvm/java-11 && \
|
|
|
|
rm /tmp/adoptopenjdk11.tar.gz
|
|
|
|
|
|
|
|
# configure default environment for Yetus. Yetus in dockermode seems to require
|
|
|
|
# these values to be specified here; the various --foo-path flags do not
|
|
|
|
# propigate as expected, while these are honored.
|
|
|
|
# TODO (nd): is this really true? investigate and file a ticket.
|
2020-03-11 22:18:09 -04:00
|
|
|
ENV SPOTBUGS_HOME '/opt/spotbugs'
|
2020-02-19 19:10:57 -05:00
|
|
|
ENV MAVEN_HOME '/opt/maven'
|
2020-04-08 13:51:03 -04:00
|
|
|
ENV MAVEN_OPTS '-Xmx3.6G'
|
2016-09-09 19:52:54 -04:00
|
|
|
|
2020-02-19 19:10:57 -05:00
|
|
|
CMD ["/bin/bash"]
|
2017-10-24 15:50:23 -04:00
|
|
|
|
2016-09-09 19:52:54 -04:00
|
|
|
###
|
|
|
|
# Everything past this point is either not needed for testing or breaks Yetus.
|
|
|
|
# So tell Yetus not to read the rest of the file:
|
|
|
|
# YETUS CUT HERE
|
|
|
|
###
|