goshorly/Dockerfile
Phil 802b93bdaf
Some checks failed
ci/woodpecker/push/99-release-bot Pipeline was successful
ci/woodpecker/push/1-build-check unknown status
ci/woodpecker/push/10-build-dev unknown status
ci/woodpecker/push/0-pre Pipeline failed
[CI Workflow] Improvments for next releses and logic (#11)
- [X] Changed latest / dev builds (security)
- [x]  Changed logic behind build and tags (breaking)
- [x]  Make more checks and buildflags (feature)
- [x]  New releases for @renovate-bot (enhancement)

Reviewed-on: #11
2025-04-07 17:41:41 +00:00

18 lines
No EOL
534 B
Docker

FROM golang:1.24.2-alpine AS builder
ENV I_PACKAGE="git.hackmi.ch/Phil/goshorly/utils"
ENV CGO_ENABLED=0
RUN apk add --no-cache git make build-base
WORKDIR /go/src/git.hackmi.ch/goshorly
COPY . .
RUN go get -d -v ./...
RUN go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app .
FROM scratch AS production
WORKDIR /
COPY --from=builder /go/src/git.hackmi.ch/goshorly/app /app
ENTRYPOINT [ "/app" ]