Skip to content

Instantly share code, notes, and snippets.

@fty4
Created March 25, 2020 13:22
Show Gist options
  • Save fty4/a6d43becf9c26d6a8dbfff260b46f721 to your computer and use it in GitHub Desktop.
Save fty4/a6d43becf9c26d6a8dbfff260b46f721 to your computer and use it in GitHub Desktop.
run command on every container - e.g. date and get its output
# run command on every container
for container in `docker ps --format '{{.Names}}'`; do printf "$container\t$(docker exec $container date)\n"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment