1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00
Files
sap-jenkins-library/Dockerfile
Ivan Nikiforov 26e145d300 chore(deps): Update go version 1.24 (#5277)
* Bump go version 1.23.4->1.24

* Update go version 1.24.0 for github workflows

* Update go version 1.23.4->1.24.0 for docker images

* Replace deprecated cipher.NewCFBDecrypter/NewCFBEncrypter

* Fix go vet error: non-constant format string

* Fix go vet error: non-constant format string

* Update cmd/golangBuild.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

---------

Co-authored-by: Ivan Nikiforov <ivan.nikiforov@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2025-02-27 15:11:55 +01:00

25 lines
885 B
Docker

FROM golang:1.24.0 AS build-env
COPY . /build
WORKDIR /build
# execute tests
RUN go test ./... -tags=unit -cover
## ONLY tests so far, building to be added later
# execute build
# with `-tags release` we ensure that shared test utilities won't end up in the binary
RUN export GIT_COMMIT=$(git rev-parse HEAD) && \
export GIT_REPOSITORY=$(git config --get remote.origin.url) && \
CGO_ENABLED=0 go build \
-ldflags \
"-X github.com/SAP/jenkins-library/cmd.GitCommit=${GIT_COMMIT} \
-X github.com/SAP/jenkins-library/pkg/log.LibraryRepository=${GIT_REPOSITORY} \
-X github.com/SAP/jenkins-library/pkg/log.LibraryName=piper-lib-os \
-X github.com/SAP/jenkins-library/pkg/telemetry.LibraryRepository=${GIT_REPOSITORY}" \
-tags release \
-o piper
# FROM gcr.io/distroless/base:latest
# COPY --from=build-env /build/piper /piper
# ENTRYPOINT ["/piper"]