diff options
author | Nate McMaster <natemcmaster@users.noreply.github.com> | 2019-02-23 06:09:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-23 06:09:08 +0300 |
commit | 1b27c9905c45de45d57546c52663304570d7a2ad (patch) | |
tree | 33830f24325dcb1cc4f101a192cdb6734b00231e /dockerbuild.sh | |
parent | e65004907a633a21e7e93b1c00e3944ffb10d8f8 (diff) |
Update dependencies and react to changes (#7844)
* Add workaround for dotnet/sdk#2976
* Add new restore sources
* Update BAR manifest to point to https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json
* Obsolete WithCulture
* Add retries to dockerbuild.sh
* Ensure each test run gets a unique in-memory database
Diffstat (limited to 'dockerbuild.sh')
-rwxr-xr-x | dockerbuild.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/dockerbuild.sh b/dockerbuild.sh index 9bbab769be..9d5d6ace11 100755 --- a/dockerbuild.sh +++ b/dockerbuild.sh @@ -104,6 +104,22 @@ fi dockerfile="$DIR/build/docker/$image.Dockerfile" tagname="aspnetcore-build-$image" +# Use docker pull with retries to pre-pull the image need by the dockerfile +# docker build regularly fails with TLS handshake issues for unclear reasons. +base_imagename="$(grep -E -o 'FROM (.*)' $dockerfile | cut -c 6-)" +pull_retries=3 +while [ $pull_retries -gt 0 ]; do + failed=false + docker pull $base_imagename || failed=true + if [ "$failed" = true ]; then + let pull_retries=pull_retries-1 + echo -e "${YELLOW}Failed to pull $base_imagename Retries left: $pull_retries.${RESET}" + sleep 1 + else + pull_retries=0 + fi +done + docker build "$(dirname "$dockerfile")" \ --build-arg "USER=$(whoami)" \ --build-arg "USER_ID=$(id -u)" \ |