diff --git a/.dockerignore b/.dockerignore index 4d38ab59f..f05f0bebe 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,8 @@ bin/ profile.cov # Additional +.dockerignore +Dockerfile .gitignore .github/ deploy/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b9051f7b..1415ff5a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,17 +74,13 @@ make images dev_manifest kubectl apply -k manifests/overlays/dev ``` -You can build an image using a legacy controller by setting `CONTROLLER_VERSION` - -```bash -make CONTROLLER_VERSION=v1 images dev_manifest -kubectl apply -k manifests/overlays/dev -``` +The image comes bundled with all the controller versions. For example, you can +find the v1 controller binary at `/opt/mpi-operator.v1`. If you need to use a different registry, or a different tag, you can do: ```bash -make IMAGE_NAME=example.com/mpi-operator CONTROLLER_VERSION=v1 RELEASE_VERSION=dev make images dev_manifest +make IMAGE_NAME=example.com/mpi-operator RELEASE_VERSION=dev make images dev_manifest ``` To look at the controller's logs, you can do: diff --git a/Dockerfile b/Dockerfile index dbdea4e6b..21294322d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ FROM golang:1.15.13 AS build -ARG version=v1alpha2 +ARG version=v2 ADD . /go/src/github.com/kubeflow/mpi-operator WORKDIR /go/src/github.com/kubeflow/mpi-operator -RUN make mpi-operator.$version +RUN make mpi-operator.v1alpha2 mpi-operator.v1 mpi-operator.v2 +RUN ln -s mpi-operator.$version _output/cmd/bin/mpi-operator FROM gcr.io/distroless/base-debian10:latest -ARG version=v1alpha2 -COPY --from=build /go/src/github.com/kubeflow/mpi-operator/_output/cmd/bin/mpi-operator.$version /opt/mpi-operator +COPY --from=build /go/src/github.com/kubeflow/mpi-operator/_output/cmd/bin/* /opt/ COPY third_party/library/license.txt /opt/license.txt ENTRYPOINT ["/opt/mpi-operator"] diff --git a/README.md b/README.md index b325e6e54..8ebb419ed 100644 --- a/README.md +++ b/README.md @@ -236,10 +236,10 @@ You can use the following Dockerfile to build the image yourself: Alternative, you can build the image using make: ```bash -make RELEASE_VERSION=dev images +make RELEASE_VERSION=dev IMAGE_NAME=registry.example.com/mpi-operator images ``` -This will produce an image with the tag `kubeflow/mpi-operator:dev`. +This will produce an image with the tag `registry.example.com/mpi-operator:dev`. ## Contributing diff --git a/deploy/v1alpha2/mpi-operator.yaml b/deploy/v1alpha2/mpi-operator.yaml index 1d14da43c..eab18b94a 100644 --- a/deploy/v1alpha2/mpi-operator.yaml +++ b/deploy/v1alpha2/mpi-operator.yaml @@ -197,6 +197,7 @@ spec: containers: - name: mpi-operator image: mpioperator/mpi-operator:latest + command: ["/opt/mpi-operator.v1alpha2"] args: [ "-alsologtostderr", "--kubectl-delivery-image",