dewy
dewy copied to clipboard
Support container image for dewy registry
The dewy container command achieves blue-green deployment by starting a new container (green) on a Docker network and performing health checks. Once healthy, it adds the network alias (e.g., "myapp-current") to the green
container while removing it from the old container (blue), instantly switching traffic. After a configurable drain period (default 30s) for existing connections to complete, it gracefully stops and removes the blue container.
$ dewy container \
--registry oci://ghcr.io/username/myapp \
--network myapp-net \
--network-alias myapp-current \
--container-port 8080 \
--health-path /health \
--health-timeout 10s \
--drain-time 60s \
--env APP_ENV=production \
--volume /data:/app/data \
--log-level info
URI Format: oci://[registry-host]/[path]/[image]?[options]
| Registry | URI |
|---|---|
| Docker Hub | oci://docker.io/username/myapp |
| GitHub Container Registry | oci://ghcr.io/linyows/myapp?pre-release=true |
| Google Artifact Registry | oci://us-central1-docker.pkg.dev/project/repo/myapp |
| AWS ECR | oci://123456789012.dkr.ecr.us-east-1.amazonaws.com/myapp |
| Private Registry | oci://registry.example.com:5000/myapp |
Software that tracks container images:
- Watchtower: Performs deployments as well
- Diun: Only detects and sends notifications
About watchtower:
- For Docker
- Runs as a container itself and monitors running containers via the Docker API (through /var/run/docker.sock)
- Needs access to the Docker socket (effectively root privileges)
$ docker run --detach \
--name watchtower \
--volume /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower
#221