feat: Add multi-platform support and experimental features to Docker build
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -47,6 +47,8 @@ steps:
|
||||
registry: registry.coadcorp.com
|
||||
repo: registry.coadcorp.com/nathan/invertergui
|
||||
dockerfile: Dockerfile
|
||||
platform: linux/amd64,linux/arm64
|
||||
experimental: true
|
||||
buildx_options_semicolon: --platform=linux/amd64,linux/arm64;--provenance=false
|
||||
username: nathan
|
||||
password:
|
||||
@@ -63,6 +65,8 @@ steps:
|
||||
registry: registry.coadcorp.com
|
||||
repo: registry.coadcorp.com/nathan/invertergui
|
||||
dockerfile: Dockerfile
|
||||
platform: linux/amd64,linux/arm64
|
||||
experimental: true
|
||||
buildx_options_semicolon: --platform=linux/amd64,linux/arm64;--provenance=false
|
||||
username: nathan
|
||||
password:
|
||||
@@ -82,6 +86,8 @@ steps:
|
||||
registry: registry.coadcorp.com
|
||||
repo: registry.coadcorp.com/nathan/invertergui
|
||||
dockerfile: Dockerfile
|
||||
platform: linux/amd64,linux/arm64
|
||||
experimental: true
|
||||
buildx_options_semicolon: --platform=linux/amd64,linux/arm64;--provenance=false
|
||||
username: nathan
|
||||
password:
|
||||
|
||||
10
Dockerfile
10
Dockerfile
@@ -1,9 +1,15 @@
|
||||
FROM golang:1.26-alpine as builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.26-alpine as builder
|
||||
|
||||
ARG TARGETOS=linux
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
|
||||
RUN mkdir /build
|
||||
COPY . /build/
|
||||
WORKDIR /build
|
||||
RUN CGO_ENABLED=0 go build -o invertergui ./cmd/invertergui
|
||||
RUN set -eux; \
|
||||
GOARM="${TARGETVARIANT#v}"; \
|
||||
CGO_ENABLED=0 GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" GOARM="${GOARM}" go build -o invertergui ./cmd/invertergui
|
||||
|
||||
FROM scratch
|
||||
|
||||
|
||||
Reference in New Issue
Block a user