forked from opendatahub-io/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00ce5d6
commit 8159f18
Showing
1 changed file
with
13 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="['[email protected]']" \ | ||
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" |