Skip to content
Dockerfile to build a container image for the Nutanix Command-Line Interface (nCLI)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Dockerfile to build a container image for the Nutanix Command-Line Interface (nCLI)


  • Internet
  • Docker CE or EE
  • (download it via Prism)

Cloning the repo

Clone this repo and move into the directory

$ git clone
$ cd docker-nutanix-cli

Downloading the Nutanix CLI

Download the file from Prism and save it into the repo folder.

$ ls docker-nutanix-cli

Building the Docker image

To build the image run the following command within the repo directory. I have used the tag latest, feel free to use your own tagging.

$ docker build . -t ncli:latest

Testing the image

To test this image you need access to a CVM.

Also, this image uses variables to pass the required values:

  • NTNX_IP (CVM or cluster IP)
  • NTNX_USERNAME (UI username)
  • NTNX_PASSWORD (UI password)
$ docker run -it --rm -e NTNX_IP= -e NTNX_USERNAME=admin -e NTNX_PASSWORD=admin ncli:latest

Welcome, admin
You're now connected to 00000afa-0b00-0a0e-000c-0000000000a0 ( at

The arguments used are:

  • -it (Interactive + Allocate a pseudo-TTY)
  • --rm (Automatically remove the container when it exits)
  • -e (Set environment variables)


Create a dedicated folder where you can save the credentials for each of your Nutanix clusters on its own file. This example shows a single cluster (cluster1), but you can repeat the same steps for multiple clusters. Also, remember to set the permissions of your credential files to 600 so only you have read/write access.

$ mkdir credentials
$ cd credentials
$ cat <<EOF> cluster1
$ chmod 600 cluster1

Now you can run a new container and pass the variables as a file.

$ docker run -it --rm --env-file cluster1 ncli:latest

Disclaimer: Containerised nCLI is not officially supported by Nutanix. Please use at your own risk.

You can’t perform that action at this time.