Merge ~pjdc/charm-k8s-mattermost/+git/image-build:build-flavours into ~mattermost-charmers/charm-k8s-mattermost/+git/mattermost-k8s-image-builder:master

Proposed by Paul Collins
Status: Merged
Approved by: Paul Collins
Approved revision: 0e8b4201986821bf5e6e01b4306db00fe012efd2
Merged at revision: 67430a17ef017525cdc81bfa71ac81a119ed0371
Proposed branch: ~pjdc/charm-k8s-mattermost/+git/image-build:build-flavours
Merge into: ~mattermost-charmers/charm-k8s-mattermost/+git/mattermost-k8s-image-builder:master
Diff against target: 102 lines (+47/-15)
2 files modified
Dockerfile (+31/-13)
README.md (+16/-2)
Reviewer Review Type Date Requested Status
Haw Loeung +1 Approve
Junien F Approve
Review via email: mp+392911@code.launchpad.net

Commit message

add image_flavour build arg, and use it; update README.md

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Junien F (axino) wrote :

+1

review: Approve
Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM

review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 67430a17ef017525cdc81bfa71ac81a119ed0371

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Dockerfile b/Dockerfile
2index 14ed709..ee86adc 100644
3--- a/Dockerfile
4+++ b/Dockerfile
5@@ -6,8 +6,8 @@ SHELL ["/bin/bash", "-c"]
6 ENV MM_VERSION=5.27.0
7 ENV MM_WEBAPP=mattermost-webapp.tar.gz
8
9-# Build argument to set Mattermost edition
10 ARG edition=enterprise
11+ARG image_flavour=default
12 ARG PUID=2000
13 ARG PGID=2000
14 ARG MM_BINARY=
15@@ -29,23 +29,41 @@ RUN mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins &&
16 addgroup --gid ${PGID} mattermost && \
17 adduser --no-create-home --disabled-password --gecos "" --uid ${PUID} --gid ${PGID} --home /mattermost mattermost
18
19-RUN rm -rf /mattermost/client && \
20- set -o pipefail && \
21- curl http://archive.admin.canonical.com/other/mattermost-webapp/${MM_VERSION}-canonical/${MM_WEBAPP} | tar -C /mattermost -xvz
22+# Enable prepackaged plugin
23+RUN if [ "$image_flavour" = canonical ]; then \
24+ tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-autolink-v1.1.2-linux-amd64.tar.gz ; \
25+ fi
26
27-RUN tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-autolink-v1.1.2-linux-amd64.tar.gz
28+# Enable prepackaged plugin
29+RUN if [ "$image_flavour" = canonical ]; then \
30+ tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-github-v0.14.0-linux-amd64.tar.gz ; \
31+ fi
32
33-RUN tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-github-v0.14.0-linux-amd64.tar.gz
34+# Enable prepackaged plugin
35+RUN if [ "$image_flavour" = canonical ]; then \
36+ tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-gitlab-v1.1.0-linux-amd64.tar.gz ; \
37+ fi
38
39-RUN tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-gitlab-v1.1.0-linux-amd64.tar.gz
40+# Download and enable third-party plugin
41+RUN if [ "$image_flavour" = canonical ]; then \
42+ cd /mattermost/plugins && \
43+ set -o pipefail && \
44+ curl -L https://github.com/moussetc/mattermost-plugin-giphy/releases/download/v1.3.0/com.github.moussetc.mattermost.plugin.giphy-1.3.0.tar.gz | tar -xvz ; \
45+ fi
46
47-RUN cd /mattermost/plugins && \
48- set -o pipefail && \
49- curl -L https://github.com/moussetc/mattermost-plugin-giphy/releases/download/v1.3.0/com.github.moussetc.mattermost.plugin.giphy-1.3.0.tar.gz | tar -xvz
50+# Download and enable third-party plugin
51+RUN if [ "$image_flavour" = canonical ]; then \
52+ cd /mattermost/plugins && \
53+ set -o pipefail && \
54+ curl -L https://github.com/scottleedavis/mattermost-plugin-remind/releases/download/0.4.4/com.github.scottleedavis.mattermost-plugin-remind-0.4.4.tar.gz | tar -xvz ; \
55+ fi
56
57-RUN cd /mattermost/plugins && \
58- set -o pipefail && \
59- curl -L https://github.com/scottleedavis/mattermost-plugin-remind/releases/download/0.4.4/com.github.scottleedavis.mattermost-plugin-remind-0.4.4.tar.gz | tar -xvz
60+# Canonical's custom webapp
61+RUN if [ "$image_flavour" = canonical ]; then \
62+ rm -rf /mattermost/client && \
63+ set -o pipefail && \
64+ curl http://archive.admin.canonical.com/other/mattermost-webapp/${MM_VERSION}-canonical/${MM_WEBAPP} | tar -C /mattermost -xvz ; \
65+ fi
66
67 HEALTHCHECK CMD curl --fail http://localhost:8065 || exit 1
68
69diff --git a/README.md b/README.md
70index b023907..b1ce82e 100644
71--- a/README.md
72+++ b/README.md
73@@ -1,9 +1,20 @@
74 # Mattermost Docker
75
76 This project allows building a simple docker image of Mattermost.
77-It does not include the databse.
78+It does not include a database.
79
80-The Mattermost configuration can be changed by setting MM_* environment variables, as explained in the Mattermost documentation:
81+## Build Flavours
82+
83+This Dockerfile supports two "image flavours": a default flavour, and
84+a "canonical" flavour.
85+
86+The "canonical" flavour is probably not directly useful unless you are
87+updating Canonical's Mattermost, but may be of interest as it shows
88+how to enable both prepackaged plugins and downloaded plugins.
89+
90+## Configuration
91+
92+As well as via the System Console, the Mattermost configuration can be changed by setting MM_* environment variables, as explained in the Mattermost documentation:
93 > Find the setting in config.json. In this case, ServiceSettings.SiteURL.
94 >
95 > Add MM_ to the beginning and convert all characters to uppercase and replace the . with _. For example, MM_SERVICESETTINGS_SITEURL.
96@@ -11,3 +22,6 @@ The Mattermost configuration can be changed by setting MM_* environment variable
97 > The setting becomes export MM_SERVICESETTINGS_SITEURL="http://example.com".
98
99 https://docs.mattermost.com/administration/config-settings.html
100+
101+Note that configuration values set in this manner are no longer
102+changeable via the System Console.

Subscribers

People subscribed via source and target branches