Compare commits
1 Commits
multiarchd
...
master
Author | SHA1 | Date |
---|---|---|
Lauri Võsandi | 5e64dfa04a |
|
@ -1,2 +1,2 @@
|
|||
kind: template
|
||||
load: docker.yaml
|
||||
load: docker-multiarch.yaml
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM --platform=$BUILDPLATFORM golang:1.21-alpine as build
|
||||
FROM golang:1.21-alpine as build
|
||||
RUN apk add ca-certificates
|
||||
|
||||
WORKDIR /godoor
|
||||
|
@ -9,11 +9,8 @@ RUN go mod download && go mod verify
|
|||
|
||||
|
||||
COPY . .
|
||||
ARG TARGETARCH
|
||||
ARG TARGETOS
|
||||
|
||||
ENV GOBUILDLDFLAGS="-linkmode 'external' -extldflags '-static'"
|
||||
ENV GOOS=$TARGETOS
|
||||
ENV GOARCH=$TARGETARCH
|
||||
RUN go build -tags netgo .
|
||||
|
||||
FROM scratch
|
||||
|
|
|
@ -13,12 +13,6 @@ 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