Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Commit

Permalink
Use multi-build to build pytorch-operator image (#198)
Browse files Browse the repository at this point in the history
* Use multi-build to build pytorch-operator image

Use multi-build to build pytorch-operator image.

* Update Dockerfile

* Update Dockerfile
  • Loading branch information
hmtai authored and k8s-ci-robot committed Aug 8, 2019
1 parent f85242a commit 9a6ae63
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.git
.gitignore
#!include:.gitignore
vendor
#vendor
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
FROM golang:1.12 AS build-image

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

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

# Build pytorch operator v1beta2 binary
RUN go build ./cmd/pytorch-operator.v1beta2
# Build pytorch operator v1 binary
RUN go build ./cmd/pytorch-operator.v1

FROM registry.access.redhat.com/ubi8/ubi:latest

COPY pytorch-operator.v1beta2 /pytorch-operator.v1beta2
COPY pytorch-operator.v1 /pytorch-operator.v1
COPY --from=build-image /go/src/github.com/kubeflow/pytorch-operator/pytorch-operator.v1beta2 /pytorch-operator.v1beta2
COPY --from=build-image /go/src/github.com/kubeflow/pytorch-operator/pytorch-operator.v1 /pytorch-operator.v1

ENTRYPOINT ["/pytorch-operator", "-alsologtostderr"]
6 changes: 0 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ mkdir -p ${GOPATH}/src/github.com/${REPO_OWNER}
ln -s ${PWD} ${GO_DIR}
cd ${GO_DIR}

echo "Build pytorch operator v1beta2 binary"
go build github.com/kubeflow/pytorch-operator/cmd/pytorch-operator.v1beta2

echo "Build pytorch operator v1 binary"
go build github.com/kubeflow/pytorch-operator/cmd/pytorch-operator.v1

echo "Building PyTorch operator in gcloud"
gcloud version
gcloud builds submit . --tag=${REGISTRY}/${REPO_NAME}:${VERSION} --project=${PROJECT}
Expand Down

0 comments on commit 9a6ae63

Please sign in to comment.