From f250a103f3d4fe6c50aa9976fe55f5572f22967e Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 5 Apr 2016 08:03:01 -0700 Subject: [PATCH] fail hard when github is down Summary:public Sometimes github is down, and replies with an error page, which is not a good substitute for an opam binary. Failing makes docker not cache the result, so it's easy to try again when github gets better. Reviewed By: cristianoc Differential Revision: D3138561 fb-gh-sync-id: 6725c42 fbshipit-source-id: 6725c42 --- docker/Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 4c4370795..c528c7b4d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,10 +30,13 @@ RUN apt-get update && \ zlib1g-dev # Install OPAM -RUN curl -sL \ - https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Linux \ +RUN VERSION=1.2.2; \ + curl -sL \ + https://github.com/ocaml/opam/releases/download/$VERSION/opam-$VERSION-x86_64-Linux \ -o /usr/local/bin/opam && \ - chmod 755 /usr/local/bin/opam + chmod 755 /usr/local/bin/opam && \ + ((/usr/local/bin/opam --version | grep -q $VERSION) || \ + (echo "failed to download opam from GitHub."; exit 1)) RUN opam init -y --comp=4.02.3 # Download the latest Infer release