|
| 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 centos:7 |
| 21 | + |
| 22 | +WORKDIR /root |
| 23 | + |
| 24 | +SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
| 25 | + |
| 26 | +RUN yum update -y \ |
| 27 | + && yum install -y centos-release-scl \ |
| 28 | + && yum install -y devtoolset-9 \ |
| 29 | + && yum install -y \ |
| 30 | + ant \ |
| 31 | + build-essential \ |
| 32 | + bzip2 \ |
| 33 | + bzip2-devel \ |
| 34 | + clang \ |
| 35 | + curl \ |
| 36 | + cyrus-sasl-devel \ |
| 37 | + doxygen \ |
| 38 | + fuse \ |
| 39 | + fuse-libs \ |
| 40 | + fuse-devel \ |
| 41 | + git \ |
| 42 | + libcurl-devel \ |
| 43 | + libtirpc-devel \ |
| 44 | + libpmem-devel \ |
| 45 | + libtool \ |
| 46 | + lz4-devel \ |
| 47 | + make \ |
| 48 | + openssl-devel \ |
| 49 | + pinentry-curses \ |
| 50 | + python3 \ |
| 51 | + python3-pip \ |
| 52 | + python3-setuptools \ |
| 53 | + python3-wheel \ |
| 54 | + rsync \ |
| 55 | + snappy-devel \ |
| 56 | + sudo \ |
| 57 | + valgrind \ |
| 58 | + zlib-devel |
| 59 | + |
| 60 | +# Set GCC 9 as the default C/C++ compiler |
| 61 | +RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc |
| 62 | +SHELL ["/bin/bash", "--login", "-c"] |
| 63 | + |
| 64 | +#### |
| 65 | +# Install Maven 3.6.3 |
| 66 | +#### |
| 67 | +RUN mkdir -p /opt/maven /tmp/maven \ |
| 68 | + && curl -L -s -S https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz \ |
| 69 | + -o /tmp/maven/apache-maven-3.6.3-bin.tar.gz \ |
| 70 | + && tar xzf /tmp/maven/apache-maven-3.6.3-bin.tar.gz --strip-components 1 -C /opt/maven |
| 71 | + |
| 72 | +#### |
| 73 | +# Install CMake 3.19 |
| 74 | +#### |
| 75 | +# hadolint ignore=DL3003 |
| 76 | +RUN mkdir -p /tmp/cmake /opt/cmake \ |
| 77 | + && curl -L -s -S https://cmake.org/files/v3.19/cmake-3.19.0.tar.gz -o /tmp/cmake/cmake-3.19.0.tar.gz \ |
| 78 | + && tar xzf /tmp/cmake/cmake-3.19.0.tar.gz --strip-components 1 -C /opt/cmake \ |
| 79 | + && cd /opt/cmake || exit && ./bootstrap \ |
| 80 | + && make "-j$(nproc)" \ |
| 81 | + && make install \ |
| 82 | + && cd /root || exit |
| 83 | + |
| 84 | +#### |
| 85 | +# Install zstandard |
| 86 | +#### |
| 87 | +# hadolint ignore=DL3003 |
| 88 | +RUN mkdir -p /opt/zstd /tmp/zstd \ |
| 89 | + && curl -L -s -S https://github.com/facebook/zstd/archive/refs/tags/v1.4.9.tar.gz -o /tmp/zstd/v1.4.9.tar.gz \ |
| 90 | + && tar xzf /tmp/zstd/v1.4.9.tar.gz --strip-components 1 -C /opt/zstd \ |
| 91 | + && cd /opt/zstd || exit \ |
| 92 | + && make "-j$(nproc)" \ |
| 93 | + && make install \ |
| 94 | + && cd /root || exit |
| 95 | + |
| 96 | +###### |
| 97 | +# Set env vars required to build Hadoop |
| 98 | +###### |
| 99 | +ENV MAVEN_HOME /opt/maven |
| 100 | +ENV PATH "${PATH}:${MAVEN_HOME}/bin" |
| 101 | +# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003) |
| 102 | +ENV JAVA_HOME /usr/lib/jvm/java-1.8.0 |
| 103 | + |
| 104 | +####### |
| 105 | +# Install SpotBugs 4.2.2 |
| 106 | +####### |
| 107 | +RUN mkdir -p /opt/spotbugs \ |
| 108 | + && curl -L -s -S https://github.com/spotbugs/spotbugs/releases/download/4.2.2/spotbugs-4.2.2.tgz \ |
| 109 | + -o /opt/spotbugs.tgz \ |
| 110 | + && tar xzf /opt/spotbugs.tgz --strip-components 1 -C /opt/spotbugs \ |
| 111 | + && chmod +x /opt/spotbugs/bin/* |
| 112 | +ENV SPOTBUGS_HOME /opt/spotbugs |
| 113 | + |
| 114 | +####### |
| 115 | +# Install Boost 1.72 (1.71 ships with Focal) |
| 116 | +####### |
| 117 | +# hadolint ignore=DL3003 |
| 118 | +RUN mkdir -p /opt/boost-library \ |
| 119 | + && curl -L https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download > boost_1_72_0.tar.bz2 \ |
| 120 | + && mv boost_1_72_0.tar.bz2 /opt/boost-library \ |
| 121 | + && cd /opt/boost-library \ |
| 122 | + && tar --bzip2 -xf boost_1_72_0.tar.bz2 \ |
| 123 | + && cd /opt/boost-library/boost_1_72_0 \ |
| 124 | + && ./bootstrap.sh --prefix=/usr/ \ |
| 125 | + && ./b2 --without-python install \ |
| 126 | + && cd /root \ |
| 127 | + && rm -rf /opt/boost-library |
| 128 | + |
| 129 | +###### |
| 130 | +# Install Google Protobuf 3.7.1 (3.6.1 ships with Focal) |
| 131 | +###### |
| 132 | +# hadolint ignore=DL3003 |
| 133 | +RUN mkdir -p /opt/protobuf-src \ |
| 134 | + && curl -L -s -S \ |
| 135 | + https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-java-3.7.1.tar.gz \ |
| 136 | + -o /opt/protobuf.tar.gz \ |
| 137 | + && tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src \ |
| 138 | + && cd /opt/protobuf-src \ |
| 139 | + && ./configure --prefix=/opt/protobuf \ |
| 140 | + && make "-j$(nproc)" \ |
| 141 | + && make install \ |
| 142 | + && cd /root \ |
| 143 | + && rm -rf /opt/protobuf-src |
| 144 | +ENV PROTOBUF_HOME /opt/protobuf |
| 145 | +ENV PATH "${PATH}:/opt/protobuf/bin" |
| 146 | + |
| 147 | +#### |
| 148 | +# Install Node.js |
| 149 | +#### |
| 150 | +# hadolint ignore=DL3003 |
| 151 | +RUN mkdir -p /tmp/node \ |
| 152 | + && curl -L -s -S https://nodejs.org/dist/v14.16.1/node-v14.16.1.tar.gz -o /tmp/node-v14.16.1.tar.gz \ |
| 153 | + && tar xzf /tmp/node-v14.16.1.tar.gz --strip-components 1 -C /tmp/node \ |
| 154 | + && cd /tmp/node || exit \ |
| 155 | + && ./configure \ |
| 156 | + && make "-j$(nproc)" \ |
| 157 | + && make install \ |
| 158 | + && cd /root || exit |
| 159 | + |
| 160 | +#### |
| 161 | +# Install pylint and python-dateutil |
| 162 | +#### |
| 163 | +RUN pip3 install pylint==2.6.0 python-dateutil==2.8.1 |
| 164 | + |
| 165 | +#### |
| 166 | +# Install bower |
| 167 | +#### |
| 168 | +# hadolint ignore=DL3008 |
| 169 | +RUN npm install -g bower@1.8.8 |
0 commit comments