| description | Using the Docker Cloud CLI on Linux, Windows, and macOS, installing, updating, uninstall | |||
|---|---|---|---|---|
| keywords | cloud, command-line, CLI | |||
| redirect_from |
|
|||
| title | The Docker Cloud CLI |
Docker Cloud maintains a Command Line Interface (CLI) tool that you can use to interact with the service. We highly recommend installing the CLI, as it will allow you to script and automate actions in Docker Cloud without using the web interface. If you will only ever be using the web interface, this is not necessary.
Install the docker-cloud CLI either by running a Docker container, or by using the package manager for your system.
If you have Docker Engine installed locally, you can simply run the following command regardless of which operating system you are using.
docker run dockercloud/cli -h
This runs a container that installs the docker-cloud CLI for you. Learn more about this container here.
Open your terminal or command shell and execute the following command:
$ pip install docker-cloudIf you encounter errors on Linux machines, make sure that python-dev is installed.
For example, on Ubuntu, run the following command: apt-get install python-dev
We recommend installing Docker CLI for macOS using Homebrew. If you don't have brew installed, follow the instructions here: http://brew.sh
Once Homebrew is installed, open Terminal and run the following command:
$ brew install docker-cloudCheck that the CLI installed correctly:
$ docker-cloud -v
docker-cloud 1.0.0First, you should log in using the docker CLI and the docker login command.
Your Docker ID, which you also use to log in to Docker Hub, is also used for
logging in to Docker Cloud.
$ docker login
Username: user
Password:
Email: user@example.org
Login succeeded!
See the Developer documentation for more information on using the CLI and our APIs.
When you use the docker-cloud CLI, it authenticates against the Docker Cloud
service with the user credentials saved by the docker login command. To use
the CLI to interact with objects belonging to an Organization, you
must override the DOCKERCLOUD_NAMESPACE environment variable that sets this
user.
For example:
$ export DOCKERCLOUD_NAMESPACE=myorganization
You can also set the DOCKERCLOUD_NAMESPACE variable before each CLI command.
for example:
$ DOCKERCLOUD_NAMESPACE=myteam docker container ps
To learn more, see the Docker Cloud CLI README.
Periodically, Docker will add new features and fix bugs in the existing CLI. To use these new features, you must upgrade the CLI.
$ pip install -U docker-cloud
$ brew update && brew upgrade docker-cloud
If you are having trouble using the docker-cloud CLI, or find that it conflicts with other applications on your system, you may want to uninstall and reinstall.
Open your terminal or command shell and execute the following command:
$ pip uninstall docker-cloud
Open your Terminal application and execute the following command:
$ brew uninstall docker-cloud