-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
159 lines (139 loc) · 5.33 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
159
FROM alpine:latest as builder
LABEL maintainer=stevesbrain,realies
ENV BITLBEE_COMMIT 0b1448f
ENV DISCORD_COMMIT ba47eed
ENV FACEBOOK_COMMIT 553593d
ENV SKYPE_COMMIT 2290013
ENV SLACK_COMMIT 39c7b5b
ENV STEAM_COMMIT a6444d2
ENV TELEGRAM_COMMIT f686f8a
ENV STRIP true
RUN set -x \
&& apk update \
&& apk upgrade \
&& apk add --virtual build-dependencies \
autoconf \
gnutls-dev \
pidgin-dev \
libgcrypt-dev \
libwebp-dev \
automake \
build-base \
curl \
git \
json-glib-dev \
libtool
RUN cd /root \
&& git clone -n https://github.com/bitlbee/bitlbee \
&& cd bitlbee \
&& git checkout ${BITLBEE_COMMIT} \
&& mkdir /bitlbee-data \
&& ./configure --purple=1 --config=/bitlbee-data \
&& make \
&& cp bitlbee / \
&& make install \
&& make install-dev \
&& make install-etc \
&& if [ "$STRIP" == "true" ]; then strip /usr/local/sbin/bitlbee; fi
FROM builder as discord-builder
RUN cd /root \
&& git clone -n https://github.com/sm00th/bitlbee-discord \
&& cd bitlbee-discord \
&& git checkout ${DISCORD_COMMIT} \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make install \
&& if [ "$STRIP" == "true" ]; then strip /usr/local/lib/bitlbee/discord.so; fi
FROM builder as facebook-builder
RUN cd /root \
&& git clone -n https://github.com/jgeboski/bitlbee-facebook \
&& cd bitlbee-facebook \
&& git checkout ${FACEBOOK_COMMIT} \
&& ./autogen.sh \
&& make \
&& make install \
&& if [ "$STRIP" == "true" ]; then strip /usr/local/lib/bitlbee/facebook.so; fi
FROM builder as skype-builder
RUN cd /root \
&& git clone -n https://github.com/EionRobb/skype4pidgin \
&& cd skype4pidgin \
&& git checkout ${SKYPE_COMMIT} \
&& cd skypeweb \
&& make \
&& make install \
&& if [ "$STRIP" == "true" ]; then strip /usr/lib/purple-2/libskypeweb.so; fi
FROM builder as slack-builder
RUN cd /root \
&& git clone -n https://github.com/dylex/slack-libpurple \
&& cd slack-libpurple \
&& git checkout ${SLACK_COMMIT} \
&& make \
&& mkdir -p /usr/share/pixmaps/pidgin/protocols/16/ \
&& mkdir -p /usr/share/pixmaps/pidgin/protocols/22/ \
&& mkdir -p /usr/share/pixmaps/pidgin/protocols/48/ \
&& make install \
&& if [ "$STRIP" == "true" ]; then strip /usr/lib/purple-2/libslack.so; fi
FROM builder as steam-builder
RUN cd /root \
&& git clone -n https://github.com/bitlbee/bitlbee-steam \
&& cd bitlbee-steam \
&& git checkout ${STEAM_COMMIT} \
&& ./autogen.sh \
&& make \
&& make install \
&& if [ "$STRIP" == "true" ]; then strip /usr/local/lib/bitlbee/steam.so; fi
FROM builder as telegram-builder
RUN cd /root \
&& git clone -n https://github.com/majn/telegram-purple \
&& cd telegram-purple \
&& git checkout ${TELEGRAM_COMMIT} \
&& git submodule update --init --recursive \
&& ./configure \
&& make \
&& make install \
&& if [ "$STRIP" == "true" ]; then strip /usr/lib/purple-2/telegram-purple.so; fi
FROM alpine:latest
LABEL maintainer=stevesbrain,realies
RUN apk update
RUN apk upgrade
RUN apk add glib \
gnutls \
json-glib \
libgcrypt \
libpurple \
libpurple-bonjour \
libpurple-oscar \
libpurple-xmpp \
libwebp \
pidgin \
&& adduser -u 1000 -S bitlbee \
&& addgroup -g 1000 -S bitlbee \
&& mkdir /bitlbee-data \
&& chown -R bitlbee:bitlbee /bitlbee-data \
&& touch /var/run/bitlbee.pid \
&& chown bitlbee:bitlbee /var/run/bitlbee.pid
COPY --from=builder /usr/local/etc/bitlbee/ /usr/local/etc/bitlbee/
COPY --from=builder /usr/local/include/bitlbee/ /usr/local/include/bitlbee/
COPY --from=builder /usr/local/lib/pkgconfig/bitlbee.pc /usr/local/lib/pkgconfig/bitlbee.pc
COPY --from=builder /usr/local/sbin/bitlbee /usr/local/sbin/bitlbee
COPY --from=builder /usr/local/share/bitlbee/help.txt /usr/local/share/bitlbee/help.txt
COPY --from=discord-builder /usr/local/lib/bitlbee/discord.* /usr/local/lib/bitlbee/
COPY --from=discord-builder /usr/local/share/bitlbee/discord-help.txt /usr/local/share/bitlbee/discord-help.txt
COPY --from=facebook-builder /usr/local/lib/bitlbee/facebook.* /usr/local/lib/bitlbee/
COPY --from=skype-builder /usr/lib/purple-2/libskypeweb.so /usr/lib/purple-2/libskypeweb.so
COPY --from=skype-builder /usr/share/pixmaps/pidgin/emotes/skype/theme /usr/share/pixmaps/pidgin/emotes/skype/theme
# don't copy pixmaps. these are not needed for bitlbee
# COPY --from=skype-builder /usr/share/pixmaps/pidgin/protocols/16/skype* /usr/share/pixmaps/pidgin/protocols/16/
# COPY --from=skype-builder /usr/share/pixmaps/pidgin/protocols/22/skype* /usr/share/pixmaps/pidgin/protocols/22/
# COPY --from=skype-builder /usr/share/pixmaps/pidgin/protocols/48/skype* /usr/share/pixmaps/pidgin/protocols/48/
COPY --from=slack-builder /usr/lib/purple-2/libslack.so /usr/lib/purple-2/libslack.so
# COPY --from=slack-builder /usr/share/pixmaps/pidgin/protocols/16/slack.png /usr/share/pixmaps/pidgin/protocols/16/slack.png
# COPY --from=slack-builder /usr/share/pixmaps/pidgin/protocols/22/slack.png /usr/share/pixmaps/pidgin/protocols/22/slack.png
# COPY --from=slack-builder /usr/share/pixmaps/pidgin/protocols/48/slack.png /usr/share/pixmaps/pidgin/protocols/48/slack.png
COPY --from=steam-builder /usr/local/lib/bitlbee/steam.* /usr/local/lib/bitlbee/
COPY --from=telegram-builder /etc/telegram-purple/server.tglpub /etc/telegram-purple/server.tglpub
COPY --from=telegram-builder /usr/lib/purple-2/telegram-purple.so /usr/lib/purple-2/telegram-purple.so
USER bitlbee
VOLUME /bitlbee-data
ENTRYPOINT ["/usr/local/sbin/bitlbee", "-F", "-n", "-d", "/bitlbee-data"]