-
Notifications
You must be signed in to change notification settings - Fork 90
/
Dockerfile
158 lines (109 loc) · 5.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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
FROM debian:bullseye-backports as base
ARG DEBIAN_FRONTEND=noninteractive
ARG APT_LISTCHANGES_FRONTEND=none
RUN apt-get update -qq
RUN apt-get install --no-install-recommends -y dpkg-dev devscripts curl git
RUN echo "deb [signed-by=/etc/apt/trusted.gpg.d/spectrumim.gpg] https://packages.spectrum.im/spectrum2/ bullseye main" | tee -a /etc/apt/sources.list
RUN echo "deb-src [signed-by=/etc/apt/trusted.gpg.d/spectrumim.gpg] https://packages.spectrum.im/spectrum2/ bullseye main" | tee -a /etc/apt/sources.list
RUN curl https://packages.spectrum.im/packages.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/spectrumim.gpg
RUN apt-get update -qq
RUN apt-get build-dep --no-install-recommends -y spectrum2
RUN apt-get install --no-install-recommends -y libminiupnpc-dev libnatpmp-dev
RUN apt-get install --no-install-recommends -y cmake
#TODO include in Build-Depends
RUN apt-get install --no-install-recommends -y libssl-dev
# Spectrum 2
COPY . spectrum2/
FROM base as test
ARG DEBIAN_FRONTEND=noninteractive
ARG APT_LISTCHANGES_FRONTEND=none
WORKDIR /spectrum2
RUN apt-get install --no-install-recommends -y prosody ngircd python3-sleekxmpp python3-dateutil python3-dnspython libcppunit-dev purple-xmpp-carbons libglib2.0-dev psmisc
RUN cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=ON -DENABLE_QT4=OFF -DCMAKE_UNITY_BUILD=ON . && make -j4
ENTRYPOINT ["make", "extended_test"]
FROM base as test-clang
ARG DEBIAN_FRONTEND=noninteractive
ARG APT_LISTCHANGES_FRONTEND=none
RUN curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN echo 'deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main' > /etc/apt/sources.list.d/llvm.list
RUN apt-get update -qq
RUN apt-get install --no-install-recommends -y libcppunit-dev clang-13 lld-13
WORKDIR /spectrum2
RUN cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=ON -DENABLE_QT4=OFF -DCMAKE_UNITY_BUILD=ON -DCMAKE_C_COMPILER=/usr/bin/clang-13 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-13 -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld . && make -j4
ENTRYPOINT ["make", "test"]
FROM ghcr.io/spectrumim/alpine:1.0.1 as test-musl
COPY . /spectrum2/
WORKDIR /spectrum2
RUN cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=ON -DENABLE_QT4=OFF -DENABLE_WEBUI=OFF -DCMAKE_UNITY_BUILD=ON . && make -j4
ENTRYPOINT ["make", "test"]
FROM base as staging
ARG DEBIAN_FRONTEND=noninteractive
ARG APT_LISTCHANGES_FRONTEND=none
WORKDIR /spectrum2/packaging/debian/
RUN /bin/bash ./build_spectrum2.sh
RUN apt-get install --no-install-recommends -y libjson-glib-dev \
graphicsmagick-imagemagick-compat libsecret-1-dev libnss3-dev \
libwebp-dev libgcrypt20-dev libpng-dev libglib2.0-dev \
libprotobuf-c-dev protobuf-c-compiler libmarkdown2-dev libopusfile-dev
RUN echo "---> Installing purple-instagram" && \
git clone https://github.com/EionRobb/purple-instagram.git && \
cd purple-instagram && \
make && \
make DESTDIR=/tmp/out install
RUN echo "---> Installing icyque" && \
git clone https://github.com/EionRobb/icyque.git && \
cd icyque && \
make && \
make DESTDIR=/tmp/out install
RUN echo "---> Install Steam" && \
git clone https://github.com/EionRobb/pidgin-opensteamworks.git && \
cd pidgin-opensteamworks/steam-mobile && \
make && \
make DESTDIR=/tmp/out install
RUN echo "---> Install Teams" && \
git clone https://github.com/EionRobb/purple-teams.git && \
cd purple-teams && \
git checkout c0b5d9947e359c6cc8d54ee76af8dba116e0ec72 && \
make && \
make DESTDIR=/tmp/out install
RUN echo "---> purple-battlenet" && \
git clone --recursive https://github.com/EionRobb/purple-battlenet && \
cd purple-battlenet && \
make && \
make DESTDIR=/tmp/out install
RUN echo "---> purple-hangouts" && \
git clone --recursive https://github.com/EionRobb/purple-hangouts && \
cd purple-hangouts && \
make && \
make DESTDIR=/tmp/out install
RUN echo "---> purple-mattermost" && \
git clone --recursive https://github.com/EionRobb/purple-mattermost && \
cd purple-mattermost && \
make && \
make DESTDIR=/tmp/out install
FROM debian:bullseye-slim as production
EXPOSE 8080
VOLUME ["/etc/spectrum2/transports", "/var/lib/spectrum2"]
RUN apt-get update -qq
RUN apt-get install --no-install-recommends -y curl ca-certificates gnupg1 gpg gpg-agent
RUN echo "deb [signed-by=/etc/apt/trusted.gpg.d/spectrumim.gpg] https://packages.spectrum.im/spectrum2/ bullseye main" | tee -a /etc/apt/sources.list
RUN curl -fsSL https://packages.spectrum.im/packages.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/spectrumim.gpg
RUN apt-get update -qq
COPY --from=staging spectrum2/packaging/debian/*.deb /tmp/
RUN echo "---> Installing libpurple plugins" && \
DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y \
pidgin-sipe \
libpurple-telegram-tdlib \
libtdjson1.7.9 \
purple-discord \
purple-facebook \
libmarkdown2 \
skypeweb \
libogg0 libopusfile0 \
/tmp/*.deb \
nodejs \
&& rm -rf /var/lib/apt/lists/*
COPY --from=staging /tmp/out/* /usr/
COPY --from=staging spectrum2/packaging/docker/run.sh /run.sh
RUN rm -rf /tmp/*.deb
ENTRYPOINT ["/run.sh"]