* [fix] Dockerfile using Debian instead of Alpine We are switching to building docker container for Matermmost-server & enterprise from Alpine Linux(unsupported) to Debian(supported) This image is used for e2e testing. Rationalle: Alpine is actually unsupported distro for Mattermost-server. https://docs.mattermost.com/install/software-hardware-requirements.html#mattermost-server-operating-system On top of that, Alpine linux uses musl libc vs glibc, which can cause several issues when testing Finally We got to a point of being unable to run Alpine based mattermost instances with: `Error relocating ./mattermost: fcntl64: symbol not found` Details @ https://github.com/mattermost/mattermost-server/pull/20735 Specifically the following changes are introduced: - switching to using Debian Buster as being a supported linux flavor for Mattermost - pinning the Debian base image with SHA hash - defining Shell as bash, and enabling pipefail - pinning additional packages installed using apt - removing unused cache - improving MM_PACKAGE variable checking logic introducing non zero exit code (127) when failing - migrating adduser and addgroup command, to debian compatible - removing unused chown dirs Signed-off-by: Akis Maziotis <akis.maziotis@mattermost.com> * [fix] Using bash as a more capable shell * [fix] Installing optional packages needed for tests These packages are needed to perform succesfull end to end testing. Relevant documentation: https://docs.mattermost.com/configure/file-storage-configuration-settings.html#enable-document-search-by-content Signed-off-by: Akis Maziotis <akis.maziotis@mattermost.com>
50 строки
1.7 KiB
Docker
50 строки
1.7 KiB
Docker
FROM debian:buster-slim@sha256:5b0b1a9a54651bbe9d4d3ee96bbda2b2a1da3d2fa198ddebbced46dfdca7f216
|
|
|
|
# Setting bash as our shell, and enabling pipefail option
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
# Some ENV variables
|
|
ENV PATH="/mattermost/bin:${PATH}"
|
|
ARG PUID=2000
|
|
ARG PGID=2000
|
|
ARG MM_PACKAGE="https://releases.mattermost.com/7.1.2/mattermost-7.1.2-linux-amd64.tar.gz?src=docker"
|
|
|
|
# # Install needed packages
|
|
RUN apt-get update \
|
|
&& apt-get install --no-install-recommends -y \
|
|
ca-certificates=20200601~deb10u2 \
|
|
curl=7.64.0-4+deb10u2 \
|
|
mime-support=3.62 \
|
|
unrtf=0.21.10-clean-1 \
|
|
wv=1.2.9-4.2+b2 \
|
|
poppler-utils=0.71.0-5 \
|
|
tidy=2:5.6.0-10 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set mattermost group/user and download Mattermost
|
|
RUN mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins \
|
|
&& addgroup -gid ${PGID} mattermost \
|
|
&& adduser -q --disabled-password --uid ${PUID} --gid ${PGID} --gecos "" --home /mattermost mattermost \
|
|
&& if [ -n "$MM_PACKAGE" ]; then curl $MM_PACKAGE | tar -xvz ; \
|
|
else echo "please set the MM_PACKAGE" ; exit 127 ; fi \
|
|
&& chown -R mattermost:mattermost /mattermost /mattermost/data /mattermost/plugins /mattermost/client/plugins
|
|
|
|
# We should refrain from running as privileged user
|
|
USER mattermost
|
|
|
|
#Healthcheck to make sure container is ready
|
|
HEALTHCHECK --interval=30s --timeout=10s \
|
|
CMD curl -f http://localhost:8065/api/v4/system/ping || exit 1
|
|
|
|
# Configure entrypoint and command
|
|
COPY entrypoint.sh /
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
WORKDIR /mattermost
|
|
CMD ["mattermost"]
|
|
|
|
EXPOSE 8065 8067 8074 8075
|
|
|
|
# Declare volumes for mount point directories
|
|
VOLUME ["/mattermost/data", "/mattermost/logs", "/mattermost/config", "/mattermost/plugins", "/mattermost/client/plugins"]
|
|
|