Jump to content

docker-size - a litle script to calculate the size of an image or container


gfjardim

Recommended Posts

Well, this is a small script I use to calculate the final size of an image or container.

 

#!/bin/bash
docker history $1 1>/dev/null 2>&1
if [[ $? -eq 0 ]]; then
  docker save $1 | dd of=/dev/null
else
  docker export  $1 | dd of=/dev/null
fi

 

Usage: docker-size <IMAGE | CONTAINER>

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...