Skip to content

Commit

Permalink
Merge pull request #230 from flacatus/pick_container
Browse files Browse the repository at this point in the history
feat: Use ose-tools for release-1.2 and enable hermetic builds
  • Loading branch information
openshift-merge-bot[bot] authored Sep 13, 2024
2 parents dc89429 + 9cccb98 commit 39517e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .tekton/rhtap-cli-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ spec:
description: Skip checks against built image
name: skip-checks
type: string
- default: "false"
- default: "true"
description: Execute the build with network isolation
name: hermetic
type: string
Expand Down
2 changes: 1 addition & 1 deletion .tekton/rhtap-cli-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
description: Skip checks against built image
name: skip-checks
type: string
- default: "false"
- default: "true"
description: Execute the build with network isolation
name: hermetic
type: string
Expand Down
22 changes: 7 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Build
#

FROM registry.redhat.io/openshift4/ose-tools-rhel9:latestt@sha256:c2a2eca448a2e1b5d73f88dcd12a6c87e5f4580512303f4e38b67acf810b4778 as ose-tools
FROM registry.access.redhat.com/ubi9/go-toolset:latest AS builder

USER root
Expand Down Expand Up @@ -45,22 +45,14 @@ COPY --from=builder /workdir/rhtap-cli/charts ./charts/
COPY --from=builder /workdir/rhtap-cli/scripts ./scripts/
COPY --from=builder /workdir/rhtap-cli/config.yaml .
COPY --from=builder /workdir/rhtap-cli/bin/rhtap-cli .
COPY --from=ose-tools /usr/bin/kubectl /usr/bin/

RUN microdnf install -y gzip shadow-utils tar && \
groupadd --gid 1000 -r rhtap-cli && \
useradd -r -d /rhtap-cli -g rhtap-cli -s /sbin/nologin --uid 1000 rhtap-cli && \
ARCH=$(uname -m) && \
KUBECTL_VERSION=$(curl -sL https://dl.k8s.io/release/stable.txt) && \
if [ "$ARCH" = "x86_64" ]; then \
curl --proto "=https" --tlsv1.2 -sSf -L -O "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"; \
elif [ "$ARCH" = "aarch64" ]; then \
curl --proto "=https" --tlsv1.2 -sSf -L -O "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/arm64/kubectl"; \
fi && \
chmod +x kubectl && \
mv kubectl /usr/bin/kubectl && \
microdnf remove -y shadow-utils && \
microdnf clean all
RUN groupadd --gid 1000 -r rhtap-cli && \
useradd -r -d /rhtap-cli -g rhtap-cli -s /sbin/nologin --uid 1000 rhtap-cli

USER rhtap-cli

# Debug
RUN kubectl version --client

ENTRYPOINT ["/rhtap-cli/rhtap-cli"]

0 comments on commit 39517e9

Please sign in to comment.