Compare commits

..

1 Commits

Author SHA1 Message Date
Lauri Võsandi 5e64dfa04a Native builds in Docker file and multiarch build by Drone
continuous-integration/drone/push Build is passing Details
2023-09-13 11:43:20 +03:00
3 changed files with 3 additions and 12 deletions

View File

@ -1,2 +1,2 @@
kind: template
load: docker.yaml
load: docker-multiarch.yaml

View File

@ -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

View File

@ -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)