From 821fb5f36ecec8fd086a585ade378f94543cff5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Wed, 22 May 2019 17:44:50 +0200 Subject: [PATCH] Caching of requirements.txt After [a discussion][1] with rje6459 on the networktocode Slack in the #netbox-docker channel we've come up with a small improvement to those that regularly have to build netbox docker locally. It fetches the "requirements.txt" from the desired branch before downloading netbox itself. [1]: https://networktocode.slack.com/archives/CD23LP8BC/p1558537080023200 --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e7c760b..072f2ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,12 +32,15 @@ RUN pip install \ WORKDIR /opt ARG BRANCH=master +ARG REQUIREMENTS_URL=https://raw.githubusercontent.com/digitalocean/netbox/$BRANCH/requirements.txt +ADD ${REQUIREMENTS_URL} requirements.txt +RUN pip install -r requirements.txt + ARG URL=https://github.com/digitalocean/netbox/archive/$BRANCH.tar.gz RUN wget -q -O - "${URL}" | tar xz \ && mv netbox* netbox WORKDIR /opt/netbox -RUN pip install -r requirements.txt COPY docker/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py COPY configuration/gunicorn_config.py /etc/netbox/config/