Skip to content

Instantly share code, notes, and snippets.

@fabiomontefuscolo
Last active October 27, 2017 20:10
Show Gist options
  • Save fabiomontefuscolo/a6541b8c453c28af723625b85f488d96 to your computer and use it in GitHub Desktop.
Save fabiomontefuscolo/a6541b8c453c28af723625b85f488d96 to your computer and use it in GitHub Desktop.
docker commands

Clues

All rap.host labels

docker ps --filter='label=rap.host' --format '{{join (split (.Label "rap.host") ",") "\r"}}'

All rap.host of wordpress

docker ps \
    --filter 'label=rap.host' \
    --format '{{ .ID }}' \
    | while read id; \
    do
        docker exec $id sh -c 'test -d /var/www/html/wp-content' \
            && docker inspect $id --format '{{ join (split (index .Config.Labels "rap.host") ",") "\r" }}';
    done | sort

PIDs from mariadb containers

docker ps -q --filter name=mariadb | xargs docker inspect --format '{{.State.Pid }}, {{.Name}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment