From e33a2d2c0a89c79f3561f19f35056bf885a4d38a Mon Sep 17 00:00:00 2001 From: Robert Ellegate Date: Thu, 23 May 2019 11:20:39 -0400 Subject: [PATCH 1/2] Adding REF to GitHub repo HEAD for cache busting After installing requirements, check if HEAD has changed and bust cache for RUN instruction for wget archive --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 072f2ee..9c3a8c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,9 @@ ARG REQUIREMENTS_URL=https://raw.githubusercontent.com/digitalocean/netbox/$BRAN ADD ${REQUIREMENTS_URL} requirements.txt RUN pip install -r requirements.txt +ARG REF_URL=https://api.github.com/repos/digitalocean/netbox/git/refs/heads/$BRANCH +ADD ${REF_URL} version.json + ARG URL=https://github.com/digitalocean/netbox/archive/$BRANCH.tar.gz RUN wget -q -O - "${URL}" | tar xz \ && mv netbox* netbox From a086c2fc225e5bb5da032fe67e41d4307d45b5c5 Mon Sep 17 00:00:00 2001 From: Robert Ellegate Date: Tue, 28 May 2019 10:42:40 -0400 Subject: [PATCH 2/2] Changing REF_URL to use HEAD/TAG agnostic API Per [dicsuccion](https://github.com/netbox-community/netbox-docker/pull/137#issuecomment-495667921) with @cimnine, changing the API endpoint to one that retains functionality of previous URL while supporting both HEADS and TAGS --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9c3a8c1..1c0f053 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ ARG REQUIREMENTS_URL=https://raw.githubusercontent.com/digitalocean/netbox/$BRAN ADD ${REQUIREMENTS_URL} requirements.txt RUN pip install -r requirements.txt -ARG REF_URL=https://api.github.com/repos/digitalocean/netbox/git/refs/heads/$BRANCH +ARG REF_URL=https://api.github.com/repos/digitalocean/netbox/contents?ref=$BRANCH ADD ${REF_URL} version.json ARG URL=https://github.com/digitalocean/netbox/archive/$BRANCH.tar.gz