This document explains how to run CircleCI jobs locally using the CircleCI CLI, including solutions for ARM64 compatibility issues.
We successfully demonstrated running a CircleCI job locally using the CircleCI CLI tool. The approach works for environment setup and dependency installation, though SSL certificate issues in container environments remain a limitation.
-
CircleCI CLI: Install the CircleCI CLI tool
# macOS with Homebrew brew install circleci # Or download from: https://github.com/CircleCI-Public/circleci-cli/releases
-
Docker: Required for local execution
# Verify Docker is running docker --version
We created several configuration files to handle different scenarios:
- Uses
ruby:3.2.8-slim(ARM64 compatible) - Installs Node.js via Debian packages
- Handles basic SSL certificate issues
- Demonstrates full job execution flow
- Comprehensive SSL certificate handling
- Disables SSL verification for local testing
- Most complete environment setup
- Basic single-container setup
- Good for understanding CircleCI CLI basics
# Run with the most compatible configuration
circleci local execute -c working-local-config.yml build
# Or with comprehensive SSL handling
circleci local execute -c final-local-config.yml build# Check if your config is valid
circleci config validate .circleci/config.yml✅ Environment Setup
- Docker container creation and management
- System package installation (PostgreSQL client, build tools, etc.)
- Ruby environment configuration
- Node.js and npm installation via system packages
✅ Code Management
- Repository checkout
- File copying and workspace setup
✅ Dependency Management (Partial)
- Bundle configuration
- Package manager setup
- Basic gem installation (when SSL allows)
❌ SSL Certificate Issues
- Container environments have SSL certificate verification problems
- Affects both RubyGems and GitHub access
- Workarounds help but don't completely solve the issue
❌ Service Dependencies
- No PostgreSQL or Redis services in local execution
- Database tests require external service setup
❌ Platform Compatibility Warnings
- ARM64 vs AMD64 architecture mismatches
- Works but generates warnings
The CircleCI config uses cimg/ruby:3.2.8-browsers which isn't available for ARM64.
Switch to ruby:3.2.8-slim which supports ARM64:
docker:
- image: ruby:3.2.8-slim # ARM64 compatibleUse Debian packages instead of NodeSource repository to avoid SSL issues:
- run:
name: Install Node.js
command: |
apt-get update
apt-get install -y nodejs npm-
Start with validation:
circleci config validate .circleci/config.yml
-
Test basic setup:
circleci local execute -c simple-local-config.yml build -
Run comprehensive test:
circleci local execute -c working-local-config.yml build -
Debug issues:
- Check Docker logs
- Verify image availability
- Test individual commands in containers
If SSL issues persist, consider:
-
Direct Docker execution:
docker run -it ruby:3.2.8-slim bash # Run commands manually -
Custom Dockerfile: Create a Dockerfile that replicates the CI environment without SSL issues.
-
GitHub Actions Alternative: Use Act (https://github.com/nektos/act) to run GitHub Actions locally.
working-local-config.yml- Primary working configurationfinal-local-config.yml- Complete SSL workaround attemptsimple-local-config.yml- Minimal setup for testinglocal-config.yml- Initial ARM64 compatibility fixprocess.yml- Processed version from original config
- CircleCI CLI works well for local job execution
- Platform compatibility is solvable with appropriate base images
- SSL certificate issues in containers require network-level solutions
- Local execution is valuable for debugging CI setup even with limitations
- ARM64 support requires careful image selection
The CircleCI CLI successfully demonstrates local job execution and is valuable for:
- Testing CI configuration changes
- Debugging environment setup issues
- Understanding job execution flow
- Validating dependency installation
While SSL certificate issues remain a challenge, the approach provides significant value for CI/CD development and debugging workflows.