Skip to content

Commit

Permalink
Add dockerfile and required rpms for pac
Browse files Browse the repository at this point in the history
Signed-off-by: savitaashture <[email protected]>
  • Loading branch information
savitaashture committed Oct 25, 2024
1 parent f2fdb3d commit 637e2b9
Show file tree
Hide file tree
Showing 7 changed files with 791 additions and 0 deletions.
33 changes: 33 additions & 0 deletions openshift/dockerfiles/cli.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG GO_BUILDER=brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22
ARG RUNTIME=registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:c0e70387664f30cd9cf2795b547e4a9a51002c44a4a86aa9335ab030134bf392

FROM $GO_BUILDER AS builder

ARG TKN_PAC_VERSION=nightly
WORKDIR /go/src/github.com/openshift-pipelines/pipelines-as-code
COPY . .
RUN set -e; for f in patches/*.patch; do echo ${f}; [[ -f ${f} ]] || continue; git apply ${f}; done
ENV GODEBUG="http2server=0"
RUN go build -mod=vendor -tags disable_gcp -v \
-ldflags "-X github.com/openshift-pipelines/pipelines-as-code/pkg/params/version.Version=${TKN_PAC_VERSION}" \
-o /tmp/tkn-pac ./cmd/tkn-pac

FROM $RUNTIME
ARG VERSION=pipelines-as-code-cli-main

COPY --from=builder /tmp/tkn-pac /usr/bin

LABEL \
com.redhat.component="openshift-pipelines-cli-tkn-pac-container" \
name="openshift-pipelines/pipelines-cli-tkn-pac-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift pipelines tkn pac CLI" \
maintainer="[email protected]" \
description="CLI client 'tkn-pac' for managing openshift pipelines" \
io.k8s.display-name="Red Hat OpenShift Pipelines tkn pac CLI" \
io.k8s.description="Red Hat OpenShift Pipelines tkn pac CLI" \
io.openshift.tags="pipelines,tekton,openshift"

RUN microdnf install -y shadow-utils
RUN groupadd -r -g 65532 nonroot && useradd --no-log-init -r -u 65532 -g nonroot nonroot
USER 65532
35 changes: 35 additions & 0 deletions openshift/dockerfiles/controller.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ARG GO_BUILDER=brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22
ARG RUNTIME=registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:c0e70387664f30cd9cf2795b547e4a9a51002c44a4a86aa9335ab030134bf392

FROM $GO_BUILDER AS builder

WORKDIR /go/src/github.com/openshift-pipelines/pipelines-as-code
COPY . .
RUN set -e; for f in patches/*.patch; do echo ${f}; [[ -f ${f} ]] || continue; git apply ${f}; done
ENV GODEBUG="http2server=0"
RUN go build -mod=vendor -tags disable_gcp -v -o /tmp/pipelines-as-code-controller \
./cmd/pipelines-as-code-controller

FROM $RUNTIME
ARG VERSION=pipelines-as-code-controller-main

ENV KO_APP=/ko-app

COPY --from=builder /tmp/pipelines-as-code-controller ${KO_APP}/pipelines-as-code-controller

LABEL \
com.redhat.component="openshift-pipelines-pipelines-as-code-controller-container" \
name="openshift-pipelines/pipelines-pipelines-as-code-controller-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Pipelines Pipelines as Code Controller" \
maintainer="[email protected]" \
description="Red Hat OpenShift Pipelines Pipelines as Code Controller" \
io.k8s.display-name="Red Hat OpenShift Pipelines Pipelines as Code Controller" \
io.k8s.description="Red Hat OpenShift Pipelines Pipelines as Code Controller" \
io.openshift.tags="pipelines,tekton,openshift"

RUN microdnf install -y shadow-utils
RUN groupadd -r -g 65532 nonroot && useradd --no-log-init -r -u 65532 -g nonroot nonroot
USER 65532

ENTRYPOINT ["/ko-app/pipelines-as-code-controller"]
36 changes: 36 additions & 0 deletions openshift/dockerfiles/watcher.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ARG GO_BUILDER=brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22
ARG RUNTIME=registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:c0e70387664f30cd9cf2795b547e4a9a51002c44a4a86aa9335ab030134bf392

FROM $GO_BUILDER AS builder

WORKDIR /go/src/github.com/openshift-pipelines/pipelines-as-code
COPY . .
RUN set -e; for f in patches/*.patch; do echo ${f}; [[ -f ${f} ]] || continue; git apply ${f}; done
ENV GODEBUG="http2server=0"

RUN go build -mod=vendor -tags disable_gcp -v -o /tmp/pipelines-as-code-watcher \
./cmd/pipelines-as-code-watcher

FROM $RUNTIME
ARG VERSION=pipelines-as-code-watcher-main

ENV KO_APP=/ko-app

COPY --from=builder /tmp/pipelines-as-code-watcher ${KO_APP}/pipelines-as-code-watcher

LABEL \
com.redhat.component="openshift-pipelines-pipelines-as-code-watcher-container" \
name="openshift-pipelines/pipelines-as-code-watcher-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Pipelines Pipelines as Code Watcher" \
maintainer="[email protected]" \
description="Red Hat OpenShift Pipelines Pipelines as Code Watcher" \
io.k8s.display-name="Red Hat OpenShift Pipelines Pipelines as Code Watcher" \
io.k8s.description="Red Hat OpenShift Pipelines Pipelines as Code Watcher" \
io.openshift.tags="pipelines,tekton,openshift"

RUN microdnf install -y shadow-utils
RUN groupadd -r -g 65532 nonroot && useradd --no-log-init -r -u 65532 -g nonroot nonroot
USER 65532

ENTRYPOINT ["/ko-app/pipelines-as-code-watcher"]
35 changes: 35 additions & 0 deletions openshift/dockerfiles/webhook.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ARG GO_BUILDER=brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22
ARG RUNTIME=registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:c0e70387664f30cd9cf2795b547e4a9a51002c44a4a86aa9335ab030134bf392

FROM $GO_BUILDER AS builder

WORKDIR /go/src/github.com/openshift-pipelines/pipelines-as-code
COPY . .
RUN set -e; for f in patches/*.patch; do echo ${f}; [[ -f ${f} ]] || continue; git apply ${f}; done
ENV GODEBUG="http2server=0"
RUN go build -mod=vendor -tags disable_gcp -v -o /tmp/pipelines-as-code-webhook \
./cmd/pipelines-as-code-webhook

FROM $RUNTIME
ARG VERSION=pipelines-as-code-webhook-main

ENV KO_APP=/ko-app

COPY --from=builder /tmp/pipelines-as-code-webhook ${KO_APP}/pipelines-as-code-webhook

LABEL \
com.redhat.component="openshift-pipelines-pipelines-as-code-webhook-container" \
name="openshift-pipelines/pipelines-pipelines-as-code-webhook-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Pipelines Pipelines as Code Webhook" \
maintainer="[email protected]" \
description="Red Hat OpenShift Pipelines Pipelines as Code Webhook" \
io.k8s.display-name="Red Hat OpenShift Pipelines Pipelines as Code Webhook" \
io.k8s.description="Red Hat OpenShift Pipelines Pipelines as Code Webhook" \
io.openshift.tags="pipelines,tekton,openshift"

RUN microdnf install -y shadow-utils
RUN groupadd -r -g 65532 nonroot && useradd --no-log-init -r -u 65532 -g nonroot nonroot
USER 65532

ENTRYPOINT ["/ko-app/pipelines-as-code-webhook"]
10 changes: 10 additions & 0 deletions openshift/rpms/rpms.in.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
contentOrigin:
repofiles:
- ./ubi.repo
packages: [shadow-utils]
arches:
# The list of architectures
- aarch64
- x86_64
- ppc64le
- s390x
Loading

0 comments on commit 637e2b9

Please sign in to comment.