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
|
||||
|
||||
WORKDIR /godoor
|
||||
|
@ -9,10 +9,11 @@ RUN go mod download && go mod verify
|
|||
|
||||
|
||||
COPY . .
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETOS
|
||||
ENV GOBUILDLDFLAGS="-linkmode 'external' -extldflags '-static'"
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=arm64
|
||||
ENV GOOS=$TARGETOS
|
||||
ENV GOARCH=$TARGETARCH
|
||||
RUN go build -tags netgo .
|
||||
|
||||
FROM scratch
|
||||
|
|
|
@ -13,6 +13,12 @@ GOOS=linux GOARCH=arm64 go build
|
|||
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
|
||||
|
||||
The CI system should automatically build docker image and push it to [Harbor](https://harbor.k-space.ee)
|
||||
|
|
Loading…
Reference in New Issue