Docker Deployment
Deploy PoshMcp in Docker containers for consistent environments and cloud deployment.
Build Images with poshmcp build
Use the CLI as the default workflow:
# Default: build custom image from GHCR base image
poshmcp build --tag myorg/poshmcp:latest
# Custom image with pre-installed modules
poshmcp build --modules "Az.Accounts Az.Resources" --tag myorg/poshmcp:azure
# Local/source base image build from repository Dockerfile
poshmcp build --type base --tag poshmcp:latest
# Pin custom build source image and tag
poshmcp build --source-image ghcr.io/usepowershell/poshmcp/poshmcp --source-tag 0.9.0
Build option semantics
poshmcp builddefaults to--type custom.--type customusesexamples/Dockerfile.userand layers on a source image.--type basebuilds the local runtime/source image from the repoDockerfile.- Default source image is
ghcr.io/usepowershell/poshmcp/poshmcp:latest. --source-imageand--source-tagapply to custom builds.
Running the Container
HTTP Mode
docker run -p 8080:8080 poshmcp:latest
Stdio Mode
docker run -it poshmcp:latest poshmcp serve --transport stdio
Custom Configuration
Mount your appsettings.json:
docker run -v $(pwd)/appsettings.json:/app/appsettings.json \
-p 8080:8080 \
poshmcp:latest
Environment Variables
docker run \
-e POSHMCP_TRANSPORT=http \
-e POSHMCP_LOG_LEVEL=debug \
-p 8080:8080 \
poshmcp:latest
Direct Docker Build (Advanced)
If needed, you can still call Docker directly:
docker build -t poshmcp:latest .
docker build -f examples/Dockerfile.user -t myorg/poshmcp:latest .
Azure Container Apps Deployment
See Azure Integration for full deployment guide with Managed Identity setup, monitoring, and scaling.
Quick deploy:
cd infrastructure/azure
./deploy.sh