Building Trident has following requirements:
- Docker 1.10 or greater when using the Makefile targets.
- Go 1.13 or greater is optionally required when building Trident natively.
Use make build
to run a containerized build, and generate
Trident images. This is the simplest and the recommended way to build Trident.
Trident can be built with go build
.
Multiple Makefile targets, many of which are containerized, are available for building Trident.
The targets take the following environment variables as parameters:
$REGISTRY_ADDR
: IP address and port of a local Docker registry.$TRIDENT_IMAGE
: name for the Trident Docker image; defaults totrident
.$TRIDENT_VERSION
: tag for the Trident Docker image; defaults to the last stable release version for Trident.$BIN
: name of the output binary. Defaults totrident_orchestrator
.$GO_IMAGE
: Image name used to compile Trident$CREATE_BASE_IMAGE
: Creates an image of the specified name that contains pre-cached Trident Go dependencies, which can be used by subsequent builds via$GO_IMAGE
to speed up builds.
-
make build
: Builds Trident. -
make clean
: Removes containers, container images, and build artifacts inbin/
. -
make dist
: Builds Trident and creates the Trident installer package. -
make install
: Calls thebuild
target and then runs containerizedgo install
. -
make test
: Starts an etcd container (for use by the tests incore/
andpersistent_store/
) and runsgo test
on the project. Unlike most other targets, this performs a native build. -
make vet
: Runsgo vet
. -
make trident_build
: Builds Trident in a Go container, placing the trident_orchestrator and tridentctl binaries intobin/
. A docker image is created and tagged as[$REGISTRY_ADDR/]$TRIDENT_IMAGE:$VERSION_TAG
, with the bracketed portion omitted if$REGISTRY_ADDR
is unset. This tag defaults totrident
. -
make trident_build_all
: Executes thetrident_build
target as well as building the MacOS version of tridentctl. -
make tridentctl_build
: Builds only the tridentctl binary. The$GOOS
and$GOARCH
environment variables can be set to compile the tridentctl binary for an unsupported target system.