Skip to content

Commit 92bd747

Browse files
committed
HADOOP-19709. [JDK17] Add debian:12 and debian:13 as a build platform with JDK-17 as default
This commit introduces support for Debian 12 (Bookworm) and Debian 13 (Trixie) as build platforms, following the approach established for Ubuntu 24. Key changes include: - Creation of `Dockerfile_debian_12` and `Dockerfile_debian_13` based on `Dockerfile_ubuntu_24`, with appropriate base images and package resolver arguments. - Updates to `dev-support/docker/pkg-resolver/packages.json` to include package definitions for `debian:12` and `debian:13`. - Addition of `debian:12` and `debian:13` to `dev-support/docker/pkg-resolver/platforms.json`. - Modification of `BUILDING.txt` to list `debian_12` and `debian_13` as supported OS platforms.
1 parent 1566613 commit 92bd747

File tree

5 files changed

+353
-3
lines changed

5 files changed

+353
-3
lines changed

BUILDING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ On Linux / Mac:
3131

3232
$ ./start-build-env.sh [OS platform]
3333

34-
- [OS Platform] One of [rockylinux_8, debian_11, ubuntu_20, ubuntu_24, windows_10].
34+
- [OS Platform] One of [rockylinux_8, debian_11, debian_12, debian_13, ubuntu_20, ubuntu_24, windows_10].
3535
Default is 'ubuntu_20'.
3636
Note: Currently only default ('ubuntu_20') is supported on arm machine
3737

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Dockerfile for installing the necessary dependencies for building Hadoop.
18+
# See BUILDING.txt.
19+
20+
FROM debian:12
21+
22+
WORKDIR /root
23+
24+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
25+
26+
#####
27+
# Disable suggests/recommends
28+
#####
29+
RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/10disableextras
30+
RUN echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/10disableextras
31+
32+
ENV DEBIAN_FRONTEND=noninteractive
33+
ENV DEBCONF_TERSE=true
34+
35+
######
36+
# Platform package dependency resolver
37+
######
38+
COPY pkg-resolver pkg-resolver
39+
RUN chmod a+x pkg-resolver/*.sh pkg-resolver/*.py \
40+
&& chmod a+r pkg-resolver/*.json
41+
42+
######
43+
# Install packages from apt
44+
######
45+
# hadolint ignore=DL3008,SC2046
46+
RUN apt-get -q update
47+
RUN apt-get -q install -y --no-install-recommends wget apt-transport-https gpg gpg-agent gawk ca-certificates
48+
RUN apt-get -q install -y --no-install-recommends python3
49+
RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" > /etc/apt/sources.list.d/adoptium.list
50+
RUN wget -q -O - https://packages.adoptium.net/artifactory/api/gpg/key/public > /etc/apt/trusted.gpg.d/adoptium.asc
51+
RUN apt-get -q update
52+
RUN apt-get -q install -y --no-install-recommends $(pkg-resolver/resolve.py debian:12)
53+
RUN apt-get clean
54+
RUN update-java-alternatives -s temurin-17-jdk-amd64
55+
RUN rm -rf /var/lib/apt/lists/*
56+
57+
# Enable the locale
58+
RUN sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen
59+
RUN locale-gen
60+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
61+
ENV PYTHONIOENCODING=utf-8
62+
63+
######
64+
# Set env vars required to build Hadoop
65+
######
66+
ENV MAVEN_HOME=/opt/maven
67+
ENV PATH="${PATH}:${MAVEN_HOME}/bin"
68+
# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
69+
ENV JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64
70+
71+
#######
72+
# Set env vars for SpotBugs 4.2.2
73+
#######
74+
ENV SPOTBUGS_HOME=/opt/spotbugs
75+
76+
#######
77+
# Set env vars for Google Protobuf 3.21.12
78+
#######
79+
ENV PROTOBUF_HOME=/opt/protobuf
80+
ENV PATH="${PATH}:/opt/protobuf/bin"
81+
82+
###
83+
# Avoid out of memory errors in builds
84+
###
85+
ENV MAVEN_OPTS="-Xms256m -Xmx3072m"
86+
87+
# Skip gpg verification when downloading Yetus via yetus-wrapper
88+
ENV HADOOP_SKIP_YETUS_VERIFICATION=true
89+
90+
####
91+
# Install packages
92+
####
93+
RUN pkg-resolver/install-maven.sh debian:12
94+
RUN pkg-resolver/install-cmake.sh debian:12
95+
RUN pkg-resolver/install-spotbugs.sh debian:12
96+
RUN pkg-resolver/install-boost.sh debian:12
97+
RUN pkg-resolver/install-protobuf.sh debian:12
98+
RUN pkg-resolver/install-hadolint.sh debian:12
99+
RUN pkg-resolver/install-intel-isa-l.sh debian:12
100+
101+
###
102+
# Everything past this point is either not needed for testing or breaks Yetus.
103+
# So tell Yetus not to read the rest of the file:
104+
# YETUS CUT HERE
105+
###
106+
107+
# Add a welcome message and environment checks.
108+
COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
109+
RUN chmod 755 /root/hadoop_env_checks.sh
110+
# hadolint ignore=SC2016
111+
RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Dockerfile for installing the necessary dependencies for building Hadoop.
18+
# See BUILDING.txt.
19+
20+
FROM debian:13
21+
22+
WORKDIR /root
23+
24+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
25+
26+
#####
27+
# Disable suggests/recommends
28+
#####
29+
RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/10disableextras
30+
RUN echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/10disableextras
31+
32+
ENV DEBIAN_FRONTEND=noninteractive
33+
ENV DEBCONF_TERSE=true
34+
35+
######
36+
# Platform package dependency resolver
37+
######
38+
COPY pkg-resolver pkg-resolver
39+
RUN chmod a+x pkg-resolver/*.sh pkg-resolver/*.py \
40+
&& chmod a+r pkg-resolver/*.json
41+
42+
######
43+
# Install packages from apt
44+
######
45+
# hadolint ignore=DL3008,SC2046
46+
RUN apt-get -q update
47+
RUN apt-get -q install -y --no-install-recommends wget apt-transport-https gpg gpg-agent gawk ca-certificates
48+
RUN apt-get -q install -y --no-install-recommends python3
49+
RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" > /etc/apt/sources.list.d/adoptium.list
50+
RUN wget -q -O - https://packages.adoptium.net/artifactory/api/gpg/key/public > /etc/apt/trusted.gpg.d/adoptium.asc
51+
RUN apt-get -q update
52+
RUN apt-get -q install -y --no-install-recommends $(pkg-resolver/resolve.py debian:13)
53+
RUN apt-get clean
54+
RUN update-java-alternatives -s temurin-17-jdk-amd64
55+
RUN rm -rf /var/lib/apt/lists/*
56+
57+
RUN sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen
58+
RUN locale-gen
59+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
60+
ENV PYTHONIOENCODING=utf-8
61+
62+
######
63+
# Set env vars required to build Hadoop
64+
######
65+
ENV MAVEN_HOME=/opt/maven
66+
ENV PATH="${PATH}:${MAVEN_HOME}/bin"
67+
# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
68+
ENV JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64
69+
70+
#######
71+
# Set env vars for SpotBugs 4.2.2
72+
#######
73+
ENV SPOTBUGS_HOME=/opt/spotbugs
74+
75+
#######
76+
# Set env vars for Google Protobuf 3.21.12
77+
#######
78+
ENV PROTOBUF_HOME=/opt/protobuf
79+
ENV PATH="${PATH}:/opt/protobuf/bin"
80+
81+
###
82+
# Avoid out of memory errors in builds
83+
###
84+
ENV MAVEN_OPTS="-Xms256m -Xmx3072m"
85+
86+
# Skip gpg verification when downloading Yetus via yetus-wrapper
87+
ENV HADOOP_SKIP_YETUS_VERIFICATION=true
88+
89+
####
90+
# Install packages
91+
####
92+
RUN pkg-resolver/install-maven.sh debian:13
93+
RUN pkg-resolver/install-cmake.sh debian:13
94+
RUN pkg-resolver/install-spotbugs.sh debian:13
95+
RUN pkg-resolver/install-boost.sh debian:13
96+
RUN pkg-resolver/install-protobuf.sh debian:13
97+
RUN pkg-resolver/install-hadolint.sh debian:13
98+
RUN pkg-resolver/install-intel-isa-l.sh debian:13
99+
100+
###
101+
# Everything past this point is either not needed for testing or breaks Yetus.
102+
# So tell Yetus not to read the rest of the file:
103+
# YETUS CUT HERE
104+
###
105+
106+
# Add a welcome message and environment checks.
107+
COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
108+
RUN chmod 755 /root/hadoop_env_checks.sh
109+
# hadolint ignore=SC2016
110+
RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc

0 commit comments

Comments
 (0)