Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions mattermost.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
FROM ubuntu:focal@sha256:ed4a42283d9943135ed87d4ee34e542f7f5ad9ecf2f244870e23122f703f91c2 AS canonical_flavour_builder
FROM ubuntu:focal@sha256:b650347f3d05a762604a103b48099273713d60e2754ed8dba158cc6b67cbdbb3 AS canonical_flavour_builder

# Avoid needing any input from package installs.
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -9,7 +12,7 @@

# Update ca-certificates before running git clone to ensure certs are up to date.
# We need version 16+ of NodeJS for `make package` to succeed.
RUN apt-get -y update && \

Check warning on line 15 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check

Check warning on line 15 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get -y upgrade && \
apt-get -y --no-install-recommends install \
ca-certificates && \
Expand All @@ -30,9 +33,9 @@
# issues in the build process. This patch will limit the open sockets connected
# to the http proxy server down to 15. The number can be adjusted by the
# NPM_HTTPS_PROXY_AGENT_MAX_SOCKETS environment variable.
COPY files/canonical_flavour/https-proxy-agent.patch patch/https-proxy-agent.patch

Check warning on line 36 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

`COPY` to a relative destination without `WORKDIR` set.

RUN curl -sSL https://github.com/TooTallNate/node-https-proxy-agent/archive/refs/tags/5.0.1.tar.gz -o node-https-proxy-agent.tar.gz && \

Check warning on line 38 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
echo "36ee41503f9245b2b8ce3e4725ac966cf9a391f4 node-https-proxy-agent.tar.gz" | shasum -c && \
tar -xf node-https-proxy-agent.tar.gz

Expand All @@ -51,12 +54,12 @@

RUN git clone -b v${mattermost_version} https://github.com/mattermost/mattermost-webapp

RUN cd mattermost-webapp && \

Check warning on line 57 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Use WORKDIR to switch to a directory
git apply /patch/themes.patch && \
npm config set progress=false loglevel=info && \
make dist

FROM ubuntu:focal@sha256:ed4a42283d9943135ed87d4ee34e542f7f5ad9ecf2f244870e23122f703f91c2
FROM ubuntu:focal@sha256:b650347f3d05a762604a103b48099273713d60e2754ed8dba158cc6b67cbdbb3

ARG edition=enterprise
ARG image_flavour=default
Expand All @@ -71,12 +74,12 @@
SHELL ["/bin/bash", "-c"]

# xmlsec1 needed if UseNewSAMLLibrary is set to false (the default)
RUN apt-get -qy update && \

Check warning on line 77 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check notice on line 77 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Delete the apt-get lists after installing something

Check notice on line 77 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Avoid additional packages by specifying `--no-install-recommends`
apt-get -qy upgrade && \
apt-get -qy install curl xmlsec1 && \
rm -f /var/lib/apt/lists/*_*

RUN mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins && \

Check warning on line 82 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
set -o pipefail && \
case $edition in \
enterprise) \
Expand All @@ -97,18 +100,18 @@
RUN tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-autolink-v1.2.2-linux-amd64.tar.gz

# Enable prepackaged plugin
RUN tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-github-v2.1.4-linux-amd64.tar.gz

Check notice on line 103 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Multiple consecutive `RUN` instructions. Consider consolidation.

# Enable prepackaged plugin
RUN tar -C /mattermost/plugins -xvzf /mattermost/prepackaged_plugins/mattermost-plugin-gitlab-v1.6.0-linux-amd64.tar.gz

Check notice on line 106 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Multiple consecutive `RUN` instructions. Consider consolidation.

# Download and enable third-party plugin
RUN cd /mattermost/plugins && \

Check warning on line 109 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check

Check warning on line 109 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Use WORKDIR to switch to a directory
set -o pipefail && \
curl -L https://github.com/matterpoll/matterpoll/releases/download/v1.4.0/com.github.matterpoll.matterpoll-1.4.0.tar.gz | tar -xvz ;

# Download and enable third-party plugin
RUN cd /mattermost/plugins && \

Check warning on line 114 in mattermost.Dockerfile

View workflow job for this annotation

GitHub Actions / unit-tests / Dockerfile lint

Use WORKDIR to switch to a directory
set -o pipefail && \
curl -L https://github.com/moussetc/mattermost-plugin-giphy/releases/download/v2.1.1/com.github.moussetc.mattermost.plugin.giphy-2.1.1.tar.gz | tar -xvz ;

Expand Down
Loading