add aarch64/arm64 docker build

Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
Zoey 2022-12-23 22:51:51 +01:00
parent c1a6a6f586
commit 44a1a68db7
No known key found for this signature in database
GPG key ID: 02A3919EB4F67328
4 changed files with 27 additions and 6 deletions

View file

@ -16,6 +16,9 @@ jobs:
- name: Check Out Repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v4
@ -61,6 +64,7 @@ jobs:
with:
context: .
file: ./docker/server/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
@ -77,6 +81,9 @@ jobs:
- name: Check Out Repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v4
@ -125,6 +132,7 @@ jobs:
with:
context: .
file: ./docker/proxy/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View file

@ -13,6 +13,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
@ -21,6 +24,7 @@ jobs:
with:
context: .
file: docker/server/Dockerfile
platforms: linux/amd64,linux/arm64
proxy:
runs-on: ubuntu-latest
@ -28,6 +32,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
@ -36,3 +43,4 @@ jobs:
with:
context: .
file: docker/proxy/Dockerfile
platforms: linux/amd64,linux/arm64

View file

@ -1,12 +1,14 @@
FROM golang:1.19 AS builder
FROM --platform=${BUILDPLATFORM} golang:1.19 AS builder
ARG TARGETARCH
ARG TARGETOS
WORKDIR /workdir
COPY . .
RUN apt-get -y update && \
apt-get -y install protobuf-compiler && \
if [ -d "vendor" ]; then GOPROXY=off make proxy -j$(nproc); else \
make proxy -j$(nproc); fi
if [ -d "vendor" ]; then GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=off make proxy -j$(nproc); else \
GOOS=${TARGETOS} GOARCH=${TARGETARCH} make proxy -j$(nproc); fi
FROM alpine:3

View file

@ -1,12 +1,15 @@
FROM golang:1.19 AS builder
FROM --platform=${BUILDPLATFORM} golang:1.19 AS builder
WORKDIR /workdir
ARG TARGETARCH
ARG TARGETOS
COPY . .
RUN apt-get -y update && \
apt-get -y install protobuf-compiler && \
if [ -d "vendor" ]; then GOPROXY=off make server -j$(nproc); else \
make server -j$(nproc); fi
if [ -d "vendor" ]; then GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=off make server -j$(nproc); else \
GOOS=${TARGETOS} GOARCH=${TARGETARCH} make server -j$(nproc); fi
FROM alpine:3