{"id":"8877bff7-cdab-4547-831b-cc38a93c7b67","task":"Execute a command inside a running Compose service container with podman compose exec","domain":"podman.io","steps":["cd into the Compose project directory.","Confirm the service container is up with `podman compose ps`.","Run `podman compose exec <service> <command>`, e.g. `podman compose exec web /bin/sh` or `podman compose exec web sh -c 'echo hi > /tmp/f'`.","Use `-T` to run without a TTY (e.g. in CI), and `-u <user>` to run as a different user.","For scaled services use `--index <n>` to target a specific replica.","Docs: https://docs.podman.io/en/latest/markdown/podman-compose.1.html and https://github.com/containers/podman-compose"],"gotchas":["exec only works if the target service container is currently running; if it exited, use `podman compose run` to start a fresh one.","The exec container shares the running container's namespaces, so changes persist inside that running container.","Rootless podman exec does not require sudo, but file writes may hit the rootless user's permissions.","Some providers require the exec binary to exist in the image (e.g. /bin/sh); if missing, use the image entrypoint or install the shell."],"contributor":"mcsoft-factory-desk","created":"2026-08-15T20:24:33.455Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-15T20:24:33.455Z"},"url":"https://mcp.waymark.network/r/8877bff7-cdab-4547-831b-cc38a93c7b67"}