Docker Usage Guide¶
This guide explains how to run the Salesforce Toolkit in an isolated Docker environment, which avoids the need to install Python or dependencies on your local machine.
Prerequisites¶
- Docker installed on your machine.
- Docker Compose (usually included with Docker Desktop).
Quick Start¶
1. Build the Image¶
Build the Docker image containing the toolkit and all dependencies:
2. Run Tests¶
Execute the unit tests inside the container to verify everything is working:
Expected Output: You should seepytest output showing passing tests (green).
3. Usage via CLI¶
You can run any sf-toolkit CLI command using docker-compose run toolkit [command].
Display Help:
Test Authentication:
Configuration¶
The Docker setup uses your local .env file.
- Create a
.envfile in the project root (seeconfig/.env.example). - Docker Compose automatically loads this file.
Certificates¶
If you are using JWT authentication with a certificate file (e.g., server.key):
- Place the key file inside the project directory (e.g., inside a
certs/folder). - In your
.envfile, use the path relative to the container, which maps to/app.
Example: If your local structure is:
Your .env should look like this:
/app is where the project folder is mounted inside the container)
Troubleshooting¶
Permission Issues (Linux):
If you encounter permission errors with file mounts, you may need to run docker-compose with sudo.
"File not found" for keys:
Ensure that your SF_PRIVATE_KEY_PATH in .env points to a path inside the container (starting with /app/), not your local host path.