This commit is contained in:
Hyatt 2022-01-30 14:21:07 -06:00
parent d81e63b5d8
commit 8b4b589903
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

View File

@ -14,18 +14,19 @@ COPY generic-sidecar-injector/ /go/src/app/
WORKDIR /go/src/app
RUN apk add --no-cache git upx && \\
RUN set -x && \\
apk add --no-cache git upx && \\
addgroup -S -g 1000 app && \\
adduser --disabled-password -G app --gecos "application account" --home "/home/app" --shell "/sbin/nologin" --no-create-home --uid 1000 app && \\
go mod download && \\
GIT_HASH="$$(git rev-parse --short HEAD) && GIT_TAG=$$(git tag | tail -1)"" && \\
GIT_HASH="\$(git rev-parse --short HEAD) && GIT_TAG=\$(git tag | tail -1)"" && \\
CGO_ENABLED="0" && \\
GOOS="linux" && \\
GOARCH="amd64" && \\
go build \\
-v \\
-tags timetzdata \\
-ldflags="-s -w -X 'github.com/salesforce/generic-sidecar-injector/pkg/metrics.gitHash=$${GIT_HASH}' -X 'github.com/salesforce/generic-sidecar-injector/pkg/metrics.gitTag=$${GIT_TAG}'" \\
-ldflags="-s -w -X 'github.com/salesforce/generic-sidecar-injector/pkg/metrics.gitHash=\${GIT_HASH}' -X 'github.com/salesforce/generic-sidecar-injector/pkg/metrics.gitTag=\${GIT_TAG}'" \\
-installsuffix cgo \\
-o sidecarinjector \\
./cmd/sidecarinjector && \\