Skip to content

Commit

Permalink
Distroless image for TF operator (#1124)
Browse files Browse the repository at this point in the history
* Initial commit for a distroless image
TF operator packed in distroless container
tf_smoke.py removed

* Changing CMD in test infra deployment

* Adds / to opt in copy
  • Loading branch information
krishnadurai authored and k8s-ci-robot committed Jan 18, 2020
1 parent a8845a2 commit 9238906
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
21 changes: 6 additions & 15 deletions build/images/tf_operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
FROM golang:1.10 AS build-image
FROM golang:1.13.5 AS build-image

ADD . /go/src/github.com/kubeflow/tf-operator

WORKDIR /go/src/github.com/kubeflow/tf-operator

RUN go build -o tf-operator.v1 ./cmd/tf-operator.v1

FROM registry.access.redhat.com/ubi8/ubi:latest
FROM gcr.io/distroless/base-debian10

# TODO(jlewi): We should probably change the directory to /opt/kubeflow.
RUN mkdir -p /opt/kubeflow/samples
COPY third_party/library/license.txt /opt/license.txt

COPY tf_smoke.py /opt/kubeflow/samples/
RUN chmod a+x /opt/kubeflow/samples/*
COPY vendor /opt/

COPY --from=build-image /go/src/github.com/kubeflow/tf-operator/tf-operator.v1 /opt/kubeflow
COPY --from=build-image /go/src/github.com/kubeflow/tf-operator/tf-operator.v1 /opt/

COPY third_party/library/license.txt /opt/kubeflow/license.txt

RUN mkdir -p /opt/kubeflow/vendor
COPY vendor /opt/kubeflow/vendor/

RUN chmod a+x /opt/kubeflow/tf-operator.v1

ENTRYPOINT ["/opt/kubeflow/tf-operator.v1"]
ENTRYPOINT ["/opt/tf-operator.v1"]
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
containers: [
{
command: [
"/opt/kubeflow/tf-operator.v1",
"/opt/tf-operator.v1",
"--alsologtostderr",
"-v=1",
],
Expand Down

0 comments on commit 9238906

Please sign in to comment.