Skip to content

Commit

Permalink
Add rhtap dockerfile with allowed image references
Browse files Browse the repository at this point in the history
See the details in the associated task.

Refs:
 - https://issues.redhat.com/browse/ACM-7178

Signed-off-by: Gus Parvin <[email protected]>
  • Loading branch information
gparvin authored and openshift-ci[bot] committed Oct 25, 2023
1 parent 1448ed6 commit 0ecd13b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
spec:
params:
- name: dockerfile
value: ./Dockerfile
value: ./Dockerfile.rhtap
- name: git-url
value: '{{repo_url}}'
- name: image-expires-after
Expand Down
2 changes: 1 addition & 1 deletion .tekton/governance-policy-propagator-fm3n-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metadata:
spec:
params:
- name: dockerfile
value: ./Dockerfile
value: ./Dockerfile.rhtap
- name: git-url
value: '{{repo_url}}'
- name: output-image
Expand Down
33 changes: 33 additions & 0 deletions Dockerfile.rhtap
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Stage 1: Use image builder to build the target binaries
# Copyright Contributors to the Open Cluster Management project

FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.20 AS builder

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
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

ENV COMPONENT=governance-policy-propagator
ENV REPO_PATH=/go/src/github.com/stolostron/${COMPONENT}
ENV OPERATOR=/usr/local/bin/${COMPONENT} \
USER_UID=1001 \
USER_NAME=${COMPONENT}

# install operator binary
COPY --from=builder ${REPO_PATH}/build/_output/bin/${COMPONENT} ${OPERATOR}

COPY --from=builder ${REPO_PATH}/build/bin /usr/local/bin
RUN /usr/local/bin/user_setup

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

RUN microdnf update && \
microdnf clean all

USER ${USER_UID}

0 comments on commit 0ecd13b

Please sign in to comment.