Skip to content

Commit

Permalink
remove arm64 and add gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
amittiwari28 committed Jan 24, 2025
1 parent 764524d commit 8ea204d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
43 changes: 43 additions & 0 deletions :qa
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"]
1 change: 1 addition & 0 deletions Dockerfile.fips
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ENV GOPATH=/go \

RUN mkdir -p /go && \
tdnf install -y \
gcc gcc-c++ \
ca-certificates \
build-essential \
shadow-utils && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ docker-publish-reports-server-fips: docker-buildx-builder docker-build-and-push-
docker-build-and-push-reports-server-fips: docker-buildx-builder
@docker buildx build --file $(PWD)/Dockerfile.fips \
--progress plain \
--platform linux/amd64,linux/arm64 \
--platform linux/amd64 \
--tag $(REPO_REPORTS_SERVER_FIPS)$(IMAGE_TAG) \
. \
--build-arg LD_FLAGS=$(LD_FLAGS) \
Expand Down

0 comments on commit 8ea204d

Please sign in to comment.