[test] setup binfmt in qemu action

This commit is contained in:
sentriz
2021-02-09 01:12:08 +00:00
parent f73e1a0c99
commit d31ec7f666
2 changed files with 9 additions and 8 deletions

View File

@@ -15,6 +15,9 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1

View File

@@ -1,23 +1,21 @@
FROM --platform=${BUILDPLATFORM} golang:1.15-alpine AS builder FROM alpine:3.13.1 AS builder
RUN apk add -U --no-cache \ RUN apk add -U --no-cache \
build-base \ build-base \
ca-certificates \ ca-certificates \
git \ git \
sqlite \ sqlite \
taglib-dev \ taglib-dev \
alsa-lib-dev alsa-lib-dev \
go
WORKDIR /src WORKDIR /src
COPY go.mod . COPY go.mod .
COPY go.sum . COPY go.sum .
RUN go mod download RUN go mod download
COPY . . COPY . .
RUN ./_do_gen_assets
RUN ./_do_build_server
ARG TARGETOS FROM alpine:3.13.1
ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} ./_do_gen_assets
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} ./_do_build_server
FROM --platform=${BUILDPLATFORM} alpine:3.12.3
RUN apk add -U --no-cache \ RUN apk add -U --no-cache \
ffmpeg \ ffmpeg \
ca-certificates \ ca-certificates \