]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
docker: Rely on caching
authorStephen Finucane <stephen@that.guru>
Tue, 15 Oct 2019 12:21:41 +0000 (13:21 +0100)
committerStephen Finucane <stephen@that.guru>
Thu, 17 Oct 2019 11:01:33 +0000 (12:01 +0100)
It seems less likely that tox and tox-pyenv will change than our
requirements. Split up the 'RUN' steps so we don't have to reinstall the
former every time the latter change.

Signed-off-by: Stephen Finucane <stephen@that.guru>
tools/docker/Dockerfile
tools/docker/entrypoint.sh

index 35324b13c66a8c6556fe0a5d442b5a950f8169f7..550871b607f23557d94481ddb59e8348aa9a13e1 100644 (file)
@@ -47,15 +47,14 @@ RUN pyenv latest install 2.7 && \
     pyenv latest install 3.5 && \
     pyenv latest install 3.6 && \
     pyenv latest install 3.7
-
 RUN pyenv global $(pyenv versions --bare | tac)
 
-COPY requirements-*.txt /tmp/
-RUN pip install tox tox-pyenv && \
-    pip install -r /tmp/requirements-dev.txt
+RUN pip install tox tox-pyenv
 
-# we deliberately leave the requirements files in tmp so we can
-# ping the user in entrypoint.sh if the change them!
+# we deliberately leave the requirements files in /opt so we can ping the user
+# in entrypoint.sh if they change
+COPY requirements-dev.txt requirements-test.txt /opt/
+RUN pip install -r /opt/requirements-dev.txt
 
 COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
 ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
index 456d640d5d2c8389c61da1f3ebded23b6c1a8642..6314f1b64eb978c59a3668b70dd0b4b769fae223 100755 (executable)
@@ -70,7 +70,7 @@ fi
 set +e
 
 # check if we need to rebuild because requirements changed
-for x in /tmp/requirements-*.txt; do
+for x in /opt/requirements-*.txt; do
     if ! cmp $x ~/patchwork/$(basename $x); then
         cat << EOF
 A requirements file has changed.