podman-proxy
Podman Proxy Management
Easily manage SOCKS5 proxy settings for Podman on macOS. Switch between different proxy ports with a single command.
Quick Start
# Set proxy to port 1088
podman-proxy-set 1088
# Set proxy from environment variable
export PROXY_PORT=8080
podman-proxy-set
# Check current proxy configuration
podman-proxy-check
Installation
To install the scripts from this skill:
bash scripts/install.sh
The scripts will be installed at:
/usr/local/bin/podman-proxy-set- Set/change proxy port/usr/local/bin/podman-proxy-check- View current configuration
Add to your shell profile (~/.zshrc or ~/.bashrc) for convenience:
alias pproxy='podman-proxy-set'
Then reload:
source ~/.zshrc
Essential Commands
Set Proxy Port
# Explicit port
podman-proxy-set 1088 # SOCKS5 at port 1088
podman-proxy-set 8080 # SOCKS5 at port 8080
podman-proxy-set 1086 # SOCKS5 at port 1086
# From environment variable (useful for scripts)
export PROXY_PORT=1090
podman-proxy-set # Uses $PROXY_PORT
Check Configuration
# View current proxy settings
podman-proxy-check
# Example output:
# [engine]
# http_proxy = "socks5h://host.containers.internal:1088"
# https_proxy = "socks5h://host.containers.internal:1088"
With Alias
# After adding 'pproxy' alias to ~/.zshrc
pproxy 1088 # Set to 1088
pproxy 8080 # Set to 8080
pproxy # Use $PROXY_PORT
How It Works
The Problem
Podman on macOS runs inside a virtual machine. Local proxy configurations don't automatically transfer to the VM, causing Docker registry access to fail.
The Solution
This skill:
- Configures proxy inside the Podman VM via
podman machine ssh - Uses
host.containers.internalto reach the host machine's proxy - Restarts the Podman daemon to apply changes
- Supports environment variables for flexible scripting
Architecture
Your Computer (macOS)
↓
SOCKS5 Proxy (localhost:1088)
↓
Podman VM
├─ ~/.config/containers/containers.conf
└─ Podman daemon (restarted after config change)
Common Workflows
Quick Image Pulls with Different Proxies
# Switch to fast proxy, pull large image
podman-proxy-set 1088
podman pull myregistry/large-image:v1
# Switch to backup proxy for another pull
podman-proxy-set 1090
podman pull another-registry/image:latest
CI/CD with Environment Variables
#!/bin/bash
# script.sh - automatically use different proxy for different environments
export PROXY_PORT=${CI_PROXY_PORT:-1088}
podman-proxy-set
podman pull myimage:latest
podman run myimage:latest
Batch Operations
# Pull multiple images with a specific proxy
export PROXY_PORT=1088
podman-proxy-set
podman pull alpine:latest
podman pull nginx:latest
podman pull postgres:latest
Troubleshooting
Check if Proxy is Accessible
# From macOS host
nc -zv localhost 1088 # Should succeed
all_proxy=socks5h://localhost:1088 curl -I https://google.com
Verify Configuration in VM
# SSH into the VM to debug
podman machine ssh
cat ~/.config/containers/containers.conf
sudo systemctl status podman
Manual Reset
# Manually configure if script fails
podman machine ssh
mkdir -p ~/.config/containers
cat > ~/.config/containers/containers.conf << 'EOF'
[engine]
http_proxy = "socks5h://host.containers.internal:1088"
https_proxy = "socks5h://host.containers.internal:1088"
EOF
sudo systemctl restart podman
exit
Key Technical Details
SOCKS5h Protocol
socks5h://- The 'h' means hostname resolution happens on the SOCKS5 server- Better for Docker registry access than regular
socks5://
host.containers.internal
- Special DNS name that resolves to the host machine from inside the VM
- Used instead of
localhost:1088(which would point inside the VM)
Configuration Persistence
- Configuration lives in
/root/.config/containers/containers.confinside the VM - Survives VM restarts
- Can be manually edited if needed
Daemon Restart
- Script automatically restarts
podmandaemon after config changes - Takes ~2-3 seconds
- Required for new proxy settings to take effect
Limitations
- Only works on macOS with Podman running in a virtual machine
- Requires the SOCKS5 proxy to be running on localhost
- Linux/WSL users can use environment variables directly:
export http_proxy=socks5h://localhost:1088
Integration with Other Tools
With Podman Compose
podman-proxy-set 1088
podman compose pull
podman compose up
With Kubernetes (via Podman)
export PROXY_PORT=1088
podman-proxy-set
# k8s operations will now use the configured proxy
Advanced: Creating Custom Port Profiles
Create your own wrapper script for quick switching:
# ~/.local/bin/pproxy-main
#!/bin/bash
podman-proxy-set 1088
# ~/.local/bin/pproxy-backup
#!/bin/bash
podman-proxy-set 1090
# Now use:
# pproxy-main # Quick switch to main proxy
# pproxy-backup # Quick switch to backup proxy
More from ppsteven/skills
trade-skills
Data source router for accessing Chinese financial market data. Routes users to appropriate data skill (akshare-data for stocks/bonds/funds/macro, tianqin-data for futures). Provides comprehensive data resource table showing what data each skill provides and which APIs to call.
24akshare-data
AKShare CLI wrapper and API reference documentation. Use this skill to access Chinese financial market data via command line (stocks, futures, funds, bonds, forex, macro indicators) or browse comprehensive API documentation with parameter tables, output schemas, and code examples for all supported data categories.
20my-skill
Unified skill management tool for finding, creating, and managing agent skills. Use when user needs to discover skills with deep research (find), create new skills with proper deployment (create), or manage installed skills (list/remove/health-check). Trigger on phrases like 'my-skill find/create/manage', 'find a skill for X', 'create a new skill', 'list all skills', 'check skill health', or any skill-related operations including skill discovery, creation, listing, removal, or health checking.
8github-repo-init
Use when pushing a new local git repository to GitHub with automatic README generation, metadata configuration, and verification
8swagger2skill
Generate reusable Claude skills from Swagger/OpenAPI specifications. Use AskUserQuestion for interactive category selection, then generate complete skills with CLI tools and documentation.
8tianqin-data
CLI wrapper and API reference for China futures market data from EasyFut API. Use this skill to access real-time quotes, K-line candlestick data, and tick sequences for China futures contracts across major exchanges (SHFE, DCE, CFFEX, CZCE, INE). All commands require exchange prefix format (e.g., SHFE.rb2601, CFFEX.IF2601).
8