@@ -40,21 +40,33 @@ COPY config/overrides.json /overrides.json
4040COPY scripts/merge-config.py /merge.py
4141RUN python3 /merge.py /in.json /overrides.json /out.json
4242
43+ # The prepackaged plugins, with exactly one bundle per plugin id.
44+ #
45+ # Upstream's calls bundle is removed rather than left to lose on version.
46+ # Winning on version describes where a start ends up, not how it gets there:
47+ # with both present the server installs upstream's first and then has to remove
48+ # it again to put ours in its place, and that removal can fail. When it does,
49+ # the install is abandoned and the plugin directory is left holding an orphan
50+ # webapp folder with no manifest and no binary, so the server comes up with no
51+ # calls plugin at all:
52+ #
53+ # Removing existing installation of plugin before local install (1.12.2)
54+ # removePlugin: unlinkat plugins/com.mattermost.calls: directory not empty
55+ #
56+ # The base image has no shell, so this is done in a stage and copied in, the
57+ # same way the web app is.
58+ FROM docker.io/library/alpine:3.20 AS plugins
59+ COPY --from=upstream /mattermost/prepackaged_plugins /out
60+ COPY mattermore-calls.tar.gz /out/mattermore-calls-linux-amd64.tar.gz
61+ RUN rm -f /out/mattermost-plugin-calls-v*.tar.gz /out/mattermost-plugin-calls-v*.tar.gz.sig
62+
4363FROM docker.io/mattermost/mattermost-team-edition:latest
4464
4565COPY --chown=2000:2000 mattermore-server /mattermost/bin/mattermost
4666COPY --from=webapp --chown=2000:2000 /out /mattermost/client
4767COPY --from=config --chown=2000:2000 --chmod=600 /out.json /mattermost/config/config.json
68+ COPY --from=plugins --chown=2000:2000 /out /mattermost/prepackaged_plugins
4869
49- # The plugin ships as a prepackaged bundle. Upstream refuses one without a
50- # signature made with Mattermost's key, which no third party can produce, so
51- # patches/server/0007 makes the signature optional for prepackaged plugins
52- # while still verifying one that is present. RequirePluginSignature continues
53- # to govern administrator uploads, which is a different trust boundary.
54- #
55- # The stock calls bundle is left in place deliberately: ours is version
56- # 1000.12.3 and wins on version, so there is nothing to delete.
57- COPY --chown=2000:2000 mattermore-calls.tar.gz /mattermost/prepackaged_plugins/mattermore-calls-linux-amd64.tar.gz
5870
5971# Group calls are switched on by upstream's own environment variable.
6072ENV MM_CALLS_GROUP_CALLS_ALLOWED=true
0 commit comments