Skip to content

Commit

Permalink
Review Dockerfile and RPMs file for odh-data-science-pipelines-operat…
Browse files Browse the repository at this point in the history
…or-controller for Konflux Build
  • Loading branch information
MohammadiIram committed Oct 8, 2024
1 parent 882c82e commit b5e97eb
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 0 deletions.
58 changes: 58 additions & 0 deletions Dockerfile.konflux
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Build arguments
ARG SOURCE_CODE=.
ARG CI_CONTAINER_VERSION="unknown"

FROM registry.redhat.io/ubi8/go-toolset@sha256:4ec05fd5b355106cc0d990021a05b71bbfb9231e4f5bdc0c5316515edf6a1c96 as builder

ARG SOURCE_CODE

WORKDIR /workspace

# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY config/internal config/internal

USER root
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go

FROM registry.redhat.io/ubi8/ubi-minimal:latest AS runtime

## Build args to be used at this step
ARG CI_CONTAINER_VERSION
ARG USER=65532

LABEL com.redhat.component="odh-data-science-pipelines-operator-controller-container" \
name="managed-open-data-hub/odh-data-science-pipelines-operator-controller-rhel8" \
version="${CI_CONTAINER_VERSION}" \
git.url="${CI_DATA_SCIENCE_PIPELINES_OPERATOR_UPSTREAM_URL}" \
git.commit="${CI_DATA_SCIENCE_PIPELINES_OPERATOR_UPSTREAM_COMMIT}" \
summary="odh-data-science-pipelines-operator-controller" \
io.openshift.expose-services="" \
io.k8s.display-name="data-science-pipelines-operator-controller" \
maintainer="['[email protected]']" \
description="Manages lifecycle of Data Science Pipelines Custom Resources and associated Kubernetes resources" \
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"

## Install additional packages
# TODO: is this needed?
RUN microdnf install -y shadow-utils &&\
microdnf clean all

WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /workspace/config/internal ./config/internal

## Create a non-root user with UID 65532 and switch to it
USER ${USER}:${USER}

ENTRYPOINT ["/manager"]
5 changes: 5 additions & 0 deletions rpms.in.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
contentOrigin:
repofiles:
- ubi.repo
packages:
- shadow-utils
22 changes: 22 additions & 0 deletions rpms.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
lockfileVersion: 1
lockfileVendor: redhat
arches:
- arch: x86_64
packages:
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libsemanage-2.9-9.el8_6.x86_64.rpm
repoid: ubi-8-baseos-rpms
size: 172128
checksum: sha256:1f686a73273028ca85b5a6ac858292d7b7d2fcbe379d6912ba12fc0a49ac4cce
name: libsemanage
evr: 2.9-9.el8_6
sourcerpm: libsemanage-2.9-9.el8_6.src.rpm
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/s/shadow-utils-4.6-22.el8.x86_64.rpm
repoid: ubi-8-baseos-rpms
size: 1292332
checksum: sha256:ea73ee201451bbca0d6d14ca434c93800f01c8fb1b9daef727a5af1a27356d07
name: shadow-utils
evr: 2:4.6-22.el8
sourcerpm: shadow-utils-4.6-22.el8.src.rpm
source: []
module_metadata: []
70 changes: 70 additions & 0 deletions ubi.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[ubi-8-baseos-rpms]
name = Red Hat Universal Base Image 8 (RPMs) - BaseOS
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/os
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

[ubi-8-baseos-debug-rpms]
name = Red Hat Universal Base Image 8 (Debug RPMs) - BaseOS
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/debug
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

[ubi-8-baseos-source]
name = Red Hat Universal Base Image 8 (Source RPMs) - BaseOS
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/source/SRPMS
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

[ubi-8-appstream-rpms]
name = Red Hat Universal Base Image 8 (RPMs) - AppStream
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/os
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

[ubi-8-appstream-debug-rpms]
name = Red Hat Universal Base Image 8 (Debug RPMs) - AppStream
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/debug
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

[ubi-8-appstream-source]
name = Red Hat Universal Base Image 8 (Source RPMs) - AppStream
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/source/SRPMS
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

[ubi-8-codeready-builder-rpms]
name = Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/os
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

[ubi-8-codeready-builder]
name = Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/os
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1


[ubi-8-codeready-builder-debug-rpms]
name = Red Hat Universal Base Image 8 (Debug RPMs) - CodeReady Builder
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/debug
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

[ubi-8-codeready-builder-source]
name = Red Hat Universal Base Image 8 (Source RPMs) - CodeReady Builder
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/source/SRPMS
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1

0 comments on commit b5e97eb

Please sign in to comment.