Skip to content

Instantly share code, notes, and snippets.

@mapk0y
Last active November 24, 2015 11:45
Show Gist options
  • Save mapk0y/8181cbf680551ca91717 to your computer and use it in GitHub Desktop.
Save mapk0y/8181cbf680551ca91717 to your computer and use it in GitHub Desktop.
docker network から bridge にぶら下がっているコンテナ名一覧を取る方法

条件

  • jq が必要
  • docker 1.9.0

コマンド

$ docker network inspect bridge \
  | jq -r '.[].Containers | keys | @sh' \
  | xargs -r docker inspect \
  | jq -r '.[].Name | ltrimstr("/")'

備考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment