docker-scripts/docker-system-prune

12 lines
369 B
Bash
Executable File

#!/usr/bin/env bash
#set -ex
SSH_USER=$(whoami)
SWARM_MANAGER_IP=$(docker node inspect self --format '{{ .Status.Addr }}')
HOSTS=$(docker node ls --format="{{ .Hostname }}")
echo
for HOSTNAME in ${HOSTS}; do
echo "Processing system prune operation for host: ${HOSTNAME}..."
ssh "${SSH_USER}@${HOSTNAME}.$(hostname -d)" 'docker system prune -f';
echo
done