Skip to content
Snippets Groups Projects
Commit 7cf7eb8b authored by Jonas Leder's avatar Jonas Leder
Browse files

optimize build speed and size

parent 7dad4643
Branches
No related tags found
No related merge requests found
Pipeline #53925 passed
FROM golang:1.23.4-bookworm AS build FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx
FROM --platform=$BUILDPLATFORM golang:1.23.5 AS build
ARG TARGETPLATFORM
COPY --from=xx / /
WORKDIR /app WORKDIR /app
COPY go.mod go.sum ./ COPY go.mod go.sum ./
RUN go mod download RUN go mod download
COPY *.go ./ COPY ./ ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /gotifyWebhookForwarder RUN CGO_ENABLED=0 GOOS=linux xx-go build -ldflags "-w -s" -o /gotifyWebhookForwarder
FROM alpine:3.21.2
RUN apk add --no-cache ca-certificates FROM jonasled.dev/infra/images/scratch-rootless@sha256:2de6d042f1ed137351ebd4d21906158576cd048b46887a0e94805282ba98a49b
COPY --from=build /gotifyWebhookForwarder /gotifyWebhookForwarder COPY --from=build /gotifyWebhookForwarder /gotifyWebhookForwarder
ENTRYPOINT ["/gotifyWebhookForwarder"] ENTRYPOINT ["/gotifyWebhookForwarder"]
EXPOSE 3333 EXPOSE 3333
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment