diff options
author | Stephen Finucane <stephen@that.guru> | 2019-10-15 13:21:41 +0100 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2019-10-17 12:01:33 +0100 |
commit | a0ca2b931187a1514c10d483a731f0ef88f64114 (patch) | |
tree | 5cf84f92d39747b6374e93529785499d46777dd5 /tools/docker | |
parent | f51e71db33ddf07ccd0f628fd31f84c7eff83e3a (diff) | |
download | patchwork-a0ca2b931187a1514c10d483a731f0ef88f64114.tar patchwork-a0ca2b931187a1514c10d483a731f0ef88f64114.tar.gz |
docker: Rely on caching
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>
Diffstat (limited to 'tools/docker')
-rw-r--r-- | tools/docker/Dockerfile | 11 | ||||
-rwxr-xr-x | tools/docker/entrypoint.sh | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 35324b1..550871b 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -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"] diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh index 456d640..6314f1b 100755 --- a/tools/docker/entrypoint.sh +++ b/tools/docker/entrypoint.sh @@ -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. |