forked from kyverno/reports-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
764524d
commit 8ea204d
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.5-fips-cbl-mariner2.0 AS builder | ||
|
||
ENV GOPATH=/go \ | ||
PATH=/usr/local/go/bin:/go/bin:/usr/local/bin:/usr/bin:$PATH \ | ||
CGO_ENABLED=1 \ | ||
FIPS_ENABLED=1 | ||
|
||
RUN mkdir -p /go && \ | ||
tdnf install -y \ | ||
gcc gcc-c++ \ | ||
ca-certificates \ | ||
build-essential \ | ||
shadow-utils && \ | ||
tdnf clean all | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
ARG LD_FLAGS | ||
|
||
ARG TARGETARCH | ||
RUN GOOS=linux GOARCH=$TARGETARCH \ | ||
BUILD_TAGS=fips GOEXPERIMENT=systemcrypto \ | ||
CGO_ENABLED=1 FIPS_ENABLED=1 \ | ||
go build -ldflags="-s -w" -o /app/reports-server ./ | ||
|
||
RUN groupadd --system appgroup && \ | ||
useradd --system --uid 1001 --gid appgroup --home-dir /nonexistent --shell /usr/sbin/nologin appuser && \ | ||
chown appuser:appgroup /app/reports-server | ||
|
||
FROM mcr.microsoft.com/cbl-mariner/distroless/base:2.0-nonroot | ||
|
||
COPY --from=builder /etc/passwd /etc/passwd | ||
|
||
COPY --from=builder /etc/group /etc/group | ||
|
||
COPY --from=builder /app/reports-server /reports-server | ||
|
||
COPY --from=builder /etc/ssl/certs /etc/ssl/certs | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["/reports-server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters