-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile
122 lines (99 loc) · 4.51 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
FROM debian:buster as builder
ARG VERSION=1.14.0
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install build-essential git default-jdk-headless dh-systemd gradle python3-all
RUN git clone https://github.com/LINBIT/linstor-server.git /linstor-server
WORKDIR /linstor-server
RUN git checkout v${VERSION}
RUN make debrelease \
&& rm -rf /root/.gradle/caches/ \
&& mv linstor-server-${VERSION}.tar.gz /linstor-server_${VERSION}.orig.tar.gz \
&& tar -C / -xvf /linstor-server_${VERSION}.orig.tar.gz
WORKDIR /linstor-server-${VERSION}
RUN dpkg-buildpackage -us -uc
# ------------------------------------------------------------------------------
FROM debian:buster as utils-builder
ARG UTILS_VERSION=9.18.2
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install build-essential debhelper git flex clitest xsltproc locales libxml2-utils po4a bash-completion dh-systemd docbook-xsl udev asciidoctor
RUN git clone --recurse-submodules https://github.com/LINBIT/drbd-utils /drbd-utils
WORKDIR /drbd-utils
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN git checkout v${UTILS_VERSION} \
&& git submodule update --init --force --checkout \
&& install /dev/null /usr/local/bin/lbvers.py \
&& ./autogen.sh \
&& ./configure \
&& make debrelease VERSION=${UTILS_VERSION} \
&& mv drbd-utils-${UTILS_VERSION}.tar.gz ../drbd-utils_${UTILS_VERSION}.orig.tar.gz \
&& tar -C / -xvf ../drbd-utils_${UTILS_VERSION}.orig.tar.gz
WORKDIR /drbd-utils-${UTILS_VERSION}
RUN dpkg-buildpackage -us -uc
ARG THIN_SEND_RECV_VERSION=0.24
RUN git clone --recurse-submodules https://github.com/LINBIT/thin-send-recv /thin-send-recv
WORKDIR /thin-send-recv
RUN git checkout v${THIN_SEND_RECV_VERSION} \
&& make debrelease \
&& mv thin-send-recv-${THIN_SEND_RECV_VERSION}.tar.gz ../thin-send-recv_${THIN_SEND_RECV_VERSION}.orig.tar.gz \
&& tar -C / -xvf ../thin-send-recv_${THIN_SEND_RECV_VERSION}.orig.tar.gz
WORKDIR /thin-send-recv-${THIN_SEND_RECV_VERSION}
RUN dpkg-buildpackage -us -uc
# ------------------------------------------------------------------------------
FROM debian:buster as reactor-builder
ARG REACTOR_VERSION=0.4.3
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install build-essential debhelper git cargo rustc dh-python
RUN git clone --recurse-submodules https://github.com/LINBIT/drbd-reactor /drbd-reactor
WORKDIR /drbd-reactor
RUN git checkout v${REACTOR_VERSION} \
&& install /dev/null /usr/local/bin/lbvers.py \
&& make debrelease VERSION=${REACTOR_VERSION} \
&& mv drbd-reactor-${REACTOR_VERSION}.tar.gz ../drbd-reactor_${REACTOR_VERSION}.orig.tar.gz \
&& tar -C / -xvf ../drbd-reactor_${REACTOR_VERSION}.orig.tar.gz
WORKDIR /drbd-reactor-${REACTOR_VERSION}
RUN dpkg-buildpackage -us -uc
# ------------------------------------------------------------------------------
FROM debian:buster
COPY --from=builder /linstor-common_*_all.deb /linstor-satellite_*_all.deb /packages/
COPY --from=utils-builder /python-linstor_*_all.deb /drbd-utils_*_amd64.deb /thin-send-recv_*_amd64.deb /packages/
COPY --from=reactor-builder /drbd-reactor_*_amd64.deb /packages/
# Install repos and system upgrade
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update \
&& apt-get -y upgrade \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install linstor-satellite
RUN apt-get update \
&& apt-get install -y default-jre-headless thin-provisioning-tools python3-toml \
&& dpkg -i packages/*.deb \
&& sed -i "s|'$| \"-Djdk.tls.acknowledgeCloseNotify=true\"'|" \
/usr/share/linstor-server/bin/Satellite \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /config /logs
# Install additional tools
RUN sed -i '/^deb / s/main/main contrib/' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends -y zfsutils-linux cryptsetup nvme-cli zstd socat curl \
&& apt-get download lvm2 \
&& dpkg --unpack lvm2*.deb \
&& rm -f lvm2*.deb /var/lib/dpkg/info/lvm2.postinst \
&& apt-get -fy install \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i /etc/lvm/lvm.conf \
-e "s%#\? \?\(use_lvmetad *=\).*%\1 0%" \
-e "s%#\? \?\(error_when_full *=\).*%\1 1%" \
-e "s%#\? \?\(global_filter *=\).*%\1 [ \"r|/dev/drbd.*|\", \"r|/dev/dm-.*|\", \"r|/dev/zd.*|\" ]%"
ENTRYPOINT [ "/usr/share/linstor-server/bin/Satellite", "--logs=/logs", "--config-directory=/config" ]