- [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
18 lines
No EOL
534 B
Docker
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" ] |