Alibaba Cloud Toolbox — Running CLI in Docker

The Alibaba Cloud Command Line Interface (CLI) is a unified tool to manage your Alibaba Cloud services. With just one tool to download and configure, you can control multiple Alibaba Cloud services from the command line and automate them through scripts.

The CLI uses the SDK of various products internally to achieve the intended results. This installation can be hard to maintain considering the frequent releases of new SDK versions. This can also be cumbersome if you don’t have access to a machine with the pre-requisites installed.

Docker comes in handy in this situation. The key benefit of Docker is that it allows users to package an application with all its dependencies into a standardized unit for software development. Unlike virtual machines, containers do not have the high overhead and hence enable more efficient usage of the underlying system and resources.

This document explains a pre-packaged Alibaba Cloud CLI Docker image that could be used to launch the CLI at will. It also discusses a way to make the container data persistent.


  1. A machine with Docker installed. If you don’t know how to do this, please refer to this tutorial.
  2. A working internet connection.

Getting Started

To get started, the Alibaba Cloud CLI Docker image needs to be fetched. Depending on your use case run one of the commands below (this will also fetch the latest image if one had not been fetched earlier):

Interactive mode:

Detached mode:

For both of these invocations, the CLI must then be configured:

Note: The docker image can be configured to have the initial CLI configuration to be persisted. This should only be done in computers that the user has trust in. The parameter highlighted needs to be replaced.

Run the below command to pass the local folder reference that will store the CLI parameters

Environmental variables are also honored:


This document explains a simple way to access the Alibaba Cloud CLI without going through the complexities of maintaining an environment on its own. This will also free the host computer from the dependencies that will be installed as part of the CLI installation.


Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store