prepare-tool
Prepares a tool into the container by creating relevant directories,files and links.
$ containerbase-cli prepare tool [-d,--dry-run] <tools> ...
$ prepare-tool [-d,--dry-run] <tools> ...
- preparing node
prepare-tool node
- preparing all tools
prepare-tool all
install-tool
Installs a tool into the container.
$ containerbase-cli install tool [-d,--dry-run] <name> [version]
$ install-tool [-d,--dry-run] <name> [version]
- Installs node v14.17.0
install-tool node 14.17.0
- Installs node with version via environment variable
or
NODE_VERSION=14.17.0 install-tool node
export NODE_VERSION=14.17.0 install-tool node - Installs latest pnpm version
install-tool pnpm
- Installs the newest node 22 release
install-tool node 22
Some tools accept partial versions and install a matching release:
java,java-jre,java-jdk: A major (21), major.minor (11.0) or major.minor.patch (11.0.24) version installs the newest matching GA release. A full version with a build, like17.0.12+7, is used as is. Without a version, or withlatest, the newest LTS is installed.node: A major (22) or major.minor (22.11) version installs the newest matching release. Without a version, or withlatest, the newest LTS is installed.yarn,corepack,npm,pnpmand any package installed withinstall-npm: A major (10) or major.minor (10.9) version installs thelatestdist tag if it matches and is not deprecated, otherwise the newest matching release, prereleases are skipped and deprecated versions are used only if there is no other. Without a version, or withlatest, thelatestrelease is installed.conan,poetryand any package installed withinstall-pip: A major (2) or major.minor (2.1) version installs the newest matching release, prereleases and yanked releases are skipped. A version which exists as a release, like5.2, is kept, even a yanked one, which pip installs when pinned. Without access to pypi.org, eg. for a package from a private index, the version is kept too. The lookup uses pypi.org, so a package from a private index whose name also exists on pypi.org should be pinned with a full version. A major or major.minor version resolves to the newest matching release even when pip would read it asX.Y.0, eg.poetry 1.8installs the newest1.8.x, not1.8.0; pin the full version for an exact one. Without a version, or withlatest, the latest release is installed. Forpoetrythe latest release is the newest one supported bypoetry-plugin-pypi-mirror, a partial version ignores that limit.android-sdk-cmdline-tools: A major (14) or major.minor (14.1) version installs the newest matching stable release, compared numerically. A version which exists as a release, like13, is kept; the repository lists versions without zero segments, so13.0installs the release listed as13. The lookup needs the android repository, which the install needs too, so it fails when the repository can't be loaded. Without a version, or withlatest, thelatestpackage is installed.cocoapods,bundlerand any package installed withinstall-gem: A major (1) or major.minor (1.16) version installs the newest matching release, prereleases are skipped. A version which exists as a release, like5.2, is kept. Other major or major.minor versions resolve to the newest matching release even when RubyGems would read them asX.Y.0, eg.bundler 2.0installs the newest2.0.x, not2.0.0; pin the full version for an exact one. The lookup goes to rubygems.org, through the CDN and URL replacements like other lookups, and a configured gem registry is only used for the install, so a gem from a private registry needs a full version, and a partial version fails when rubygems.org can't be reached. Without a version, or withlatest, the latest release is installed.gradle: A major (8) or major.minor (9.0) version installs the newest matching stable release, prereleases, milestones, snapshots, nightlies and broken releases are skipped. A version which exists as a release, like8.10or6.9, is kept as given, and so is the version when the release list can't be loaded. Other major.minor versions resolve to the newest matching release, eg.9.0installs the newest9.0.x; pin the full version for an exact one. The release list comes fromservices.gradle.org/versions/all, through the CDN and URL replacements like other lookups. Without a version, or withlatest, the current release is installed.maven: A major (3) or major.minor (3.9) version installs the newest matching stable release, prereleases like4.0.0-rc-1are skipped. A version which exists as a release, like3.0, is kept, and so is the version when the release list can't be loaded. Other major.minor versions resolve to the newest matching release, eg.3.9installs the newest3.9.x; pin the full version for an exact one. The release list comes from Maven Central'smaven-metadata.xmlon repo.maven.apache.org, through the CDN and URL replacements like other lookups. Without a version, or withlatest, the newest containerbase maven prebuild is installed, which is not resolved against Maven Central.nuget: A major (6) or major.minor (6.11) version installs the newest matching released and blessed release. A version which exists in the nuget feed is kept, and so is the version whentools.jsoncan't be loaded. Without a version, or withlatest, the newest released and blessed release is installed.
Any other version is used as is.
install-gem
Installs a gem package into the container.
Note: requires ruby to be installed.
$ containerbase-cli install gem [-d,--dry-run] <name> [version]
$ install-gem [-d,--dry-run] <name> [version]
- Installs rake 13.0.6
install-gem rake 13.0.6
- Installs rake with version via environment variable
or
RAKE_VERSION=13.0.6 install-gem rake
export RAKE_VERSION=13.0.6 install-gem rake - Installs latest rake version
install-gem rake
- Installs the newest rake 13 release
install-gem rake 13
A major or major.minor version installs the newest matching release, see the install-tool versions.
install-npm
Installs a npm package into the container.
Note: requires node to be installed.
$ containerbase-cli install npm [-d,--dry-run] <name> [version]
$ install-npm [-d,--dry-run] <name> [version]
- Installs del-cli v5.0.0
install-npm del-cli 5.0.0
- Installs del-cli with version via environment variable
or
DEL_CLI_VERSION=5.0.0 install-npm del-cli
export DEL_CLI_VERSION=5.0.0 install-npm del-cli - Installs latest del-cli version
install-npm del-cli
- Installs a del-cli 5 release
install-npm del-cli 5
A major or major.minor version installs the matching latest release, else the newest matching one, see the install-tool versions.
install-pip
Installs a pip package into the container.
Note: requires python to be installed.
$ containerbase-cli install pip [-d,--dry-run] <name> [version]
install-pip [-d,--dry-run] <name> [version]
- Installs checkov 2.4.7
install-pip checkov 2.4.7
- Installs checkov with version via environment variable
or
CHECKOV_VERSION=2.4.7 install-pip checkov
export CHECKOV_VERSION=2.4.7 install-pip checkov - Installs latest checkov version
install-pip checkov
- Installs the newest checkov 2 release
install-pip checkov 2
A major or major.minor version installs the newest matching release, see the install-tool versions.
uninstall-tool
Uninstalls a tool and deletes all files from the container.
Note: Tools that have child tools need to be uninstalled recursively using the --recursive flag.
$ containerbase-cli uninstall tool [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]
$ uninstall-tool [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]
-
Uninstalls node v14.17.0
uninstall-tool node 14.17.0
-
Uninstalls node v14.17.0 with all child tools
uninstall-tool node 14.17.0 --recursive
-
Uninstalls all node versions with all child tools
uninstall-tool node --recursive --all
-
Uninstalls all jb versions
uninstall-tool jb --all
-
Uninstalls tool with all child tools extended example
$ install-tool node 22.0.0 INFO (9): Installing tool node@22.0.0... v22.0.0 10.5.1 0.26.0 INFO (9): Install tool node succeeded in 4.3s. $ install-tool pnpm 10.20.0 INFO (10): Installing tool pnpm@10.20.0... v10.20.0 INFO (10): Install tool pnpm succeeded in 1.1s. $ uninstall-tool node 22.0.0 INFO (93): Uninstalling tool node@22.0.0... FATAL (93): tool version has child dependencies and cannot be uninstalled tool: "node" version: "22.0.0" childs: [ { "name": "pnpm", "version": "10.20.0" } ] FATAL (93): Uninstall tool node failed in 32ms. $ uninstall-tool node 22.0.0 -r INFO (104): Uninstalling tool node@22.0.0... INFO (104): Uninstalling child tool pnpm@10.20.0... INFO (104): Uninstall tool node succeeded in 100ms.
uninstall-gem
Uninstalls a gem package from the container.
$ containerbase-cli uninstall gem [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]
$ uninstall-gem [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]
- Uninstalls rake v13.0.6
uninstall-gem rake 13.0.6
- Uninstalls all rake versions
uninstall-gem rake --all
uninstall-npm
Uninstalls a npm package from the container.
$ containerbase-cli uninstall npm [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]
$ uninstall-npm [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]
-
Uninstalls del-cli v5.0.0
uninstall-npm del-cli 5.0.0
-
Uninstalls all del-cli versions
uninstall-npm del-cli --all
uninstall-pip
Uninstalls a pip package from the container.
$ containerbase-cli uninstall pip [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]
uninstall-pip [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]
- Uninstalls checkov v2.4.7
uninstall-pip checkov 2.4.7
- Uninstalls all checkov versions
uninstall-pip checkov --all
Lists all installed tools and their versions.
The tools are printed as a table, with the currently linked version and any other installed versions.
Tools and versions are sorted alphabetically, with numbers in numeric order, so 9.0.0 comes before 10.0.0.
A - is printed when no version of the tool is currently linked.
That happens when the linked version is uninstalled while other versions of the tool remain installed, as nothing relinks one of them.
With --json the list is printed as JSON, so it can be processed programmatically.
The JSON output is described by the list-tools.schema.json JSON Schema.
Because containerbase logs to stdout, use --out to write the output to a file instead.
When writing to a file, JSON output is minified.
$ containerbase-cli list tools [--json] [--out <file>]
-
Lists all installed tools
$ containerbase-cli list tools NAME VERSION OTHER VERSIONS java-jdk - 21.0.12+7 node 22.11.0 20.11.0 pnpm 10.0.1
Here
java-jdkis installed but not linked, whilenodeis linked to22.11.0and keeps20.11.0installed. -
Lists all installed tools as JSON
$ containerbase-cli list tools --json { "tools": [ { "name": "java-jdk", "version": null, "versions": [{ "version": "21.0.12+7" }] }, { "name": "node", "version": "22.11.0", "versions": [{ "version": "20.11.0" }, { "version": "22.11.0" }] }, { "name": "pnpm", "version": "10.0.1", "versions": [ { "version": "10.0.1", "parent": { "name": "node", "version": "22.11.0" } } ], "type": "npm" } ] } -
Writes the JSON output to a file
containerbase-cli list tools --json --out /tmp/tools.json