Skip to content

Commit

Permalink
Enable hermetic builds
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek committed Jan 16, 2025
1 parent 926ad55 commit 1ab4e65
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ spec:
value: build/Dockerfile.rhtap
- name: path-context
value: .
- name: build-source-image
value: "true"
- name: hermetic
value: "true"
- name: prefetch-input
value: '[{"type": "gomod", "path": "."}]'
pipelineSpec:
description: |
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down
6 changes: 6 additions & 0 deletions .tekton/governance-policy-addon-controller-acm-213-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ spec:
value: build/Dockerfile.rhtap
- name: path-context
value: .
- name: build-source-image
value: "true"
- name: hermetic
value: "true"
- name: prefetch-input
value: '[{"type": "gomod", "path": "."}]'
pipelineSpec:
description: |
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ gosec-scan:

.PHONY: build
build: ## Build manager binary.
CGO_ENABLED=1 go build -o build/_output/bin/$(IMG) main.go
CGO_ENABLED=1 go build -mod=readonly -o build/_output/bin/$(IMG) main.go

############################################################
# images section
Expand Down
11 changes: 8 additions & 3 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ RUN /usr/local/bin/user_setup

ENTRYPOINT ["/usr/local/bin/entrypoint"]

RUN microdnf update -y && \
microdnf clean all

USER ${USER_UID}

LABEL name="rhacm2/acm-governance-policy-addon-controller-rhel9"
LABEL summary="Manage the governance addon deployed to managed clusters"
LABEL description="Manage the governance addon deployed to managed clusters"
LABEL io.k8s.display-name="Governance policy addon controller"
LABEL io.k8s.description="Manage the governance addon deployed to managed clusters"
LABEL com.redhat.component="acm-governance-policy-addon-controller-container"
LABEL io.openshift.tags="data,images"
12 changes: 8 additions & 4 deletions build/Dockerfile.rhtap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ENV COMPONENT=governance-policy-addon-controller
ENV REPO_PATH=/go/src/github.com/stolostron/${COMPONENT}
WORKDIR ${REPO_PATH}
COPY . .
RUN go mod vendor
RUN make build

# Stage 2: Copy the binaries from the image builder to the base image
Expand All @@ -27,7 +26,12 @@ RUN /usr/local/bin/user_setup

ENTRYPOINT ["/usr/local/bin/entrypoint"]

RUN microdnf update -y && \
microdnf clean all

USER ${USER_UID}

LABEL name="rhacm2/acm-governance-policy-addon-controller-rhel9"
LABEL summary="Manage the governance addon deployed to managed clusters"
LABEL description="Manage the governance addon deployed to managed clusters"
LABEL io.k8s.display-name="Governance policy addon controller"
LABEL io.k8s.description="Manage the governance addon deployed to managed clusters"
LABEL com.redhat.component="acm-governance-policy-addon-controller-container"
LABEL io.openshift.tags="data,images"

0 comments on commit 1ab4e65

Please sign in to comment.