From 167214ab1f1221cb339e4c4ded99e422bcd33f8c Mon Sep 17 00:00:00 2001 From: krishnadurai Date: Thu, 2 Jan 2020 19:18:13 -0800 Subject: [PATCH 1/3] Initial commit for a distroless image TF operator packed in distroless container tf_smoke.py removed --- build/images/tf_operator/Dockerfile | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/build/images/tf_operator/Dockerfile b/build/images/tf_operator/Dockerfile index 4761d30de2..4ca4be6387 100644 --- a/build/images/tf_operator/Dockerfile +++ b/build/images/tf_operator/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.10 AS build-image +FROM golang:1.13.5 AS build-image ADD . /go/src/github.com/kubeflow/tf-operator @@ -6,21 +6,12 @@ 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"] From 10392b62af36c0a857b0f231a160e152dc268fed Mon Sep 17 00:00:00 2001 From: krishnadurai Date: Fri, 3 Jan 2020 15:58:31 -0800 Subject: [PATCH 2/3] Changing CMD in test infra deployment --- .../tf-job-operator.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-app/vendor/kubeflow/core@f7a68336ad7a65c2cbba8462e89d24a10626687e/tf-job-operator.libsonnet b/test/test-app/vendor/kubeflow/core@f7a68336ad7a65c2cbba8462e89d24a10626687e/tf-job-operator.libsonnet index a7c15be3ab..c6d0450c8f 100644 --- a/test/test-app/vendor/kubeflow/core@f7a68336ad7a65c2cbba8462e89d24a10626687e/tf-job-operator.libsonnet +++ b/test/test-app/vendor/kubeflow/core@f7a68336ad7a65c2cbba8462e89d24a10626687e/tf-job-operator.libsonnet @@ -102,7 +102,7 @@ containers: [ { command: [ - "/opt/kubeflow/tf-operator.v1", + "/opt/tf-operator.v1", "--alsologtostderr", "-v=1", ], From a91c401c9d33e2bca1b64b19f3033566008d79b7 Mon Sep 17 00:00:00 2001 From: krishnadurai Date: Thu, 9 Jan 2020 12:22:13 -0800 Subject: [PATCH 3/3] Adds / to opt in copy --- build/images/tf_operator/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/images/tf_operator/Dockerfile b/build/images/tf_operator/Dockerfile index 4ca4be6387..48a34c49c2 100644 --- a/build/images/tf_operator/Dockerfile +++ b/build/images/tf_operator/Dockerfile @@ -10,7 +10,7 @@ FROM gcr.io/distroless/base-debian10 COPY third_party/library/license.txt /opt/license.txt -COPY vendor /opt +COPY vendor /opt/ COPY --from=build-image /go/src/github.com/kubeflow/tf-operator/tf-operator.v1 /opt/