-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support ARM builds Signed-off-by: Stavros Foteinopoulos <[email protected]> * Debug failure Signed-off-by: Stavros Foteinopoulos <[email protected]> * Refactor tagging as arm images weren't tagged properly Signed-off-by: Stavros Foteinopoulos <[email protected]> --------- Signed-off-by: Stavros Foteinopoulos <[email protected]>
- Loading branch information
Showing
10 changed files
with
122 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: 'docker-prepare' | ||
description: 'Install docker requirements' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: ci/setup-buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: v0.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,25 @@ | |
|
||
# Build the mattermost cloud | ||
ARG DOCKER_BUILD_IMAGE=golang:1.20 | ||
ARG DOCKER_BASE_IMAGE=alpine:3.18.2 | ||
ARG DOCKER_BASE_IMAGE=alpine:3.19 | ||
|
||
FROM ${DOCKER_BUILD_IMAGE} AS build | ||
WORKDIR /mattermost-cloud/ | ||
COPY . /mattermost-cloud/ | ||
RUN apt-get update -yq && apt-get install -yq unzip | ||
RUN make get-terraform get-kops get-helm get-kubectl | ||
RUN make build | ||
|
||
# Detect architecture and set ARCH | ||
RUN ARCH=$(uname -m) && \ | ||
if [ "$ARCH" = "x86_64" ]; then \ | ||
ARCH="amd64"; \ | ||
elif [ "$ARCH" = "aarch64" ]; then \ | ||
ARCH="arm64"; \ | ||
elif [ "$ARCH" = "armv7l" ] || [ "$ARCH" = "armv6l" ]; then \ | ||
ARCH="arm"; \ | ||
fi && \ | ||
echo "ARCH=$ARCH" && \ | ||
apt-get update -yq && apt-get install -yq unzip && \ | ||
make get-terraform ARCH=$ARCH get-kops ARCH=$ARCH get-helm ARCH=$ARCH get-kubectl ARCH=$ARCH && \ | ||
make build ARCH=$ARCH | ||
|
||
# Final Image | ||
FROM ${DOCKER_BASE_IMAGE} | ||
|
@@ -19,7 +30,7 @@ LABEL name="Mattermost Cloud" \ | |
maintainer="[email protected]" \ | ||
vendor="Mattermost" \ | ||
distribution-scope="public" \ | ||
architecture="x86_64" \ | ||
architecture="x86_64, arm64" \ | ||
url="https://mattermost.com" \ | ||
io.k8s.description="Mattermost Cloud creates, configures and helps manage K8s Clusters and Mattermost installations on Kubernetes" \ | ||
io.k8s.display-name="Mattermost Cloud" | ||
|
@@ -34,7 +45,7 @@ COPY --from=build /mattermost-cloud/build/kops /usr/local/bin/ | |
COPY --from=build /mattermost-cloud/build/helm /usr/local/bin/ | ||
COPY --from=build /mattermost-cloud/build/kubectl /usr/local/bin/ | ||
COPY --from=build /mattermost-cloud/manifests /mattermost-cloud/manifests | ||
COPY --from=build /mattermost-cloud/build/_output/bin/cloud /mattermost-cloud/cloud | ||
COPY --from=build /mattermost-cloud/cmd/cloud /mattermost-cloud/cloud | ||
COPY --from=build /mattermost-cloud/build/bin /usr/local/bin | ||
RUN /usr/local/bin/user_setup | ||
WORKDIR /mattermost-cloud/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
set -u | ||
|
||
make build-image-with-tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
set -u | ||
|
||
: ${GITHUB_REF_TYPE:?} | ||
: ${GITHUB_REF_NAME:?} | ||
|
||
if [ "${GITHUB_REF_TYPE:-}" = "branch" ]; then | ||
echo "Pushing latest for $GITHUB_REF_NAME..." | ||
export TAG=latest | ||
else | ||
echo "Pushing release $GITHUB_REF_NAME..." | ||
export TAG="$GITHUB_REF_NAME" | ||
fi | ||
make build-image-with-tag |