From c12a94bb3aab0ced743d9c6a5789133ffdc36b6f Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Wed, 18 Oct 2023 09:08:55 -0500 Subject: [PATCH] :seedling: Add dockerfile for rhtap (#10) Signed-off-by: zhujian --- .tekton/addon-manager-pull-request.yaml | 2 +- .tekton/addon-manager-push.yaml | 2 +- .tekton/placement-pull-request.yaml | 2 +- .tekton/placement-push.yaml | 2 +- .../registration-operator-pull-request.yaml | 2 +- .tekton/registration-operator-push.yaml | 2 +- .tekton/registration-pull-request.yaml | 2 +- .tekton/registration-push.yaml | 2 +- .tekton/work-pull-request.yaml | 2 +- .tekton/work-push.yaml | 2 +- build/Dockerfile.addon.rhtap | 17 +++++++++++++++++ build/Dockerfile.placement.rhtap | 18 ++++++++++++++++++ build/Dockerfile.registration-operator.rhtap | 18 ++++++++++++++++++ build/Dockerfile.registration.rhtap | 18 ++++++++++++++++++ build/Dockerfile.work.rhtap | 18 ++++++++++++++++++ 15 files changed, 99 insertions(+), 10 deletions(-) create mode 100644 build/Dockerfile.addon.rhtap create mode 100644 build/Dockerfile.placement.rhtap create mode 100644 build/Dockerfile.registration-operator.rhtap create mode 100644 build/Dockerfile.registration.rhtap create mode 100644 build/Dockerfile.work.rhtap diff --git a/.tekton/addon-manager-pull-request.yaml b/.tekton/addon-manager-pull-request.yaml index 053fcc03a..2d82abacf 100644 --- a/.tekton/addon-manager-pull-request.yaml +++ b/.tekton/addon-manager-pull-request.yaml @@ -19,7 +19,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.addon + value: ./build/Dockerfile.addon.rhtap - name: git-url value: '{{repo_url}}' - name: image-expires-after diff --git a/.tekton/addon-manager-push.yaml b/.tekton/addon-manager-push.yaml index abab51454..d54a4db45 100644 --- a/.tekton/addon-manager-push.yaml +++ b/.tekton/addon-manager-push.yaml @@ -18,7 +18,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.addon + value: ./build/Dockerfile.addon.rhtap - name: git-url value: '{{repo_url}}' - name: output-image diff --git a/.tekton/placement-pull-request.yaml b/.tekton/placement-pull-request.yaml index b85473f07..a905c5807 100644 --- a/.tekton/placement-pull-request.yaml +++ b/.tekton/placement-pull-request.yaml @@ -19,7 +19,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.placement + value: ./build/Dockerfile.placement.rhtap - name: git-url value: '{{repo_url}}' - name: image-expires-after diff --git a/.tekton/placement-push.yaml b/.tekton/placement-push.yaml index 4c17bc498..cc0527b43 100644 --- a/.tekton/placement-push.yaml +++ b/.tekton/placement-push.yaml @@ -18,7 +18,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.placement + value: ./build/Dockerfile.placement.rhtap - name: git-url value: '{{repo_url}}' - name: output-image diff --git a/.tekton/registration-operator-pull-request.yaml b/.tekton/registration-operator-pull-request.yaml index 65c5f9e07..6e0668d64 100644 --- a/.tekton/registration-operator-pull-request.yaml +++ b/.tekton/registration-operator-pull-request.yaml @@ -19,7 +19,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.registration-operator + value: ./build/Dockerfile.registration-operator.rhtap - name: git-url value: '{{repo_url}}' - name: image-expires-after diff --git a/.tekton/registration-operator-push.yaml b/.tekton/registration-operator-push.yaml index 8069ed81e..2140d4dbd 100644 --- a/.tekton/registration-operator-push.yaml +++ b/.tekton/registration-operator-push.yaml @@ -18,7 +18,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.registration-operator + value: ./build/Dockerfile.registration-operator.rhtap - name: git-url value: '{{repo_url}}' - name: output-image diff --git a/.tekton/registration-pull-request.yaml b/.tekton/registration-pull-request.yaml index aa3706335..c12e8abb6 100644 --- a/.tekton/registration-pull-request.yaml +++ b/.tekton/registration-pull-request.yaml @@ -19,7 +19,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.registration + value: ./build/Dockerfile.registration.rhtap - name: git-url value: '{{repo_url}}' - name: image-expires-after diff --git a/.tekton/registration-push.yaml b/.tekton/registration-push.yaml index e7322a374..077e12588 100644 --- a/.tekton/registration-push.yaml +++ b/.tekton/registration-push.yaml @@ -18,7 +18,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.registration + value: ./build/Dockerfile.registration.rhtap - name: git-url value: '{{repo_url}}' - name: output-image diff --git a/.tekton/work-pull-request.yaml b/.tekton/work-pull-request.yaml index cff71b86d..509d14dd3 100644 --- a/.tekton/work-pull-request.yaml +++ b/.tekton/work-pull-request.yaml @@ -19,7 +19,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.work + value: ./build/Dockerfile.work.rhtap - name: git-url value: '{{repo_url}}' - name: image-expires-after diff --git a/.tekton/work-push.yaml b/.tekton/work-push.yaml index 1947ac7ed..e391c0352 100644 --- a/.tekton/work-push.yaml +++ b/.tekton/work-push.yaml @@ -18,7 +18,7 @@ metadata: spec: params: - name: dockerfile - value: ./build/Dockerfile.work + value: ./build/Dockerfile.work.rhtap - name: git-url value: '{{repo_url}}' - name: output-image diff --git a/build/Dockerfile.addon.rhtap b/build/Dockerfile.addon.rhtap new file mode 100644 index 000000000..6ff2718b0 --- /dev/null +++ b/build/Dockerfile.addon.rhtap @@ -0,0 +1,17 @@ +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.20 AS builder +ARG OS=linux +ARG ARCH=amd64 +WORKDIR /go/src/open-cluster-management.io/ocm +COPY . . +ENV GO_PACKAGE open-cluster-management.io/ocm + +RUN GOOS=${OS} \ + GOARCH=${ARCH} \ + GO_BUILD_PACKAGES=./cmd/addon \ + make build --warn-undefined-variables + +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +ENV USER_UID=10001 +COPY --from=builder /go/src/open-cluster-management.io/ocm/addon / + +USER ${USER_UID} diff --git a/build/Dockerfile.placement.rhtap b/build/Dockerfile.placement.rhtap new file mode 100644 index 000000000..fd2e7375c --- /dev/null +++ b/build/Dockerfile.placement.rhtap @@ -0,0 +1,18 @@ +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.20 AS builder +ARG OS=linux +ARG ARCH=amd64 +WORKDIR /go/src/open-cluster-management.io/ocm +COPY . . +ENV GO_PACKAGE open-cluster-management.io/ocm + +RUN GOOS=${OS} \ + GOARCH=${ARCH} \ + GO_BUILD_PACKAGES=./cmd/placement \ + make build --warn-undefined-variables + +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +ENV USER_UID=10001 + +COPY --from=builder /go/src/open-cluster-management.io/ocm/placement / + +USER ${USER_UID} diff --git a/build/Dockerfile.registration-operator.rhtap b/build/Dockerfile.registration-operator.rhtap new file mode 100644 index 000000000..606ef0936 --- /dev/null +++ b/build/Dockerfile.registration-operator.rhtap @@ -0,0 +1,18 @@ +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.20 AS builder +ARG OS=linux +ARG ARCH=amd64 +WORKDIR /go/src/open-cluster-management.io/ocm +COPY . . +ENV GO_PACKAGE open-cluster-management.io/ocm + +RUN GOOS=${OS} \ + GOARCH=${ARCH} \ + GO_BUILD_PACKAGES=./cmd/registration-operator \ + make build --warn-undefined-variables + +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +ENV USER_UID=10001 + +COPY --from=builder /go/src/open-cluster-management.io/ocm/registration-operator / + +USER ${USER_UID} diff --git a/build/Dockerfile.registration.rhtap b/build/Dockerfile.registration.rhtap new file mode 100644 index 000000000..35a1d0486 --- /dev/null +++ b/build/Dockerfile.registration.rhtap @@ -0,0 +1,18 @@ +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.20 AS builder +ARG OS=linux +ARG ARCH=amd64 +WORKDIR /go/src/open-cluster-management.io/ocm +COPY . . +ENV GO_PACKAGE open-cluster-management.io/ocm + +RUN GOOS=${OS} \ + GOARCH=${ARCH} \ + GO_BUILD_PACKAGES=./cmd/registration \ + make build --warn-undefined-variables + +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +ENV USER_UID=10001 + +COPY --from=builder /go/src/open-cluster-management.io/ocm/registration / + +USER ${USER_UID} diff --git a/build/Dockerfile.work.rhtap b/build/Dockerfile.work.rhtap new file mode 100644 index 000000000..3474ac769 --- /dev/null +++ b/build/Dockerfile.work.rhtap @@ -0,0 +1,18 @@ +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.20 AS builder +ARG OS=linux +ARG ARCH=amd64 +WORKDIR /go/src/open-cluster-management.io/ocm +COPY . . +ENV GO_PACKAGE open-cluster-management.io/ocm + +RUN GOOS=${OS} \ + GOARCH=${ARCH} \ + GO_BUILD_PACKAGES=./cmd/work \ + make build --warn-undefined-variables + +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +ENV USER_UID=10001 + +COPY --from=builder /go/src/open-cluster-management.io/ocm/work / + +USER ${USER_UID}