forked from cocaine/cocaine-plugins
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
50 lines (42 loc) · 2.05 KB
/
Dockerfile
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
FROM ubuntu:trusty
# Pass build branch from travis
ARG BUILD_BRANCH=master
ENV BUILD_BRANCH=$BUILD_BRANCH
RUN apt-get -y -qq update
RUN apt-get -y -qq install build-essential devscripts equivs git-core
# Yep. It's a bit hackish to install our internal dependencies through git.
## Build and install Metrics.
RUN git clone https://github.com/3Hren/metrics --recursive -b master /build/metrics
RUN cd /build/metrics && \
DEBIAN_FRONTEND=noninteractive mk-build-deps -ir -t "apt-get -qq --no-install-recommends"
RUN cd /build/metrics && \
yes | debuild -e CC -e CXX -uc -us -j$(cat /proc/cpuinfo | fgrep -c processor) && \
debi
## Build and install Blackhole.
RUN git clone https://github.com/3Hren/blackhole --recursive -b master /build/blackhole
RUN cd /build/blackhole && \
DEBIAN_FRONTEND=noninteractive mk-build-deps -ir -t "apt-get -qq --no-install-recommends"
RUN cd /build/blackhole && \
yes | debuild -e CC -e CXX -uc -us -j$(cat /proc/cpuinfo | fgrep -c processor) && \
debi
# Hack to cache plugins dependencies.
RUN apt-get -qq install libarchive-dev uuid-dev libcgroup-dev libboost-filesystem-dev \
libboost-thread-dev libnl-3-dev libnl-genl-3-dev libzookeeper-mt-dev libpqxx-dev
# Build and install cocaine-core.
RUN git clone https://github.com/3Hren/cocaine-core --recursive -b $BUILD_BRANCH /build/cocaine-core
RUN cd /build/cocaine-core && \
DEBIAN_FRONTEND=noninteractive mk-build-deps -ir -t "apt-get -qq --no-install-recommends"
RUN cd /build/cocaine-core && \
yes | debuild -e CC -e CXX -uc -us -j$(cat /proc/cpuinfo | fgrep -c processor) && \
debi
# Build and install cocaine-plugins.
COPY . /build/cocaine-plugins
RUN cd /build/cocaine-plugins && \
cmake -DELASTICSEARCH=OFF -DMONGO=OFF -DURLFETCH=OFF -DDOCKER=OFF -DELLIPTICS=OFF . && \
make
# Cleanup.
RUN apt-get -y -qq purge cocaine-core-build-deps && \
apt-get -y -qq purge blackhole-build-deps && \
apt-get -y -qq purge metrics-build-deps && \
apt-get -y -qq purge build-essential devscripts equivs git-core && \
apt-get -y -qq autoremove --purge