Too Small for ArgoCD, Too Dynamic for Ansible: Introducing DockerWorks
Automate Docker Compose and Podman Quadlet deployments with DockerWorks: pull-based GitOps, SOPS secrets, Go templates, dry-run mode, and auto-rollbacks.
format_list_bulleted
Table of Contents
25 sections
expand_more
If you manage a handful of Linux VMs running Docker or Podman, you have probably felt stuck between two uncomfortable extremes.
On one side, you have Ansible (or custom CI/CD SSH scripts), which is phenomenal for provisioning a fresh Linux server—setting up users, editing /etc/hosts, configuring firewalls, and mounting storage—but starts to creak the moment you use it for frequent container deployments. Every minor config tweak or image bump means waiting on playbooks, opening inbound SSH from your CI runner to production, and figuring out how to roll back manually when a container crash-loops at 2 a.m. On the other side, you have Kubernetes and ArgoCD, which give you a rock-solid, pull-based GitOps loop with self-healing and rollbacks, but force you to maintain a cluster control plane just to run four containers on a single VM.
There had to be a middle ground.
Why Existing Lightweight Tools Fall Short
You might be thinking: "Doesn't Watchtower already auto-update Docker containers?"
It does, and for simple homelab containers that only need image: latest watched, Watchtower works fine. The moment you step into real-world DevOps workflows, though, you run into four gaps:
- No GitOps for Compose or Quadlet files: Updating an environment variable, adding a sidecar, or changing a volume mount still requires SSHing in or running Ansible.
- No automated health-check rollbacks: Pulling a broken
:latestimage and restarting doesn't help if it leaves your service down until someone notices. - No secrets or config templating story: Real apps need encrypted
.envfiles (SOPS) and dynamic configs (prometheus.yml,nginx.conf)—not just a container image tag. - Limited Podman & rootless support: Modern RHEL, Fedora, and Ubuntu hosts are increasingly moving to rootless Podman and Quadlets, which traditional Docker socket tools ignore.
That is the exact gap DockerWorks was built to fill.
What Is DockerWorks? (And Why It's Built This Way)
DockerWorks is a single static Go binary (~15–30 MB) that runs as a native systemd service on your Linux host.
Instead of trying to reimplement a container runtime over low-level socket APIs, DockerWorks wraps the exact tools you already use and trust on the host: docker compose, podman compose, podman Quadlets, systemctl, git, and sops. It runs a lightweight polling loop (and an optional HTTP server for webhooks and Prometheus /metrics), detects changes, verifies container or systemd unit health after every deploy, and automatically rolls back if anything fails. Because it compiles to a zero-dependency binary with CGO_ENABLED=0, it uses ~15–30 MB of RAM and logs cleanly straight to journald.
+---------------------------------------+
| Remote Sources |
| - GitHub / GitLab (Compose/Quadlets) |
| - OCI Registry (Images & Artifacts) |
+---------------------------------------+
| ^
Webhook (Push) / | | Polling (Pull)
Digest Check v |
+---------------------------------------+
| DockerWorks (systemd) |
| |
| - HTTP Server (/healthz, /metrics, |
| /webhooks/{app}) |
| - Watchers (Git, Registry, OCI, |
| Self-Config GitOps) |
| - Pre-flight (SOPS + Go Templates) |
| - Engine (Compose / Quadlet + |
| Healthcheck + Rollback) |
+---------------------------------------+
|
v
+---------------------------------------+
| Host Runtime (Docker / Podman) |
| (Rootful or Rootless Containers) |
+---------------------------------------+
Think of it as ArgoCD's pull-based reconciliation loop, purpose-built for single-host Docker and Podman servers.
Three Ways to Ship Updates
Not every team, or every server wants to deploy the same way, so DockerWorks supports three distinct update sources out of the box.
You can track a Git branch, watch container image digests in an OCI registry, or pull your entire deployment bundle as an OCI artifact without installing Git on the server at all. Even better, you can mix and match these modes per app inside the same config.yaml, or combine a Git/OCI config watcher with an image digest watcher on the same service.
Here is how each mode works in practice.
1. Pull-Based GitOps (apps[].git)
If your Compose files or Quadlets live in GitHub, GitLab, or Gitea, GitOps mode keeps your host in sync with a target branch without opening inbound SSH from CI.
On every poll, DockerWorks runs a lightweight git ls-remote check rather than cloning or fetching the whole repo, and only runs git clone / git fetch when the remote commit SHA actually changes. Credentials are passed via scoped GIT_CONFIG_* environment variables (http.<scheme>://<host>.extraHeader) or shell-quoted SSH keys (ssh_key_path), so tokens never show up in ps output or journald error logs. If you deploy multiple apps from a single monorepo, you can define repo, branch, and auth once under defaults.git and set only git.path per app (overriding git.auth only when an app lives in a separate repository):
defaults:
git:
repo: "https://gitlab.example.com/group/infra-monorepo.git"
branch: "main"
poll_interval: "2m"
auth:
token: "${GITLAB_TOKEN}"
apps:
- name: "web-app-a1"
git:
path: "docker-works-apps/web-app-a1"
- name: "billing-api"
git:
repo: "https://github.com/myorg/billing-api.git"
auth:
token: "${GITHUB_TOKEN}" # Overrides defaults.git.auth for this repo
One monorepo, one shared config, zero SSH keys needed in CI.
2. Container Registry Digest Watcher (apps[].registry)
Sometimes your Compose file rarely changes, and you just want a service to redeploy whenever CI pushes a new image to :latest or a release tag.
Instead of pulling gigabytes of image layers on every poll, DockerWorks sends a fast HEAD (or fallback GET) request to inspect the remote manifest's sha256 digest. Only when the remote digest differs from the last deployed digest in state.json does it trigger a pull and redeploy, and it automatically falls back to your host's ~/.docker/config.json or Podman auth.json if you don't inline credentials.
apps:
- name: "my-api"
work_dir: "/opt/apps/my-api"
registry:
watch_images:
- "ghcr.io/myorg/api:latest"
poll_interval: "3m"
Fast manifest checks mean you can poll frequently without hammering bandwidth or disk I/O.
3. 100% Gitless Mode with OCI Artifacts (apps[].oci)
If you want locked-down production servers with no Git repositories or deploy keys on disk, your OCI registry can store your config files too.
Using oras, your CI pipeline can bundle docker-compose.yml, Quadlet .container files, and encrypted configs into an OCI artifact and push them right alongside your container images (oras push ghcr.io/myorg/my-app-config:latest ...). DockerWorks watches that artifact's digest, downloads and extracts it safely (with Zip-Slip traversal checks, symlink rejection, and a 64 MiB extraction cap), and deploys it—even rolling back by pulling the previous immutable @sha256:... digest if health checks fail.
apps:
- name: "gitless-web"
oci:
artifact: "ghcr.io/myorg/my-app-config:latest"
poll_interval: "2m"
One registry transport for both your images and your deployment manifests.
First-Class Podman Quadlets (and Rootless Mode)
If you run workloads on RHEL, Fedora, or modern Ubuntu, you have probably noticed the shift toward Podman and Quadlets.
Quadlets let you define containers as clean INI-style .container, .pod, .network, .volume, and .kube files that systemd turns into native system services—no Docker daemon required. DockerWorks supports Podman via both podman compose (defaults.runtime: "podman") and native Quadlet management (mode: "quadlet"). When mode: "quadlet" is enabled, DockerWorks syncs your unit files cleanly into /etc/containers/systemd/<app>/ (or ~/.config/containers/systemd/<app>/ in rootless mode), pulls any Image= references, runs systemctl [--user] daemon-reload, restarts units in dependency order (.network → .volume → .image → .build → .pod → .kube → .container), and monitors unit health.
Portable ./ Paths Without Hardcoding Host Directories
One classic annoyance with Quadlets is that systemd's Quadlet generator expects unit files in /etc/containers/systemd/ (or ~/.config/containers/systemd/), far away from your Git checkout.
DockerWorks solves this by automatically rewriting ./ relative paths in Volume=, EnvironmentFile= (including -./), Yaml=, ConfigMap=, and SeccompProfile= to absolute paths under your synced repo directory when copying the unit files. Meanwhile, absolute host data paths like /data/kafka and named volumes like mydata.volume are left completely untouched.
# web-app-a1.container
[Container]
Image=prom/prometheus:latest
# Rewritten automatically to <work_dir>/prometheus.yml
Volume=./prometheus.yml:/etc/prometheus/prometheus.yml:Z,ro
# Persistent host storage stays untouched
Volume=/data/prometheus:/prometheus:Z,U
# Optional .env file in Git (or decrypted by SOPS)
EnvironmentFile=-./secrets.env
(Quick tip for rootless Podman: use :Z,ro or :z on ./ bind mounts inside work_dir rather than :U, because :U remaps host file ownership to a subuid and can block future Git pulls or template overwrites.)
Scheduled & Oneshot Batch Tasks
Not every container is a long-running web server—sometimes you need a database migration or a nightly backup job.
DockerWorks handles Type=oneshot Quadlet containers cleanly by inspecting Type,ActiveState,SubState,Result via systemctl show, treating ActiveState=inactive with Result=success as a healthy completion instead of timing out. If you pair a batch .container with a systemd .timer file, DockerWorks syncs the .timer into /etc/systemd/system (or ~/.config/systemd/user), enables and restarts the timer, and skips firing the target .service immediately on every deploy.
Best Practice: Run in Rootless User Mode
When your Podman containers and Quadlets are rootless, you should run docker-works itself in user mode too.
systemctl --user enable --now podman.socket
sudo loginctl enable-linger "$USER"
systemctl --user enable --now docker-works-podman
Running as a non-root user automatically sets quadlet.user_mode: true, targets ~/.config/containers/systemd and ~/.config/systemd/user, and keeps your entire deployment pipeline unprivileged from end to end.
Production Guardrails: Rollbacks, Secrets, Templates, and Self-Config
Shipping fast is easy; recovering automatically when a bad commit slips through is what makes a tool production-ready.
DockerWorks builds four guardrails directly into the deployment pipeline so you don't have to duct-tape them together with brittle bash scripts.
1. Automated Health Checks & Rollbacks
Every deployment finishes with a health-check loop before DockerWorks marks a commit or digest as successful.
For Compose apps, it polls compose ps --format json up to health_check_timeout; for Quadlets, it polls systemctl show for ActiveState and Result. If a container crashes, exits non-zero, or reports unhealthy, DockerWorks immediately rolls back to the previous Git commit (or immutable @sha256 OCI digest), re-runs on_rollback, restarts the previous stack, and records the broken commit in state.json so it won't crash-loop on the next poll.
2. Encrypted Secrets in Git with SOPS (apps[].sops)
Storing 25 separate environment variables in AWS Secrets Manager for every microservice gets tedious fast.
With apps[].sops, you can commit a SOPS-encrypted secrets.enc.env (or .yaml/.json) straight to your Git repo or OCI bundle and keep one age private key in AWS Secrets Manager / /etc/docker-works/env (or zero keys on disk if your host has an AWS KMS IAM role). Before pre_deploy hooks and container startup, DockerWorks runs sops --decrypt and writes the output atomically with 0600 permissions—and on rollback, it automatically re-decrypts the previous commit's secrets so your secrets stay in lockstep with your code.
3. Dynamic Configs with Go text/template (apps[].templates)
If you are coming from Ansible, you probably have Jinja2 templates like prometheus.yml.j2 with loops over inventory hosts.
Instead of requiring Python and Jinja2 on every target server, DockerWorks includes a zero-dependency Go text/template renderer (apps[].templates) that merges YAML/JSON vars_files (including SOPS-decrypted var files) and inline vars. It parses templates with missingkey=error so typos fail fast and trigger rollbacks, and supports an optional mode: "0600" when rendering sensitive configs.
apps:
- name: "prometheus"
mode: "quadlet"
git:
path: "apps/prometheus"
sops:
age_key: "${SOPS_AGE_KEY}"
files:
- source: "secrets.enc.env"
target: "secrets.env"
templates:
vars_files: ["vars.yaml"]
files:
- source: "prometheus.yml.tmpl"
target: "prometheus.yml"
4. Self-Config GitOps & Hot Reload (config_git + apps_dir)
Once you manage ten or twenty apps on a host, editing /etc/docker-works/config.yaml over SSH gets old too.
With config_git, your host only needs a tiny bootstrap config.yaml pointing to your infra repository (and you can split each app into its own file under apps_dir, like apps.d/*.yaml). Whenever you push a change, DockerWorks validates the new config first—keeping the active engine running if someone pushes broken YAML—and hot-reloads the watchers in-process if everything checks out.
Even docker-works itself follows GitOps.
Migrating Safely with --dry-run (plus Webhooks & Prometheus /metrics)
Nobody wants to point a brand-new deployment daemon at live production containers without testing it first.
That is why DockerWorks includes a Dry-Run & Migration mode (--dry-run on sync and daemon, plus per-app dry_run: true). When dry-run is enabled, DockerWorks still runs read-only git ls-remote and registry digest checks, clones into a temporary staging folder, verifies your SOPS decryption and Go templates, and prints the exact Compose or systemctl commands it would execute—without touching a single running container, systemd unit, or state.json. You can set defaults.dry_run: true globally and flip individual apps to dry_run: false one by one as you cut over.
# 1. Check host prerequisites (Docker/Podman, Compose, sops, config syntax)
docker-works doctor --config /etc/docker-works/config.yaml
# 2. Test one-shot migration safely without mutating containers
docker-works sync --config /etc/docker-works/config.yaml --app my-app --dry-run
# 3. Or run the daemon in shadow mode alongside existing manual containers
docker-works daemon --config /etc/docker-works/config.yaml --dry-run
For day-2 operations, you can also enable the embedded HTTP server (server.enabled: true) for instant GitHub/GitLab/Bearer webhooks (POST /webhooks/{app}), /healthz liveness checks, and zero-dependency Prometheus metrics (GET /metrics when server.metrics_enabled: true) tracking deployment counts, durations, rollbacks, and watcher errors.
Where DockerWorks Fits in Your Stack
DockerWorks is not trying to replace Ansible or Kubernetes—it is meant to sit cleanly alongside the tools you already use.
- Keep Ansible for host provisioning: Let Ansible configure
/etc/hosts, firewall rules, base packages, storage mounts, and installdocker-worksitself via.debor.rpm(while container-only host entries can move intoextra_hosts:or QuadletAddHost=). - Use DockerWorks for single-host & small-fleet app delivery: If you run Compose or Podman Quadlets on VMs, homelabs, or edge nodes (including active/standby pairs behind Keepalived or a load balancer), DockerWorks gives you pull-based GitOps without cluster overhead.
- Move to Kubernetes + ArgoCD when you outgrow single hosts: Once you need multi-node bin-packing, horizontal pod autoscaling, and cluster-wide service discovery, a full orchestrator is the right tool.
Choosing the right tool for the size of the problem keeps your infrastructure boring and reliable.
Get Started
DockerWorks is MIT-licensed and open source, with static binaries and native .deb/.rpm packages for Linux amd64 and arm64.
Check out the GitHub repository or read the documentation (including step-by-step Nginx tutorials for both Docker Compose and Podman Quadlets). If you are tired of maintaining custom deploy scripts for single-host containers, give it a try.
Issues, feedback, and PRs are always welcome.
Happy shipping!
Frequently Asked Questions (FAQ)
How is DockerWorks different from Watchtower?
Watchtower only watches container image tags and restarts running Docker containers. DockerWorks manages full Docker Compose stacks, Podman Compose, and Podman Quadlets from Git or OCI artifacts, runs health-check-verified automated rollbacks, decrypts SOPS secrets, and renders Go templates.
Does DockerWorks replace Ansible?
No—they complement each other. Keep Ansible for host-level provisioning (/etc/hosts, firewalls, base packages, storage mounts, and installing docker-works), and let DockerWorks handle continuous application delivery and rollbacks.
Can I run DockerWorks without root privileges?
Yes. Both Rootless Docker (docker-works-user.service) and Rootless Podman (docker-works-podman-user.service) are supported via systemctl --user, and DockerWorks automatically adjusts its default config/state paths and Quadlet user_mode when running as a non-root user.
Do I need Git installed on my production servers?
Not if you use Gitless OCI mode (apps[].oci) or Registry Digest Watcher (apps[].registry). You can package your Compose/Quadlet files as an OCI artifact (oras push) and pull both configs and images from the same container registry.
How are secrets handled without putting plaintext in Git?
Use apps[].sops to commit SOPS-encrypted .env or config files in Git/OCI while storing only one age private key on the host (or using an AWS KMS IAM role). DockerWorks decrypts files atomically with 0600 permissions before deploy and re-decrypts the previous commit's secrets on rollback.
What happens if someone pushes a broken config to config_git?
DockerWorks validates the new config.yaml before hot-reloading. If parsing or validation fails, it logs an error, keeps running on the last valid configuration, and skips the broken commit until a new commit is pushed.
Disclaimer: DockerWorks is an independent, non-commercial open-source project and is not affiliated with, sponsored by, or endorsed by Docker, Inc. "Docker" is a registered trademark of Docker, Inc.
Indika Kodagoda
Indika Kodagoda is a Lead DevOps Engineer, AWS certification instructor, and the creator of CloudQubes. He specializes in cloud infrastructure, automation, and modern Ruby on Rails development. When he’s not deploying code or mentoring aspiring engineers, he’s usually enjoying nature and cycling local gravel paths.