Skip to content

Enable hermetic builds #932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-propagator-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 @@ -102,7 +102,7 @@ gosec-scan: GOSEC_ARGS=-exclude G201

.PHONY: build
build:
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/governance-policy-propagator-rhel9"
LABEL summary="Propagate Policies to managed cluster namespaces"
LABEL description="Propagate Policies from user namespaces to managed cluster namespaces as defined by the PlacementBinding and bound Placement."
LABEL io.k8s.display-name="Governance policy propagator"
LABEL io.k8s.description="Propagate Policies from user namespaces to managed cluster namespaces as defined by the PlacementBinding and bound Placement."
LABEL com.redhat.component="acm-governance-policy-propagator-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-propagator
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/governance-policy-propagator-rhel9"
LABEL summary="Propagate Policies to managed cluster namespaces"
LABEL description="Propagate Policies from user namespaces to managed cluster namespaces as defined by the PlacementBinding and bound Placement."
LABEL io.k8s.display-name="Governance policy propagator"
LABEL io.k8s.description="Propagate Policies from user namespaces to managed cluster namespaces as defined by the PlacementBinding and bound Placement."
LABEL com.redhat.component="acm-governance-policy-propagator-container"
LABEL io.openshift.tags="data,images"
Loading