mirror of
https://github.com/gdiepen/docker-convenience-scripts.git
synced 2025-01-18 10:08:55 +00:00
Remove not needed indentation on output lines
This commit is contained in:
parent
38c6ef5988
commit
0eccb0dd4d
@ -2,27 +2,29 @@
|
|||||||
|
|
||||||
|
|
||||||
echo "List of all volumes:"
|
echo "List of all volumes:"
|
||||||
|
echo
|
||||||
|
|
||||||
for docker_volume_id in $(docker volume ls -q)
|
for docker_volume_id in $(docker volume ls -q)
|
||||||
do
|
do
|
||||||
echo " (Un)named volume: ${docker_volume_id}"
|
echo "(Un)named volume: ${docker_volume_id}"
|
||||||
|
|
||||||
|
|
||||||
docker_volume_size=$(docker run --rm -t -v ${docker_volume_id}:/volume_data ubuntu bash -c "du -hs /volume_data | cut -f1" )
|
docker_volume_size=$(docker run --rm -t -v ${docker_volume_id}:/volume_data ubuntu bash -c "du -hs /volume_data | cut -f1" )
|
||||||
|
|
||||||
echo " Size: ${docker_volume_size}"
|
echo " Size: ${docker_volume_size}"
|
||||||
|
|
||||||
|
|
||||||
num_related_containers=$(docker ps -a --filter=volume=${docker_volume_id} -q | wc -l)
|
num_related_containers=$(docker ps -a --filter=volume=${docker_volume_id} -q | wc -l)
|
||||||
|
|
||||||
if (( $num_related_containers > 0 ))
|
if (( $num_related_containers > 0 ))
|
||||||
then
|
then
|
||||||
echo " Connected containers:"
|
echo " Connected containers:"
|
||||||
docker ps -a --filter=volume=${docker_volume_id} --format "{{.Names}} [{{.Image}}] ({{.Status}})" | while read containerDetails
|
docker ps -a --filter=volume=${docker_volume_id} --format "{{.Names}} [{{.Image}}] ({{.Status}})" | while read containerDetails
|
||||||
do
|
do
|
||||||
echo " ${containerDetails}"
|
echo " ${containerDetails}"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo " No connected containers"
|
echo " No connected containers"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user