diff --git a/components/notebook-controller/Dockerfile.konflux b/components/notebook-controller/Dockerfile.konflux index e22de93c3ff..f20c41f0d0d 100644 --- a/components/notebook-controller/Dockerfile.konflux +++ b/components/notebook-controller/Dockerfile.konflux @@ -1,6 +1,5 @@ # Build arguments ARG SOURCE_CODE=. -ARG GOLANG_VERSION=1.21 # Use ubi8/go-toolset as base image FROM registry.access.redhat.com/ubi8/go-toolset@sha256:bd2057262d0876188976f79d2246717994de9e03dd589b1e6471dd2b2777204f as builder @@ -10,29 +9,26 @@ ARG TARGETARCH ## Build args to be used at this step ARG SOURCE_CODE -#WORKDIR /workspace - WORKDIR /opt/rhods + # Copy the Go Modules manifests COPY ${SOURCE_CODE}/notebook-controller ./notebook-controller -COPY ${SOURCE_CODE}/odh-notebook-controller ./odh-notebook-controller -WORKDIR /opt/rhods/odh-notebook-controller +# This is necessary because the Jupyter controller now depends on +# components/common +COPY ${SOURCE_CODE}/common ./common + +# Update building workdir +WORKDIR /opt/rhods/notebook-controller ## Build the odh-notebook-controller USER root # Build -RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} GO111MODULE=on go build -tags strictfipsruntime -a -o ./bin/manager main.go +RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -tags strictfipsruntime -a -o ./bin/manager main.go -# 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 cd /workspace/odh-notebook-controller && go mod download - -#WORKDIR /workspace/odh-notebook-controller # Use ubi8/ubi-minimal as base image -FROM registry.redhat.io/ubi8/ubi-minimal@sha256:c12e67af6a7e15113d76bc72f10bef2045c026c71ec8b7124c8a075458188a83 - +FROM registry.access.redhat.com/ubi8/ubi-minimal@sha256:7583ca0ea52001562bd81a961da3f75222209e6192e4e413ee226cff97dbd48c ## Install additional packages RUN microdnf install -y shadow-utils &&\ @@ -44,8 +40,9 @@ RUN useradd --uid 1001 --create-home --user-group --system rhods ## Set workdir directory to user home WORKDIR /home/rhods -## Copy odh-notebook-controller-manager binary from builder stage -COPY --from=builder /opt/rhods/odh-notebook-controller/bin/manager . +COPY --from=builder \ + /opt/rhods/notebook-controller/bin/manager \ + /manager ## Switch to a non-root user USER 1001:0 @@ -58,6 +55,7 @@ LABEL com.redhat.component="odh-notebook-controller-container" \ summary="odh-notebook-controller" \ maintainer="['managed-open-data-hub@redhat.com']" \ io.openshift.expose-services="" \ + io.openshift.tags="" \ io.k8s.display-name="odh-notebook-controller" \ io.k8s.description="odh-notebook-controller" \ com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"