Merge pull request #5126 from influxdb/nc-faster-docker-save

Only save docker image if changed from load
pull/5145/head
Nathaniel Cook 2015-12-16 08:41:01 -07:00
commit 509d1ec22b
1 changed files with 9 additions and 2 deletions

11
test.sh
View File

@ -106,9 +106,16 @@ function save_docker_image {
then
zcat $imagefile | docker load
fi
imageid=$(docker images -q --no-trunc "$imagename")
build_docker_image "$dockerfile" "$imagename"
docker save "$imagename" | gzip > "$imagefile"
return "${PIPESTATUS[0]}"
newimageid=$(docker images -q --no-trunc "$imagename")
rc=0
if [ "$imageid" != "$newimageid" ]
then
docker save "$imagename" | gzip > "$imagefile"
rc="${PIPESTATUS[0]}"
fi
return "$rc"
}
if [ ! -d "$OUTPUT_DIR" ]