Skip to content

Latest commit

 

History

History
449 lines (316 loc) · 10.2 KB

File metadata and controls

449 lines (316 loc) · 10.2 KB

Containerbase Tools



Prepare

containerbase-cli prepare tool

Alias

prepare-tool

Description

Prepares a tool into the container by creating relevant directories,files and links.

Usage

$ containerbase-cli prepare tool [-d,--dry-run] <tools> ...

$ prepare-tool [-d,--dry-run] <tools> ...

Examples

  • preparing node
    prepare-tool node
  • preparing all tools
    prepare-tool all

Install

containerbase-cli install tool

Alias

install-tool

Description

Installs a tool into the container.

Usage

$ containerbase-cli install tool [-d,--dry-run] <name> [version]

$ install-tool [-d,--dry-run] <name> [version]

Examples

  • Installs node v14.17.0
    install-tool node 14.17.0
  • Installs node with version via environment variable
    NODE_VERSION=14.17.0 install-tool node
    or
    export NODE_VERSION=14.17.0
    install-tool node
  • Installs latest pnpm version
    install-tool pnpm

containerbase-cli install gem

Alias

install-gem

Description

Installs a gem package into the container.

Note: requires ruby to be installed.

Usage

$ containerbase-cli install gem [-d,--dry-run] <name> [version]

$ install-gem [-d,--dry-run] <name> [version]

Examples

  • Installs rake 13.0.6
    install-gem rake 13.0.6
  • Installs rake with version via environment variable
    RAKE_VERSION=13.0.6 install-gem rake
    or
    export RAKE_VERSION=13.0.6
    install-gem rake
  • Installs latest rake version
    install-gem rake

containerbase-cli install npm

Alias

install-npm

Description

Installs a npm package into the container.

Note: requires node to be installed.

Usage

$ containerbase-cli install npm [-d,--dry-run] <name> [version]

$ install-npm [-d,--dry-run] <name> [version]

Examples

  • Installs del-cli v5.0.0
    install-npm del-cli 5.0.0
  • Installs del-cli with version via environment variable
    DEL_CLI_VERSION=5.0.0 install-npm del-cli
    or
    export DEL_CLI_VERSION=5.0.0
    install-npm del-cli
  • Installs latest del-cli version
    install-npm del-cli

containerbase-cli install pip

Alias

install-pip

Description

Installs a pip package into the container.

Note: requires python to be installed.

Usage

$ containerbase-cli install pip [-d,--dry-run] <name> [version]

install-pip [-d,--dry-run] <name> [version]

Examples

  • Installs checkov 2.4.7
    install-pip checkov 2.4.7
  • Installs checkov with version via environment variable
    CHECKOV_VERSION=2.4.7 install-pip checkov
    or
    export CHECKOV_VERSION=2.4.7
    install-pip checkov
  • Installs latest pnpm version
    install-pip checkov

Uninstall

containerbase-cli uninstall tool

Alias

uninstall-tool

Description

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.

Usage

$ containerbase-cli uninstall tool [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]

$ uninstall-tool [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]

Examples

  • 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.

containerbase-cli uninstall gem

Alias

uninstall-gem

Description

Uninstalls a gem package from the container.

Usage

$ containerbase-cli uninstall gem [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]

$ uninstall-gem [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]

Examples

  • Uninstalls rake v13.0.6
    uninstall-gem rake 13.0.6
  • Uninstalls all rake versions
    uninstall-gem rake --all

containerbase-cli uninstall npm

Alias

uninstall-npm

Description

Uninstalls a npm package from the container.

Usage

$ containerbase-cli uninstall npm [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]

$ uninstall-npm [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]

Examples

  • Uninstalls del-cli v5.0.0

    uninstall-npm del-cli 5.0.0
  • Uninstalls all del-cli versions

    uninstall-npm del-cli --all

containerbase-cli uninstall pip

Alias

uninstall-pip

Description

Uninstalls a pip package from the container.

Usage

$ containerbase-cli uninstall pip [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]

uninstall-pip [-d,--dry-run] [-r,--recursive] [-a,--all] <name> [version]

Examples

  • Uninstalls checkov v2.4.7
    uninstall-pip checkov 2.4.7
  • Uninstalls all checkov versions
    uninstall-pip checkov --all

List

containerbase-cli list tools

Description

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.

Usage

$ containerbase-cli list tools [--json] [--out <file>]

Examples

  • 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-jdk is installed but not linked, while node is linked to 22.11.0 and keeps 20.11.0 installed.

  • 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