2021-05-13 16:28:27 +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.
|
|
|
|
|
|
|
|
FROM centos:8
|
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
|
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 yum
|
|
|
|
######
|
|
|
|
# hadolint ignore=DL3008,SC2046
|
2021-05-13 16:28:27 +00:00
|
|
|
RUN yum update -y \
|
2021-06-08 03:11:08 +00:00
|
|
|
&& yum install -y python3 \
|
|
|
|
&& yum install -y $(pkg-resolver/resolve.py centos:8)
|
2021-05-13 16:28:27 +00:00
|
|
|
|
|
|
|
####
|
|
|
|
# Install EPEL
|
|
|
|
####
|
2021-06-08 03:11:08 +00:00
|
|
|
RUN pkg-resolver/install-epel.sh centos:8
|
2021-05-13 16:28:27 +00:00
|
|
|
|
|
|
|
RUN dnf --enablerepo=powertools install -y \
|
|
|
|
doxygen \
|
2021-06-08 03:11:08 +00:00
|
|
|
snappy-devel \
|
|
|
|
yasm
|
2021-05-13 16:28:27 +00:00
|
|
|
|
|
|
|
RUN dnf install -y \
|
|
|
|
bouncycastle \
|
|
|
|
gcc-toolset-9-gcc \
|
|
|
|
gcc-toolset-9-gcc-c++ \
|
|
|
|
nodejs \
|
|
|
|
npm \
|
|
|
|
libpmem-devel
|
|
|
|
|
|
|
|
# Set GCC 9 as the default C/C++ compiler
|
|
|
|
RUN echo "source /opt/rh/gcc-toolset-9/enable" >> /etc/bashrc
|
|
|
|
SHELL ["/bin/bash", "--login", "-c"]
|
|
|
|
|
2021-07-01 05:04:54 +00:00
|
|
|
######
|
|
|
|
# Set the environment variables needed for CMake
|
|
|
|
# to find and use GCC 9 for compilation
|
|
|
|
######
|
|
|
|
ENV GCC_HOME "/opt/rh/gcc-toolset-9"
|
|
|
|
ENV CC "${GCC_HOME}/root/usr/bin/gcc"
|
|
|
|
ENV CXX "${GCC_HOME}/root/usr/bin/g++"
|
|
|
|
ENV MODULES_RUN_QUARANTINE "LD_LIBRARY_PATH LD_PRELOAD"
|
|
|
|
ENV MODULES_CMD "/usr/share/Modules/libexec/modulecmd.tcl"
|
|
|
|
ENV SHLVL 1
|
|
|
|
ENV MODULEPATH "/etc/scl/modulefiles:/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles"
|
|
|
|
ENV MODULEPATH_modshare "/usr/share/modulefiles:1:/usr/share/Modules/modulefiles:1:/etc/modulefiles:1"
|
|
|
|
ENV MODULESHOME "/usr/share/Modules"
|
|
|
|
ENV LD_LIBRARY_PATH "${GCC_HOME}/root/usr/lib64:${GCC_HOME}/root/usr/lib:${GCC_HOME}/root/usr/lib64/dyninst:${GCC_HOME}/root/usr/lib/dyninst:${GCC_HOME}/root/usr/lib64:${GCC_HOME}/root/usr/lib:/usr/lib:/usr/lib64"
|
|
|
|
ENV PCP_DIR "${GCC_HOME}/root"
|
|
|
|
ENV MANPATH "${GCC_HOME}/root/usr/share/man::"
|
|
|
|
ENV PATH "${GCC_HOME}/root/usr/bin:/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
|
|
ENV PKG_CONFIG_PATH "${GCC_HOME}/root/usr/lib64/pkgconfig"
|
|
|
|
ENV INFOPATH "${GCC_HOME}/root/usr/share/info"
|
|
|
|
|
2021-06-08 03:11:08 +00:00
|
|
|
# TODO: Set locale
|
2021-05-21 16:26:50 +00:00
|
|
|
|
2021-05-13 16:28:27 +00:00
|
|
|
######
|
|
|
|
# Set env vars required to build Hadoop
|
|
|
|
######
|
2021-06-08 03:11:08 +00:00
|
|
|
ENV MAVEN_HOME /opt/maven
|
2021-05-13 16:28:27 +00:00
|
|
|
ENV PATH "${PATH}:${MAVEN_HOME}/bin"
|
|
|
|
# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
|
|
|
|
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0
|
|
|
|
|
|
|
|
#######
|
2021-06-08 03:11:08 +00:00
|
|
|
# Set env vars for SpotBugs
|
2021-05-13 16:28:27 +00:00
|
|
|
#######
|
|
|
|
ENV SPOTBUGS_HOME /opt/spotbugs
|
|
|
|
|
|
|
|
#######
|
2021-06-08 03:11:08 +00:00
|
|
|
# Set env vars for Google Protobuf
|
2021-05-13 16:28:27 +00:00
|
|
|
#######
|
|
|
|
ENV PROTOBUF_HOME /opt/protobuf
|
|
|
|
ENV PATH "${PATH}:/opt/protobuf/bin"
|
|
|
|
|
2021-06-08 03:11:08 +00:00
|
|
|
######
|
|
|
|
# Install packages
|
|
|
|
######
|
|
|
|
RUN pkg-resolver/install-maven.sh centos:8
|
|
|
|
RUN pkg-resolver/install-cmake.sh centos:8
|
|
|
|
RUN pkg-resolver/install-boost.sh centos:8
|
|
|
|
RUN pkg-resolver/install-spotbugs.sh centos:8
|
|
|
|
RUN pkg-resolver/install-protobuf.sh centos:8
|
|
|
|
RUN pkg-resolver/install-zstandard.sh centos:8
|
|
|
|
RUN pkg-resolver/install-common-pkgs.sh
|