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.
|
|
|
|
|
2017-10-19 23:33:47 +00:00
|
|
|
FROM ubuntu:xenial
|
2015-04-24 20:05:18 +00:00
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
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
|
|
|
|
|
2015-11-12 18:17:41 +00:00
|
|
|
######
|
2017-10-19 23:33:47 +00:00
|
|
|
# Install common dependencies from packages. Versions here are either
|
|
|
|
# sufficient or irrelevant.
|
2016-05-17 03:25:40 +00:00
|
|
|
#
|
|
|
|
# WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default
|
|
|
|
# Ubuntu Java. See Java section below!
|
2015-11-12 18:17:41 +00:00
|
|
|
######
|
2017-10-19 23:33:47 +00:00
|
|
|
RUN apt-get -q update && apt-get -q install -y \
|
|
|
|
apt-utils \
|
2016-03-04 23:42:04 +00:00
|
|
|
build-essential \
|
|
|
|
bzip2 \
|
2017-07-25 16:25:45 +00:00
|
|
|
clang \
|
2016-03-04 23:42:04 +00:00
|
|
|
curl \
|
|
|
|
doxygen \
|
|
|
|
fuse \
|
|
|
|
g++ \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
gnupg-agent \
|
|
|
|
libbz2-dev \
|
2015-04-24 20:05:18 +00:00
|
|
|
libcurl4-openssl-dev \
|
2016-03-04 23:42:04 +00:00
|
|
|
libfuse-dev \
|
|
|
|
libprotobuf-dev \
|
|
|
|
libprotoc-dev \
|
2018-02-16 15:27:11 +00:00
|
|
|
libsasl2-dev \
|
2016-03-04 23:42:04 +00:00
|
|
|
libsnappy-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libtool \
|
2017-10-19 23:33:47 +00:00
|
|
|
locales \
|
|
|
|
make \
|
2016-03-04 23:42:04 +00:00
|
|
|
pinentry-curses \
|
|
|
|
pkg-config \
|
|
|
|
python \
|
|
|
|
python2.7 \
|
2016-04-28 02:35:51 +00:00
|
|
|
python-pip \
|
2017-10-19 23:33:47 +00:00
|
|
|
python-pkg-resources \
|
|
|
|
python-setuptools \
|
|
|
|
python-wheel \
|
2016-06-23 06:11:58 +00:00
|
|
|
rsync \
|
2017-10-19 23:33:47 +00:00
|
|
|
software-properties-common \
|
2016-03-04 23:42:04 +00:00
|
|
|
snappy \
|
2017-10-19 23:33:47 +00:00
|
|
|
sudo \
|
2018-02-16 15:27:11 +00:00
|
|
|
valgrind \
|
|
|
|
zlib1g-dev
|
2015-04-24 20:05:18 +00:00
|
|
|
|
2015-11-12 18:17:41 +00:00
|
|
|
#######
|
2017-10-19 23:33:47 +00:00
|
|
|
# OpenJDK 8
|
2015-11-12 18:17:41 +00:00
|
|
|
#######
|
2017-10-19 23:33:47 +00:00
|
|
|
RUN apt-get -q install -y openjdk-8-jdk
|
2015-04-24 20:05:18 +00:00
|
|
|
|
2017-10-19 23:33:47 +00:00
|
|
|
#######
|
|
|
|
# OpenJDK 9
|
|
|
|
# w/workaround for
|
|
|
|
# https://bugs.launchpad.net/ubuntu/+source/openjdk-9/+bug/1593191
|
|
|
|
#######
|
|
|
|
RUN apt-get -o Dpkg::Options::="--force-overwrite" \
|
|
|
|
-q install -y \
|
|
|
|
openjdk-9-jdk-headless
|
2016-05-17 03:25:40 +00:00
|
|
|
|
2017-10-19 23:33:47 +00:00
|
|
|
#######
|
|
|
|
# Set default Java
|
|
|
|
#######
|
|
|
|
#
|
|
|
|
# By default, OpenJDK sets the default Java to the highest version.
|
|
|
|
# We want the opposite, soooooo....
|
|
|
|
#
|
|
|
|
RUN update-java-alternatives --set java-1.8.0-openjdk-amd64
|
|
|
|
RUN update-alternatives --get-selections | grep -i jdk | \
|
|
|
|
while read line; do \
|
|
|
|
alternative=$(echo $line | awk '{print $1}'); \
|
|
|
|
path=$(echo $line | awk '{print $3}'); \
|
|
|
|
newpath=$(echo $path | sed -e 's/java-9/java-8/'); \
|
|
|
|
update-alternatives --set $alternative $newpath; \
|
|
|
|
done
|
2017-07-20 00:51:14 +00:00
|
|
|
|
|
|
|
######
|
2017-10-19 23:33:47 +00:00
|
|
|
# Install cmake 3.1.0 (3.5.1 ships with Xenial)
|
2017-07-20 00:51:14 +00:00
|
|
|
######
|
|
|
|
RUN mkdir -p /opt/cmake && \
|
|
|
|
curl -L -s -S \
|
2017-10-19 23:33:47 +00:00
|
|
|
https://cmake.org/files/v3.1/cmake-3.1.0-Linux-x86_64.tar.gz \
|
|
|
|
-o /opt/cmake.tar.gz && \
|
2017-07-20 00:51:14 +00:00
|
|
|
tar xzf /opt/cmake.tar.gz --strip-components 1 -C /opt/cmake
|
|
|
|
ENV CMAKE_HOME /opt/cmake
|
|
|
|
ENV PATH "${PATH}:/opt/cmake/bin"
|
2016-05-17 03:25:40 +00:00
|
|
|
|
2015-11-12 18:17:41 +00:00
|
|
|
######
|
2017-10-19 23:33:47 +00:00
|
|
|
# Install Google Protobuf 2.5.0 (2.6.0 ships with Xenial)
|
2015-11-12 18:17:41 +00:00
|
|
|
######
|
2017-10-19 23:33:47 +00:00
|
|
|
RUN mkdir -p /opt/protobuf-src && \
|
2016-04-28 02:35:51 +00:00
|
|
|
curl -L -s -S \
|
2017-10-19 23:33:47 +00:00
|
|
|
https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz \
|
|
|
|
-o /opt/protobuf.tar.gz && \
|
|
|
|
tar xzf /opt/protobuf.tar.gz --strip-components 1 -C /opt/protobuf-src
|
|
|
|
RUN cd /opt/protobuf-src && ./configure --prefix=/opt/protobuf && make install
|
|
|
|
ENV PROTOBUF_HOME /opt/protobuf
|
|
|
|
ENV PATH "${PATH}:/opt/protobuf/bin"
|
|
|
|
|
|
|
|
######
|
|
|
|
# Install Apache Maven 3.3.9 (3.3.9 ships with Xenial)
|
|
|
|
######
|
|
|
|
RUN apt-get -q update && apt-get -q install -y maven
|
|
|
|
ENV MAVEN_HOME /usr
|
|
|
|
|
|
|
|
######
|
|
|
|
# Install findbugs 3.0.1 (3.0.1 ships with Xenial)
|
2017-10-25 15:08:22 +00:00
|
|
|
# Ant is needed for findbugs
|
2017-10-19 23:33:47 +00:00
|
|
|
######
|
2017-10-25 15:08:22 +00:00
|
|
|
RUN apt-get -q update && apt-get -q install -y findbugs ant
|
2017-10-19 23:33:47 +00:00
|
|
|
ENV FINDBUGS_HOME /usr
|
2015-04-24 20:05:18 +00:00
|
|
|
|
2015-11-12 18:17:41 +00:00
|
|
|
####
|
2017-10-19 23:33:47 +00:00
|
|
|
# Install shellcheck (0.4.6, the latest as of 2017-09-26)
|
2015-11-12 18:17:41 +00:00
|
|
|
####
|
2017-10-19 23:33:47 +00:00
|
|
|
RUN add-apt-repository -y ppa:jonathonf/ghc-8.0.2
|
|
|
|
RUN apt-get -q update && apt-get -q install -y shellcheck
|
2015-04-24 20:05:18 +00:00
|
|
|
|
2015-11-12 18:17:41 +00:00
|
|
|
####
|
2017-10-19 23:33:47 +00:00
|
|
|
# Install bats (0.4.0, the latest as of 2017-09-26, ships with Xenial)
|
2015-11-12 18:17:41 +00:00
|
|
|
####
|
2017-10-19 23:33:47 +00:00
|
|
|
RUN apt-get -q update && apt-get -q install -y bats
|
2016-04-28 02:35:51 +00:00
|
|
|
|
|
|
|
####
|
2017-10-19 23:33:47 +00:00
|
|
|
# Install pylint (always want latest)
|
2016-04-28 02:35:51 +00:00
|
|
|
####
|
2017-10-19 23:33:47 +00:00
|
|
|
RUN pip2 install pylint
|
2015-04-24 20:05:18 +00:00
|
|
|
|
2016-06-14 23:03:20 +00:00
|
|
|
####
|
|
|
|
# Install dateutil.parser
|
|
|
|
####
|
2017-10-19 23:33:47 +00:00
|
|
|
RUN pip2 install python-dateutil
|
2016-06-14 23:03:20 +00:00
|
|
|
|
2015-11-12 18:17:41 +00:00
|
|
|
###
|
2017-10-19 23:33:47 +00:00
|
|
|
# Install node.js for web UI framework (4.2.6 ships with Xenial)
|
2016-03-21 21:03:13 +00:00
|
|
|
###
|
2016-09-06 17:45:59 +00:00
|
|
|
RUN apt-get -y install nodejs && \
|
|
|
|
ln -s /usr/bin/nodejs /usr/bin/node && \
|
|
|
|
apt-get -y install npm && \
|
2016-11-11 18:58:50 +00:00
|
|
|
npm install npm@latest -g && \
|
2016-09-06 17:45:59 +00:00
|
|
|
npm install -g bower && \
|
|
|
|
npm install -g ember-cli
|
2016-03-21 21:03:13 +00:00
|
|
|
|
2017-10-19 23:33:47 +00:00
|
|
|
###
|
|
|
|
# Avoid out of memory errors in builds
|
|
|
|
###
|
2018-03-01 20:53:19 +00:00
|
|
|
ENV MAVEN_OPTS -Xms256m -Xmx1536m
|
2017-10-19 23:33:47 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
|
###
|
|
|
|
|
|
|
|
####
|
2017-10-25 15:08:22 +00:00
|
|
|
# Install svn & Forrest (for Apache Hadoop website)
|
2015-11-12 18:17:41 +00:00
|
|
|
###
|
2017-10-25 15:08:22 +00:00
|
|
|
RUN apt-get -q update && apt-get -q install -y subversion
|
2017-10-19 23:33:47 +00:00
|
|
|
|
|
|
|
RUN mkdir -p /opt/apache-forrest && \
|
|
|
|
curl -L -s -S \
|
|
|
|
https://archive.apache.org/dist/forrest/0.8/apache-forrest-0.8.tar.gz \
|
|
|
|
-o /opt/forrest.tar.gz && \
|
|
|
|
tar xzf /opt/forrest.tar.gz --strip-components 1 -C /opt/apache-forrest
|
|
|
|
RUN echo 'forrest.home=/opt/apache-forrest' > build.properties
|
|
|
|
ENV FORREST_HOME=/opt/apache-forrest
|
2015-11-12 18:17:41 +00:00
|
|
|
|
2017-10-26 17:13:37 +00:00
|
|
|
# Hugo static website generator (for new hadoop site and Ozone docs)
|
|
|
|
RUN curl -L -o hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.30.2/hugo_0.30.2_Linux-64bit.deb && dpkg --install hugo.deb && rm hugo.deb
|
|
|
|
|
2015-04-24 20:05:18 +00:00
|
|
|
# Add a welcome message and environment checks.
|
|
|
|
ADD hadoop_env_checks.sh /root/hadoop_env_checks.sh
|
|
|
|
RUN chmod 755 /root/hadoop_env_checks.sh
|
|
|
|
RUN echo '~/hadoop_env_checks.sh' >> /root/.bashrc
|
2018-02-16 15:27:11 +00:00
|
|
|
|