Podman / Docker containers
Services that run in containers (PostgreSQL, for example) can be managed together with process services. Everything goes through the engine’s CLI (podman start, stop -t, kill, inspect, logs -f, compose -p … up -d); commands are always argument arrays, never go through a shell, and add no dependencies.

Configuration
A service’s kind is container or compose, and the engine defaults to podman; to use Docker set "containerEngine": "docker" at the top level. For the fields (container, project, composeFile, readyCmd, image, createArgs) and examples see configuration.md.
Build from a Containerfile
When a service sets build, devhub builds the image and creates the container; without it the “existing container or image” mode above applies.
"web": { "kind": "container", "container": "my-web", "repo": "my-app", "build": "./web", "port": 8080 }- Minimal:
"build": "./web". devhub looks forContainerfilein the context, thenDockerfile; the path is relative to the selected worktree, so switching worktree builds that worktree’s content. For the full form andports,environmentandvolumessee configuration.md. - When it builds: at start devhub hashes the context content plus
file,argsandtargetand compares it with the image labeldevhub.build-hash; if equal it skips, and it builds only when different or when the image doesn’t exist. Content means file contents (modification times are ignored), honoring<file>.dockerignore,.containerignoreand.dockerignore(the build file itself is always included);.gitis excluded. A context over 20000 files or 1 GB is an immediate error; add a.dockerignore(for example excludingnode_modules). - Rebuild: “Rebuild” on the service row, or
devhub rebuild <service>(devhub start/restart --rebuild), always rebuilds the image. When the service is running the UI asks whether to restart; only with--restartis the old container stopped and replaced by one from the new image, otherwise it only builds and swaps at the next start. - Logs: build output is written to the service’s log file, and the log panel shows it during the build and after a failed build; once the build succeeds and the container runs, it shows the container’s own log. On failure the service doesn’t start, and the error and log explain why; both
restartand “Rebuild and restart” build first, and when it fails the old container keeps running. - Timeout and cancel: a single build is limited to 20 minutes. Pressing “Stop” during a build (
devhub stop) terminates it, that start ends as “Build cancelled” and no container is created. - Removing and recreating containers: containers devhub creates carry the labels
devhub.managed,devhub.serviceanddevhub.hash(a hash of the image id and all run parameters). At start, only when a container is stopped but its hash differs from the current one (image rebuilt,ports/environment/volumes/createArgschanged, or a relative volume of another worktree) is itrm’d and recreated, without-fand without-v, so volumes are untouched. Only these labeled containers belonging to the same service are handled; a user container with the same name (no labels) is always refused with an explanation and never deleted. - Engine: follows
containerEngine(podman by default; for Docker set"containerEngine": "docker"), and if the podman machine isn’t running it is started automatically first.
Behavior
- State: all containers are fetched at once with
ps -a(cached for 2 seconds). While a container is running but the port, health check orhealthcheck(includingreadyCmd) hasn’t passed, it shows “Starting”; compose is summarized per member asn/m running(the button is “Start the rest” when partly running). The state column is marked with a container icon, and uptime comes from the container’sStartedAt. - Readiness: with a port it waits for the port; if the image has a healthcheck it waits for healthy; if
healthcheckis set (execruns inside the container,http/tcpconnect from the host to the published port) it waits for that to pass; timeouts followstackTimeoutSec. The oldreadyCmdfield is an alias ofhealthcheck.exec; for its behavior and state semantics see configuration.md. - Stop:
stop -t <stopTimeoutSec>, with a countdown shown while stopping, and “Force stop” useskill. Restart = stop then start. Compose only doesup -dandstop. - Stacks: a container can join a stack and start along the
dependsOngraph (members withoutdependsOnstart together); state derivation, “Restart all” and conflict protection are all supported (containers have no worktree distinction, so worktrees aren’t compared). - podman machine: the header’s Podman pill shows the machine state and lets you start or stop it; when starting a container while the machine isn’t running, devhub first runs
podman machine startautomatically and waits for the engine, and if that fails it aborts and shows the reason. Before stopping the machine it asks for confirmation in the page and lists the containers that will stop with it. On Linux, or with Docker, where there is no machine concept, these buttons are hidden. - Logs:
podman logs -f --tail 200(podman compose logs -ffor compose) is piped into the docked log; the stream ends when the container stops, and reopening resumes it. - Import from an existing container: after choosing “Container” for a new service, press “Import from an existing container” to list
podman ps -a; choosing one prefills the name, image and port. - CLI and activity log:
devhub status/start/stop/restart/logssupport container services (status gains a type column, and containers show no worktree or pid); container operations and machine start/stop (machine.start/machine.stop) are all written to the activity log. - Never deleted: devhub never deletes your containers or volumes and offers no
compose down; the only exception is Build from a Containerfile, where it removes only stale containers devhub itself created (carrying devhub labels). “Delete” in the UI removes only the config entry, not images or containers.
Limitations
Build: advanced build fields such as secrets, ssh, cache_from and multi-platform are not supported (build it yourself when you need them, then use image); stopping a service doesn’t remove the container automatically (recreation only happens at the next start); a stack restart stops first and then starts, so when a build fails the old container is already stopped; the engine is chosen only from the containerEngine setting and never falls back to Docker when podman is missing; images devhub builds are not cleaned up automatically, so run podman image prune yourself.
The Docker engine doesn’t report container start time, so the uptime column is empty; compose one-off containers (initialization jobs that finish and exit) also count as members and make the project show “partly running”; createArgs is used only when creating a container that doesn’t exist, so to change it later handle it on the engine yourself. For podman machine on Windows (WSL backend) see windows.md.