Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Nightly Race / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
167 lines
6.0 KiB
Docker
167 lines
6.0 KiB
Docker
FROM ubuntu:24.04
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
# Keep in sync with server/.go-version. cloud-agent-install.sh reinstalls if they drift.
|
|
ARG GO_VERSION=1.26.7
|
|
# Image pin on the .nvmrc line (currently 24.11). cloud-agent-install.sh uses .nvmrc at bootstrap.
|
|
ARG NODE_VERSION=24.11.1
|
|
ARG NVM_VERSION=0.40.3
|
|
ARG DOCKER_VERSION=5:28.5.2-1~ubuntu.24.04~noble
|
|
ARG CONTAINERD_VERSION=2.2.3-1~ubuntu.24.04~noble
|
|
ARG DOCKER_BUILDX_VERSION=0.33.0-1~ubuntu.24.04~noble
|
|
ARG DOCKER_COMPOSE_VERSION=5.1.3-1~ubuntu.24.04~noble
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV NVM_DIR=/home/ubuntu/.nvm
|
|
ENV GOPATH=/home/ubuntu/go
|
|
ENV PATH=/home/ubuntu/.nvm/versions/node/v${NODE_VERSION}/bin:/usr/local/go/bin:/home/ubuntu/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
apt-transport-https \
|
|
acl \
|
|
bash \
|
|
build-essential \
|
|
ca-certificates \
|
|
curl \
|
|
dnsutils \
|
|
file \
|
|
fuse-overlayfs \
|
|
git \
|
|
git-lfs \
|
|
gnupg \
|
|
iproute2 \
|
|
iptables \
|
|
jq \
|
|
less \
|
|
libasound2t64 \
|
|
libatk-bridge2.0-0 \
|
|
libatk1.0-0 \
|
|
libatspi2.0-0 \
|
|
libcairo2 \
|
|
libcups2 \
|
|
libdrm2 \
|
|
libgbm1 \
|
|
libgtk-3-0 \
|
|
libnspr4 \
|
|
libnss3 \
|
|
libpango-1.0-0 \
|
|
libsecret-1-0 \
|
|
libx11-xcb1 \
|
|
libxcomposite1 \
|
|
libxdamage1 \
|
|
libxfixes3 \
|
|
libxkbcommon0 \
|
|
libxrandr2 \
|
|
libxshmfence1 \
|
|
locales \
|
|
lsof \
|
|
make \
|
|
nano \
|
|
netcat-openbsd \
|
|
openssh-server \
|
|
pgloader \
|
|
pkg-config \
|
|
procps \
|
|
python3 \
|
|
python3-pip \
|
|
python3-venv \
|
|
rsync \
|
|
sudo \
|
|
tar \
|
|
tmux \
|
|
unzip \
|
|
vim \
|
|
xmlsec1 \
|
|
xz-utils \
|
|
zip && \
|
|
locale-gen en_US.UTF-8 && \
|
|
git lfs install --system && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN install -m 0755 -d /etc/apt/keyrings && \
|
|
curl --retry 3 --retry-delay 5 -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
|
|
chmod a+r /etc/apt/keyrings/docker.gpg && \
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list && \
|
|
apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
docker-ce=${DOCKER_VERSION} \
|
|
docker-ce-cli=${DOCKER_VERSION} \
|
|
containerd.io=${CONTAINERD_VERSION} \
|
|
docker-buildx-plugin=${DOCKER_BUILDX_VERSION} \
|
|
docker-compose-plugin=${DOCKER_COMPOSE_VERSION} && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN mkdir -p /etc/docker && \
|
|
printf '%s\n' \
|
|
'{' \
|
|
' "storage-driver": "fuse-overlayfs",' \
|
|
' "features": {' \
|
|
' "buildkit": true' \
|
|
' }' \
|
|
'}' > /etc/docker/daemon.json && \
|
|
update-alternatives --set iptables /usr/sbin/iptables-legacy && \
|
|
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
|
|
|
|
RUN install -m 0755 -d /etc/apt/keyrings && \
|
|
curl --retry 3 --retry-delay 5 -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /etc/apt/keyrings/githubcli-archive-keyring.gpg && \
|
|
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg && \
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list && \
|
|
apt-get update && \
|
|
apt-get install -y --no-install-recommends gh && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN case "$(dpkg --print-architecture)" in \
|
|
amd64) go_arch=amd64 ;; \
|
|
arm64) go_arch=arm64 ;; \
|
|
*) echo "Unsupported Go architecture: $(dpkg --print-architecture)" >&2; exit 1 ;; \
|
|
esac && \
|
|
curl --retry 3 --retry-delay 5 -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${go_arch}.tar.gz" -o /tmp/go.tgz && \
|
|
rm -rf /usr/local/go && \
|
|
tar -C /usr/local -xzf /tmp/go.tgz && \
|
|
ln -sfnT /usr/local/go/bin/go /usr/local/bin/go && \
|
|
ln -sfnT /usr/local/go/bin/gofmt /usr/local/bin/gofmt && \
|
|
rm -f /tmp/go.tgz
|
|
|
|
RUN case "$(dpkg --print-architecture)" in \
|
|
amd64) aws_arch=x86_64 ;; \
|
|
arm64) aws_arch=aarch64 ;; \
|
|
*) echo "Unsupported AWS CLI architecture: $(dpkg --print-architecture)" >&2; exit 1 ;; \
|
|
esac && \
|
|
curl --retry 3 --retry-delay 5 -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-${aws_arch}.zip" -o /tmp/awscliv2.zip && \
|
|
unzip -q /tmp/awscliv2.zip -d /tmp && \
|
|
/tmp/aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli && \
|
|
rm -rf /tmp/aws /tmp/awscliv2.zip
|
|
|
|
RUN install -m 0755 -d /var/run/sshd && \
|
|
printf '%s\n' 'PasswordAuthentication no' 'ChallengeResponseAuthentication no' 'UsePAM no' > /etc/ssh/sshd_config.d/disable_password_auth.conf && \
|
|
if ! id -u ubuntu >/dev/null 2>&1; then useradd -m -s /bin/bash ubuntu; fi && \
|
|
groupadd -f docker && \
|
|
usermod -aG docker,sudo ubuntu && \
|
|
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu && \
|
|
chmod 0440 /etc/sudoers.d/ubuntu && \
|
|
echo "ubuntu:ubuntu" | chpasswd && \
|
|
install -d -o ubuntu -g ubuntu "${NVM_DIR}" "${GOPATH}"
|
|
|
|
RUN git clone --depth 1 --branch "v${NVM_VERSION}" https://github.com/nvm-sh/nvm.git "${NVM_DIR}" && \
|
|
chown -R ubuntu:ubuntu "${NVM_DIR}" "${GOPATH}" && \
|
|
su ubuntu -c "bash -lc 'set -e; source ${NVM_DIR}/nvm.sh; nvm install ${NODE_VERSION}; nvm alias default ${NODE_VERSION}; nvm use default'" && \
|
|
ln -sfn "${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/node" /usr/local/bin/node && \
|
|
ln -sfn "${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/npm" /usr/local/bin/npm && \
|
|
ln -sfn "${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/npx" /usr/local/bin/npx
|
|
|
|
RUN { \
|
|
echo 'export NVM_DIR="$HOME/.nvm"'; \
|
|
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"'; \
|
|
echo 'export GOPATH="$HOME/go"'; \
|
|
echo 'export PATH="$NVM_DIR/versions/node/v24.11.1/bin:/usr/local/go/bin:$GOPATH/bin:$PATH"'; \
|
|
} >> /home/ubuntu/.bashrc && \
|
|
chown ubuntu:ubuntu /home/ubuntu/.bashrc
|
|
|
|
ENV LANG=en_US.UTF-8
|
|
ENV LC_ALL=en_US.UTF-8
|
|
|
|
WORKDIR /home/ubuntu
|
|
USER ubuntu
|