DOCKER-COMPOSE EXEC
Commande : docker-compose exec
Execute a command in a running container Usage: exec [options] [-e KEY=VAL...] SERVICE COMMAND [ARGS...] Options: -d, --detach Detached mode: Run command in the background. --privileged Give extended privileges to the process. -u, --user USER Run the command as this user. -T Disable pseudo-tty allocation. By default `docker-compose exec` allocates a TTY. --index=index index of the container if there are multiple instances of a service [default: 1] -e, --env KEY=VAL Set environment variables (can be used multiple times, not supported in API < 1.25) -w, --workdir DIR Path to workdir directory for this command.
Forcer l'arrêt des containers d'une application :
docker-compose exec [options] [-e KEY=VAL...] SERVICE COMMAND [ARGS...]
ex :
$ docker-compose exec redis apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
v3.8.1-34-ga8e558ca77 [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
v3.8.1-28-g1d8df16b35 [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
OK: 9540 distinct packages available