Run Salesforce CLI Using a Docker Image

Salesforce publishes Docker container images for Salesforce CLI on Docker Hub. We follow the same release process as our installers and npm packages. Each week we publish a Docker container image for that week’s release candidate (latest-rc). The following week we retag the image as latest. You can run the latest or latest-rc CLI versions, or a specific numbered version.

For each Salesforce CLI version, we provide two flavors:

  • slim—The CLI installed on Linux with a TAR file, plus OpenJDK 11.
  • full—The CLI installed on Linux with npm on a full Node.js installation, plus OpenJDK 11 and additional utilities such as jq.

Refer to this Web page or the following table to determine the name of the image you want to use.

Salesforce CLI Version TypeDocker Hub Image Name
Slim latest releasesalesforce/cli:latest-slim
Full latest releasesalesforce/cli:latest-full
Slim release candidatesalesforce/cli:latest-rc-slim
Full release candidatesalesforce/cli:latest-rc-full
Slim specific version, such as 2.0.1salesforce/cli:2.0.1-slim
Full specific version, such as 2.0.1salesforce/cli:2.0.1-full

For example, to pull and run the slim CLI release candidate image:

Then you can run Salesforce CLI commands, such as:

To exit the Salesforce CLI Docker container:

You can also remotely execute commands from outside the container after you have it running and know the container ID:

See Also