Building CAPI requires Bazel+Golang. The following instructions illustrate how to build the CAPI manager binary using a Docker container that includes both Bazel and Golang 1.12.6.
The Docker image built from Dockerfile is pushed to akutz/bazel-go
, but it may also be built locally using the following command:
docker build -t bazel-go .
The CAPI manager binary may now be built inside of a container using the following command:
docker run -it --rm bazel-go \
/bin/sh -c "git clone https://github.com/kubernetes-sigs/cluster-api.git . && \
make vendor && \
make generate && \
make manager"
The above command builds the manager binary outside of the GOPATH
in the /build
directory. Please note this only works with CAPI v1alpha2. Builds for the release-1
branch must occur from inside $GOPATH/src/sigs.k8s.io/cluster-api
.