mirror of https://github.com/docker/docs.git
Enforce our use of the explicitly frozen images
This requires that any environment where we wish to run the integration-cli tests includes both the `Dockerfile` and `curl`, which has been deemed an appropriate and acceptable trade-off. Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
This commit is contained in:
parent
636037c363
commit
793ebba3d6
|
@ -11,10 +11,10 @@ if ! docker inspect "${images[@]}" &> /dev/null; then
|
||||||
hardCodedDir='/docker-frozen-images'
|
hardCodedDir='/docker-frozen-images'
|
||||||
if [ -d "$hardCodedDir" ]; then
|
if [ -d "$hardCodedDir" ]; then
|
||||||
( set -x; tar -cC "$hardCodedDir" . | docker load )
|
( set -x; tar -cC "$hardCodedDir" . | docker load )
|
||||||
elif [ -e Dockerfile ] && command -v curl > /dev/null; then
|
else
|
||||||
# testing for "curl" because "download-frozen-image.sh" is built around curl
|
|
||||||
dir="$DEST/frozen-images"
|
dir="$DEST/frozen-images"
|
||||||
# extract the exact "RUN download-frozen-image.sh" line from the Dockerfile itself for consistency
|
# extract the exact "RUN download-frozen-image.sh" line from the Dockerfile itself for consistency
|
||||||
|
# NOTE: this will fail if either "curl" is not installed or if the Dockerfile is not available/readable
|
||||||
awk '
|
awk '
|
||||||
$1 == "RUN" && $2 == "./contrib/download-frozen-image.sh" {
|
$1 == "RUN" && $2 == "./contrib/download-frozen-image.sh" {
|
||||||
for (i = 2; i < NF; i++)
|
for (i = 2; i < NF; i++)
|
||||||
|
@ -33,11 +33,5 @@ if ! docker inspect "${images[@]}" &> /dev/null; then
|
||||||
}
|
}
|
||||||
' Dockerfile | sh -x
|
' Dockerfile | sh -x
|
||||||
( set -x; tar -cC "$dir" . | docker load )
|
( set -x; tar -cC "$dir" . | docker load )
|
||||||
else
|
|
||||||
for image in "${images[@]}"; do
|
|
||||||
if ! docker inspect "$image" &> /dev/null; then
|
|
||||||
( set -x; docker pull "$image" )
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue