Compare commits
1 Commits
master
...
multiarchd
Author | SHA1 | Date |
---|---|---|
Arti Zirk | 9ff6217a12 |
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.21-alpine as build
|
FROM --platform=$BUILDPLATFORM golang:1.21-alpine as build
|
||||||
RUN apk add ca-certificates
|
RUN apk add ca-certificates
|
||||||
|
|
||||||
WORKDIR /godoor
|
WORKDIR /godoor
|
||||||
|
@ -9,10 +9,11 @@ RUN go mod download && go mod verify
|
||||||
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
ARG TARGETARCH
|
||||||
|
ARG TARGETOS
|
||||||
ENV GOBUILDLDFLAGS="-linkmode 'external' -extldflags '-static'"
|
ENV GOBUILDLDFLAGS="-linkmode 'external' -extldflags '-static'"
|
||||||
ENV GOOS=linux
|
ENV GOOS=$TARGETOS
|
||||||
ENV GOARCH=arm64
|
ENV GOARCH=$TARGETARCH
|
||||||
RUN go build -tags netgo .
|
RUN go build -tags netgo .
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
|
@ -13,6 +13,12 @@ GOOS=linux GOARCH=arm64 go build
|
||||||
scp godoor rpi4b:
|
scp godoor rpi4b:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Cross platform buils with containerd/nerdctl
|
||||||
|
|
||||||
|
sudo nerdctl build --tag godoor --output type=oci --platform linux/amd64,linux/arm64 .
|
||||||
|
|
||||||
|
Nerdctl needs `type=oci` passed to its BuildKit backend, otherwise it will build a legacy Docker image.
|
||||||
|
|
||||||
# Deployment
|
# Deployment
|
||||||
|
|
||||||
The CI system should automatically build docker image and push it to [Harbor](https://harbor.k-space.ee)
|
The CI system should automatically build docker image and push it to [Harbor](https://harbor.k-space.ee)
|
||||||
|
|
Loading…
Reference in New Issue