Skip to content

Commit 1d428a8

Browse files
committed
prosody: use a 2-stage build
This greatly simplifies the cleanup so we don't leave unneeded packages behind.
1 parent 613c26c commit 1d428a8

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

prosody/Dockerfile

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
ARG JITSI_REPO=jitsi
2+
3+
FROM ${JITSI_REPO}/base as builder
4+
5+
RUN \
6+
apt-dpkg-wrap apt-get update \
7+
&& apt-dpkg-wrap apt-get install -y \
8+
lua5.2 \
9+
liblua5.2-dev \
10+
libsasl2-dev \
11+
libssl1.0-dev \
12+
luarocks \
13+
git \
14+
gcc \
15+
&& luarocks install cyrussasl 1.1.0-1 \
16+
&& luarocks install lua-cjson 2.1.0-1 \
17+
&& luarocks install luajwtjitsi 1.3-7 \
18+
&& luarocks install net-url 0.9-1
19+
220
FROM ${JITSI_REPO}/base
321

422
ADD https://prosody.im/files/prosody-debian-packages.key /tmp/prosody.key
@@ -14,28 +32,10 @@ RUN \
1432
sasl2-bin \
1533
libsasl2-modules-ldap \
1634
lua-basexx \
17-
liblua5.2-dev \
18-
libsasl2-dev \
19-
libssl1.0-dev \
20-
luarocks \
21-
git \
22-
gcc \
2335
patch \
2436
&& apt-dpkg-wrap apt-get install -t stretch-backports -y \
2537
lua-ldap \
2638
lua-sec \
27-
&& luarocks install cyrussasl 1.1.0-1 \
28-
&& luarocks install lua-cjson 2.1.0-1 \
29-
&& luarocks install luajwtjitsi 1.3-7 \
30-
&& luarocks install net-url 0.9-1 \
31-
&& apt-dpkg-wrap apt-get remove --purge -y \
32-
git \
33-
gcc \
34-
luarocks \
35-
libsasl2-dev \
36-
libssl1.0-dev \
37-
liblua5.2-dev \
38-
&& apt-dpkg-wrap apt-get autoremove --purge -y \
3939
&& apt-cleanup \
4040
&& rm -rf /etc/prosody
4141

@@ -51,6 +51,9 @@ RUN patch -d /usr/lib/prosody/modules/muc -p0 < /prosody-plugins/muc_owner_allow
5151

5252
COPY rootfs/ /
5353

54+
COPY --from=builder /usr/local/lib/lua /usr/local/lib/lua
55+
COPY --from=builder /usr/local/share/lua /usr/local/share/lua
56+
5457
EXPOSE 5222 5269 5347 5280
5558

5659
VOLUME ["/config", "/prosody-plugins-custom"]

0 commit comments

Comments
 (0)