Skip to content

dicer compose exec

Runs a command inside a service’s instance, /bin/sh if none is given, as dicer exec does. Flags go before the service: everything after it is the command’s.

Usage

$ dicer compose exec [flags] SERVICE [COMMAND [ARG...]]

Examples

$ dicer compose exec db
$ dicer compose exec db psql -U postgres
$ dicer compose exec -T web cat /etc/nginx/nginx.conf > nginx.conf

Flags

FlagDescription
-e, --env stringArrayEnvironment variable as KEY=VALUE, or KEY to pass this shell’s value (repeatable).
-T, --no-ttyDo not allocate a pseudo-TTY.
--timeout durationKill the command after this long, e.g. 30s (0: no limit).
-t, --ttyAllocate a pseudo-TTY (default: when stdin and stdout are a terminal).
-u, --user stringUser to run as: user, uid, user:group or uid:gid (default: the workload’s user).
-w, --workdir stringWorking directory inside the instance.

Global flags

FlagDescription
-D, --debugTrace every call to the daemon on stderr (or set $DICER_DEBUG).
-r, --remote stringDaemon to talk to: a remote’s name, or an address (unix:///PATH or HOST:PORT) (default $DICER_REMOTE, then the current remote, then local).
--request-timeout durationGive up on a single call to the daemon after this long, e.g. 30s (0: never; streams such as logs -f and exec are not bounded).