forked from kubeflow/model-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
3 changed files
with
76 additions
and
5 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 +1,45 @@ | ||
FROM | ||
# Build the model-registry binary | ||
FROM registry.access.redhat.com/ubi8/go-toolset:1.19 as builder | ||
|
||
WORKDIR /workspace | ||
# Copy the Go Modules manifests | ||
COPY ["go.mod", "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 | ||
USER root | ||
COPY ["Makefile", "main.go", "gqlgen.yml", "./"] | ||
|
||
# Download protoc compiler v24.3 | ||
RUN wget -q https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip -O protoc.zip && \ | ||
unzip -q protoc.zip && \ | ||
bin/protoc --version && \ | ||
rm protoc.zip | ||
|
||
# Download tools | ||
RUN make deps | ||
|
||
# Copy rest of the source | ||
COPY bin/ bin/ | ||
COPY cmd/ cmd/ | ||
COPY api/ api/ | ||
COPY config/ config/ | ||
COPY internal/ internal/ | ||
|
||
# Build | ||
USER root | ||
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 make clean model-registry | ||
|
||
# Use distroless as minimal base image to package the model-registry binary | ||
# Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6 | ||
WORKDIR / | ||
# copy the metadata library | ||
COPY --from=builder /workspace/config ./config | ||
# copy the registry binary | ||
COPY --from=builder /workspace/model-registry . | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/model-registry"] |
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
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