-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stavros Foteinopoulos <[email protected]>
- Loading branch information
Showing
1 changed file
with
5 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,26 +2,18 @@ | |
ARG DOCKER_BUILD_IMAGE=golang:1.20 | ||
ARG DOCKER_BASE_IMAGE=alpine:3.19 | ||
|
||
FROM ${DOCKER_BUILD_IMAGE} AS build | ||
FROM --platform=${TARGETPLATFORM} ${DOCKER_BUILD_IMAGE} AS build | ||
ARG TARGETARCH | ||
WORKDIR /elrond/ | ||
COPY . /elrond/ | ||
ENV ARCH=${TARGETARCH} | ||
|
||
# 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" && \ | ||
make build ARCH=$ARCH | ||
RUN make build ARCH=${ARCH} | ||
RUN apt-get update -yq && apt-get install -yq unzip | ||
|
||
|
||
# Final Image | ||
FROM ${DOCKER_BASE_IMAGE} | ||
FROM --platform=${TARGETPLATFORM} ${DOCKER_BASE_IMAGE} | ||
LABEL name="Mattermost Elrond" \ | ||
maintainer="[email protected]" \ | ||
vendor="Mattermost" \ | ||
|