2015-04-24 20:05:18 +00: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.
|
|
|
|
|
|
|
|
# Dockerfile for installing the necessary dependencies for building Hadoop.
|
|
|
|
# See BUILDING.txt.
|
|
|
|
|
2021-01-26 05:15:43 +00:00
|
|
|
FROM ubuntu:focal
|
2015-04-24 20:05:18 +00:00
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
2018-09-01 23:05:33 +00:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
|
2017-10-19 23:33:47 +00:00
|
|
|
#####
|
|
|
|
# Disable suggests/recommends
|
|
|
|
#####
|
|
|
|
RUN echo APT::Install-Recommends "0"\; > /etc/apt/apt.conf.d/10disableextras
|
|
|
|
RUN echo APT::Install-Suggests "0"\; >> /etc/apt/apt.conf.d/10disableextras
|
|
|
|
|
2016-04-28 02:35:51 +00:00
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
ENV DEBCONF_TERSE true
|
|
|
|
|
2021-06-08 03:11:08 +00:00
|
|
|
######
|
|
|
|
# Platform package dependency resolver
|
|
|
|
######
|
|
|
|
COPY pkg-resolver pkg-resolver
|
|
|
|
RUN chmod a+x pkg-resolver/*.sh pkg-resolver/*.py \
|
|
|
|
&& chmod a+r pkg-resolver/*.json
|
|
|
|
|
|
|
|
######
|
|
|
|
# Install packages from apt
|
|
|
|
######
|
|
|
|
# hadolint ignore=DL3008,SC2046
|
2018-09-01 23:05:33 +00:00
|
|
|
RUN apt-get -q update \
|
2021-06-08 03:11:08 +00:00
|
|
|
&& apt-get -q install -y --no-install-recommends python3 \
|
|
|
|
&& apt-get -q install -y --no-install-recommends $(pkg-resolver/resolve.py ubuntu:focal) \
|
2018-09-01 23:05:33 +00:00
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2015-04-24 20:05:18 +00:00
|
|
|
|
2021-05-21 16:26:50 +00:00
|
|
|
RUN locale-gen en_US.UTF-8
|
|
|
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
|
|
|
ENV PYTHONIOENCODING=utf-8
|
|
|
|
|
2020-06-19 04:29:44 +00:00
|
|
|
######
|
|
|
|
# Set env vars required to build Hadoop
|
|
|
|
######
|
|
|
|
ENV MAVEN_HOME /usr
|
|
|
|
# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
|
|
|
|
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
|
2021-03-11 01:56:07 +00:00
|
|
|
|
|
|
|
#######
|
2021-06-08 03:11:08 +00:00
|
|
|
# Set env vars for SpotBugs 4.2.2
|
2021-03-11 01:56:07 +00:00
|
|
|
#######
|
|
|
|
ENV SPOTBUGS_HOME /opt/spotbugs
|
2016-05-17 03:25:40 +00:00
|
|
|
|
2020-07-15 04:39:48 +00:00
|
|
|
#######
|
2021-06-08 03:11:08 +00:00
|
|
|
# Set env vars for Google Protobuf 3.7.1
|
2020-07-15 04:39:48 +00:00
|
|
|
#######
|
2019-10-10 16:06:02 +00:00
|
|
|
ENV PROTOBUF_HOME /opt/protobuf
|
|
|
|
ENV PATH "${PATH}:/opt/protobuf/bin"
|
|
|
|
|
2017-10-19 23:33:47 +00:00
|
|
|
###
|
|
|
|
# Avoid out of memory errors in builds
|
|
|
|
###
|
2021-05-15 19:15:11 +00:00
|
|
|
ENV MAVEN_OPTS -Xms256m -Xmx3072m
|
2017-10-19 23:33:47 +00:00
|
|
|
|
2020-06-04 07:34:28 +00:00
|
|
|
# Skip gpg verification when downloading Yetus via yetus-wrapper
|
2020-06-03 09:01:37 +00:00
|
|
|
ENV HADOOP_SKIP_YETUS_VERIFICATION true
|
|
|
|
|
2021-06-08 03:11:08 +00:00
|
|
|
####
|
|
|
|
# Install packages
|
|
|
|
####
|
|
|
|
RUN pkg-resolver/install-common-pkgs.sh
|
|
|
|
RUN pkg-resolver/install-spotbugs.sh ubuntu:focal
|
|
|
|
RUN pkg-resolver/install-boost.sh ubuntu:focal
|
|
|
|
RUN pkg-resolver/install-protobuf.sh ubuntu:focal
|
|
|
|
RUN pkg-resolver/install-hadolint.sh ubuntu:focal
|
|
|
|
RUN pkg-resolver/install-intel-isa-l.sh ubuntu:focal
|
|
|
|
|
2015-11-12 18:17:41 +00: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
|
|
|
|
###
|
|
|
|
|
2015-04-24 20:05:18 +00:00
|
|
|
# Add a welcome message and environment checks.
|
2018-09-01 23:05:33 +00:00
|
|
|
COPY hadoop_env_checks.sh /root/hadoop_env_checks.sh
|
2015-04-24 20:05:18 +00:00
|
|
|
RUN chmod 755 /root/hadoop_env_checks.sh
|
2018-09-01 23:05:33 +00:00
|
|
|
# hadolint ignore=SC2016
|
|
|
|
RUN echo '${HOME}/hadoop_env_checks.sh' >> /root/.bashrc
|