feat: Add multi-platform build support for Linux binaries and Dockerfiles
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:
43
.drone.yml
43
.drone.yml
@@ -33,6 +33,19 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- CGO_ENABLED=0 go build -v ./cmd/invertergui
|
- CGO_ENABLED=0 go build -v ./cmd/invertergui
|
||||||
|
|
||||||
|
- name: build-linux-binaries
|
||||||
|
image: cache.coadcorp.com/library/golang:1.26
|
||||||
|
environment:
|
||||||
|
GOFLAGS: -mod=mod
|
||||||
|
commands:
|
||||||
|
- mkdir -p dist
|
||||||
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o dist/invertergui-linux-amd64 ./cmd/invertergui
|
||||||
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -v -o dist/invertergui-linux-arm64 ./cmd/invertergui
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- tag
|
||||||
|
|
||||||
- name: docker-build-validate
|
- name: docker-build-validate
|
||||||
image: gcr.io/kaniko-project/executor:v1.24.0
|
image: gcr.io/kaniko-project/executor:v1.24.0
|
||||||
commands:
|
commands:
|
||||||
@@ -46,11 +59,8 @@ steps:
|
|||||||
settings:
|
settings:
|
||||||
registry: registry.coadcorp.com
|
registry: registry.coadcorp.com
|
||||||
repo: "registry.coadcorp.com/nathan/invertergui"
|
repo: "registry.coadcorp.com/nathan/invertergui"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile.publish.amd64
|
||||||
platform: "linux/amd64"
|
platform: "linux/amd64"
|
||||||
build_args:
|
|
||||||
- TARGETOS=linux
|
|
||||||
- TARGETARCH=amd64
|
|
||||||
username: nathan
|
username: nathan
|
||||||
password:
|
password:
|
||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
@@ -65,11 +75,8 @@ steps:
|
|||||||
settings:
|
settings:
|
||||||
registry: registry.coadcorp.com
|
registry: registry.coadcorp.com
|
||||||
repo: "registry.coadcorp.com/nathan/invertergui"
|
repo: "registry.coadcorp.com/nathan/invertergui"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile.publish.arm64
|
||||||
platform: "linux/arm64"
|
platform: "linux/arm64"
|
||||||
build_args:
|
|
||||||
- TARGETOS=linux
|
|
||||||
- TARGETARCH=arm64
|
|
||||||
username: nathan
|
username: nathan
|
||||||
password:
|
password:
|
||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
@@ -100,11 +107,8 @@ steps:
|
|||||||
settings:
|
settings:
|
||||||
registry: registry.coadcorp.com
|
registry: registry.coadcorp.com
|
||||||
repo: "registry.coadcorp.com/nathan/invertergui"
|
repo: "registry.coadcorp.com/nathan/invertergui"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile.publish.amd64
|
||||||
platform: "linux/amd64"
|
platform: "linux/amd64"
|
||||||
build_args:
|
|
||||||
- TARGETOS=linux
|
|
||||||
- TARGETARCH=amd64
|
|
||||||
username: nathan
|
username: nathan
|
||||||
password:
|
password:
|
||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
@@ -122,11 +126,8 @@ steps:
|
|||||||
settings:
|
settings:
|
||||||
registry: registry.coadcorp.com
|
registry: registry.coadcorp.com
|
||||||
repo: "registry.coadcorp.com/nathan/invertergui"
|
repo: "registry.coadcorp.com/nathan/invertergui"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile.publish.arm64
|
||||||
platform: "linux/arm64"
|
platform: "linux/arm64"
|
||||||
build_args:
|
|
||||||
- TARGETOS=linux
|
|
||||||
- TARGETARCH=arm64
|
|
||||||
username: nathan
|
username: nathan
|
||||||
password:
|
password:
|
||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
@@ -163,11 +164,8 @@ steps:
|
|||||||
settings:
|
settings:
|
||||||
registry: registry.coadcorp.com
|
registry: registry.coadcorp.com
|
||||||
repo: "registry.coadcorp.com/nathan/invertergui"
|
repo: "registry.coadcorp.com/nathan/invertergui"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile.publish.amd64
|
||||||
platform: "linux/amd64"
|
platform: "linux/amd64"
|
||||||
build_args:
|
|
||||||
- TARGETOS=linux
|
|
||||||
- TARGETARCH=amd64
|
|
||||||
username: nathan
|
username: nathan
|
||||||
password:
|
password:
|
||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
@@ -182,11 +180,8 @@ steps:
|
|||||||
settings:
|
settings:
|
||||||
registry: registry.coadcorp.com
|
registry: registry.coadcorp.com
|
||||||
repo: "registry.coadcorp.com/nathan/invertergui"
|
repo: "registry.coadcorp.com/nathan/invertergui"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile.publish.arm64
|
||||||
platform: "linux/arm64"
|
platform: "linux/arm64"
|
||||||
build_args:
|
|
||||||
- TARGETOS=linux
|
|
||||||
- TARGETARCH=arm64
|
|
||||||
username: nathan
|
username: nathan
|
||||||
password:
|
password:
|
||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
|
|||||||
8
Dockerfile.publish.amd64
Normal file
8
Dockerfile.publish.amd64
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
FROM scratch
|
||||||
|
|
||||||
|
# Group ID 20 is dialout, needed for tty read/write access
|
||||||
|
USER 3000:20
|
||||||
|
ENV READ_ONLY=false
|
||||||
|
COPY dist/invertergui-linux-amd64 /bin/invertergui
|
||||||
|
ENTRYPOINT ["/bin/invertergui"]
|
||||||
|
EXPOSE 8080
|
||||||
8
Dockerfile.publish.arm64
Normal file
8
Dockerfile.publish.arm64
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
FROM scratch
|
||||||
|
|
||||||
|
# Group ID 20 is dialout, needed for tty read/write access
|
||||||
|
USER 3000:20
|
||||||
|
ENV READ_ONLY=false
|
||||||
|
COPY dist/invertergui-linux-arm64 /bin/invertergui
|
||||||
|
ENTRYPOINT ["/bin/invertergui"]
|
||||||
|
EXPOSE 8080
|
||||||
Reference in New Issue
Block a user