Notice: Subscription is required for business use.
(Optional) Fetch Tanzu CLI
cp ../scripts/fetch-tanzu-cli.sh .
./fetch-tanzu-cli.sh {VMWUSER} {VMWPASS} linux {TANZU_CLI_VERSION}
Replace
{VMWUSER}
and{VMWPASS}
with credentials you use to authenticate to https://console.cloud.vmware.com. Replace{TANZU_CLI_VERSION}
with a supported (and available) version number for the CLI you wish to embed in the container image. If your account has been granted access, the script will download a tarball, extract the Tanzu CLI and place it into adist
directory. The tarball and other content will be discarded. (The script has "smarts" built-in to determine whether or not to fetch a version of the CLI that may have already been fetched and placed in thedist
directory).
(Optional) Fetch and install oci CLI
cp ../scripts/fetch-and-install-oci-cli.sh .
You're just copying this script into place. It will be part of the container image and you'll be able to execute it after a
docker run
.
If you want to build a portable container image, then execute
docker build -t tanzu/k8s-toolkit .
or
nerdctl build -t tanzu/k8s-toolkit .
Execute
docker run --rm -it tanzu/k8s-toolkit /bin/bash
or
nerdctl container run --rm -it tanzu/k8s-toolkit /bin/bash
In order to create TKG clusters we need to be able to use docker for the kind
bootstrap process. Using the command below will set the network to host
allowing the kind
cluster's network to be accessible from the container, as well as mounting the docker socket to give access to the underlying host's docker daemon.
docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/workspace --network=host docker.io/tanzu/k8s-toolkit
If you want an inventory of all the relevant tools installed
cp ../scripts/inventory.sh .
Then
docker run --rm -v ${PWD}:/root tanzu/k8s-toolkit /bin/bash /root/inventory.sh
or
nerdctl run --rm -v ${PWD}:/root tanzu/k8s-toolkit /bin/bash /root/inventory.sh