notify/docker-slimbuild
Marcel S. Henselin 82f727210d
All checks were successful
Sample Testing / my_job (push) Successful in 59s
chore: use image instead of build
2026-04-17 14:57:40 +02:00

31 lines
738 B
Text

FROM golang:1.26 AS builder
RUN apt-get update && apt-get -y install upx
WORKDIR /app
#RUN mkdir -p $GOPATH/src/github.com/DTherHtun/google-chat-action
#ADD . $GOPATH/src/github.com/DTherHtun/google-chat-action
# RUN go get -u github.com/sethvargo/go-githubactions/...
ENV CGO_ENABLED=0
COPY . .
RUN go mod tidy && go build \
-a \
-trimpath \
-ldflags "-s -w -extldflags '-static'" \
-installsuffix cgo \
-tags netgo \
-o /bin/google-chat-action \
.
RUN strip /bin/google-chat-action
RUN upx -q -9 /bin/google-chat-action
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /bin/google-chat-action /bin/google-chat-action
ENTRYPOINT ["/bin/google-chat-action"]