forked from openebs-archive/jiva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dapper
79 lines (67 loc) · 2.9 KB
/
Dockerfile.dapper
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM ubuntu:16.04
# FROM arm=armhf/ubuntu:16.04
ARG DAPPER_HOST_ARCH=amd64
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
# Setup environment
ENV PATH /go/bin:$PATH
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_ENV TAG REPO
ENV DAPPER_OUTPUT bin
ENV DAPPER_RUN_ARGS --privileged --tmpfs /go/src/github.com/openebs/jiva/integration/.venv:exec --tmpfs /go/src/github.com/openebs/jiva/integration/.tox:exec -v /dev:/host/dev -v /proc:/host/proc
ENV DAPPER_SOURCE /go/src/github.com/openebs/jiva
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
WORKDIR ${DAPPER_SOURCE}
# Install packages
RUN apt-get update && \
apt-get install -y cmake wget curl git less file \
libglib2.0-dev libkmod-dev libnl-genl-3-dev linux-libc-dev pkg-config psmisc python-tox qemu-utils fuse python-dev \
devscripts debhelper bash-completion librdmacm-dev libibverbs-dev xsltproc docbook-xsl \
libconfig-general-perl libaio-dev libc6-dev
# needed for ${!var} substitution
RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh
# Install Go & tools
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
RUN wget -O - https://storage.googleapis.com/golang/go1.7.4.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
go get github.com/rancher/trash && go get github.com/golang/lint/golint && go get github.com/prometheus/client_golang/prometheus/promhttp
# Docker
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \
DOCKER_URL=DOCKER_URL_${ARCH}
RUN wget -O /usr/bin/docker ${!DOCKER_URL} && chmod +x /usr/bin/docker
# Build TCMU
RUN cd /usr/src && \
git clone https://github.com/open-iscsi/tcmu-runner.git && \
cd tcmu-runner && \
git checkout f34b67c65b7844a6d3fcb24c2feaf7db90a889cd
RUN cd /usr/src/tcmu-runner && \
cmake . -Dwith-glfs=false && \
make && \
make install && \
cp scsi_defs.h /usr/local/include && \
cp libtcmu_static.a /usr/local/lib/libtcmu.a
# Install libqcow
RUN wget -O - https://github.com/libyal/libqcow/releases/download/20160123/libqcow-alpha-20160123.tar.gz | tar xvzf - -C /usr/src
RUN cd /usr/src/libqcow-20160123 && \
./configure
RUN cd /usr/src/libqcow-20160123 && \
make -j$(nproc) && \
make install
# Build liblonghorn
RUN cd /usr/src && \
git clone https://github.com/yasker/liblonghorn.git && \
cd liblonghorn && \
git checkout 8ef0ed67bc882457ffe63ad0f1ae49cb59c01e57 && \
make deb && \
dpkg -i ./pkg/liblonghorn_*.deb
# Build TGT
RUN cd /usr/src && \
git clone https://github.com/yasker/tgt.git && \
cd tgt && \
git checkout 6475d1ddf4ff0ac1421a96725f3d472cbb2985c7 && \
./scripts/build-pkg.sh deb && \
dpkg -i ./pkg/tgt_*.deb
VOLUME /tmp
ENV TMPDIR /tmp
ENTRYPOINT ["./scripts/entry"]
CMD ["build"]