FROM golang:1.20 AS build WORKDIR /go/src/git.k-space.ee/k-space/goredirect COPY go.mod go.sum ./ RUN go mod download COPY main.go . RUN go build -ldflags "-linkmode 'external' -extldflags '-static'" -o /go/server . FROM scratch WORKDIR / COPY --from=build /go/server /server CMD ["/server"]