Build docker image for aarch64

This commit is contained in:
SweetMNM 2022-06-07 19:04:34 +03:00
parent b4a247bf37
commit 97183fff97
2 changed files with 79 additions and 71 deletions

View File

@ -24,10 +24,10 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v2
with:
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/meeb/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
cache-from: type=registry,ref=ghcr.io/meeb/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
cache-to: type=inline
# cache-from: type=registry,ref=ghcr.io/meeb/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
# cache-to: type=inline
build-args: |
IMAGE_NAME=${{ env.IMAGE_NAME }}

View File

@ -1,7 +1,16 @@
FROM debian:bullseye-slim
ARG ARCH="amd64"
ARG TARGETPLATFORM
ARG ARCH=$(case ${TARGETPLATFORM:-linux/amd64} in \
"linux/amd64") echo "amd64" ;; \
"linux/arm64") echo "aarch64" ;; \
*) echo "" ;; esac)
ARG S6_VERSION="2.2.0.3"
RUN export ARCH=$(case ${TARGETPLATFORM:-linux/amd64} in \
"linux/amd64") echo "amd64" ;; \
"linux/arm64") echo "aarch64" ;; \
*) echo "" ;; esac) \
&& echo "ARCH=${ARCH}, ARCH2=$ARCH"
ENV DEBIAN_FRONTEND="noninteractive" \
HOME="/root" \
@ -12,7 +21,6 @@ ENV DEBIAN_FRONTEND="noninteractive" \
S6_EXPECTED_SHA256="a7076cf205b331e9f8479bbb09d9df77dbb5cd8f7d12e9b74920902e0c16dd98" \
S6_DOWNLOAD="https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-${ARCH}.tar.gz"
# Install third party software
RUN set -x && \
apt-get update && \