Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Dockefile for Konflux transition #379

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions Dockerfiles/Dockerfile.konflux
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Build the manager binary
################################################################################
FROM registry.access.redhat.com/ubi8/go-toolset@sha256:742ae6ec1aef3e7faae488c47695fb64964d342aefecf52d23bd9d5e6731d0b6 as builder
USER root
WORKDIR /opt
# copy local manifests to build
COPY opt/manifests/ /opt/manifests/
COPY prefetched-manifests/ /opt/manifests/

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 apis/ apis/
COPY components/ components/
COPY controllers/ controllers/
COPY main.go main.go
COPY pkg/ pkg/

# Copy monitoring config
COPY config/monitoring/ /opt/manifests/monitoring/
# Copy partners config
COPY config/partners/ /opt/manifests/partners/
# Copy ods-configs
COPY config/osd-configs/ /opt/manifests/osd-configs/

# Build
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o manager main.go

################################################################################
FROM registry.access.redhat.com/ubi8/ubi-minimal@sha256:d531ff26bffe832391600e8137f01b9d09a712c721ebe966b98d647bd91bc261
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --chown=1001:0 --from=builder /opt/manifests /opt/manifests
# Recursive change all files
RUN chown -R 1001:0 /opt/manifests &&\
chmod -R g=u /opt/manifests
USER 1001

ENTRYPOINT ["/manager"]

LABEL com.redhat.component="odh-operator-container" \
description="rhoai-operator" \
name="managed-open-data-hub/odh-rhel8-operator" \
summary="odh-operator" \
maintainer="['[email protected]']" \
io.openshift.expose-services="" \
io.k8s.display-name="odh-operator" \
io.k8s.description="odh-operator"
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"
Loading