-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-compile
53 lines (35 loc) · 1.57 KB
/
Dockerfile-compile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM java:openjdk-8-jdk
ENV MAVEN_VERSION 3.3.9
RUN mkdir -p /usr/share/maven \
&& curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \
| tar -xzC /usr/share/maven --strip-components=1 \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
ENV MAVEN_HOME /usr/share/maven
VOLUME /root/.m2
RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
# As suggested by a user, for some people this line works instead of the first one. Use whichever works for your case
# RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list
RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
RUN apt-get -o Acquire::Check-Valid-Until=false update
RUN \
apt-get install -y build-essential cmake zlib1g-dev pkg-config libssl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ARG HADOOP_VERSION=
ARG PROTOBUF_VERSION=
ADD \
hadoop-${HADOOP_VERSION}-src.tar.gz \
protobuf-${PROTOBUF_VERSION}.tar.bz2 \
/tmp/
RUN \
cd /tmp/protobuf-${PROTOBUF_VERSION} && \
./configure && \
make -j$(nproc) && make install
ENV LD_LIBRARY_PATH /usr/local/lib
ENV export LD_RUN_PATH /usr/local/lib
# build native libs
RUN \
cd /tmp/hadoop-${HADOOP_VERSION}-src && \
mvn package -Pdist,native -DskipTests -Dtar
# tar to stdout
CMD tar -cv -C /tmp/hadoop-${HADOOP_VERSION}-src/hadoop-dist/target/hadoop-${HADOOP_VERSION}/lib/native/ .