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 1 commit
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
64 changes: 64 additions & 0 deletions Dockerfiles/Dockerfile.konflux
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Build the manager binary
ARG GOLANG_VERSION=1.21
ARG USE_LOCAL=true
ARG OVERWRITE_MANIFESTS=""


################################################################################
FROM registry.access.redhat.com/ubi8/go-toolset@sha256:742ae6ec1aef3e7faae488c47695fb64964d342aefecf52d23bd9d5e6731d0b6 as builder_local_true
# Get all manifests from local to builder_local_true
USER root
WORKDIR /opt
# copy local manifests to build
COPY opt/manifests/ /opt/manifests/
COPY prefetched-manifests/ /opt/manifests/
RUN ls -l /opt/manifests/
################################################################################
FROM builder_local_${USE_LOCAL} as builder
USER root
WORKDIR /workspace
dchourasia marked this conversation as resolved.
Show resolved Hide resolved
# 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:latest
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-codeflare-operator-container" \
description="odh-operator" \
name="managed-open-data-hub/odh-codeflare-operator-container-rhel8" \
summary="odh-codeflare-operator-container" \
maintainer="['[email protected]']" \
io.openshift.expose-services="" \
io.k8s.display-name="odh-codeflare-operator-container" \
io.k8s.description="odh-codeflare-operator"
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"
dchourasia marked this conversation as resolved.
Show resolved Hide resolved
Loading