Message ID | 20191016121014.29201-1-stephen@that.guru |
---|---|
State | Superseded |
Headers | show |
Series | [1/3] docker: Rely on caching | expand |
On 16-10-2019 14:10, Stephen Finucane wrote: > 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 | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git tools/docker/Dockerfile tools/docker/Dockerfile > index 35324b13..a8e85ef0 100644 > --- tools/docker/Dockerfile > +++ tools/docker/Dockerfile > @@ -47,15 +47,12 @@ 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! The "ping the user in entrypoint.sh if the change them!" has some typo that I can't pin-point. At least it is something that I'm report for extra care :-) > +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"] Cheers Geert Stappers
On Wed, 2019-10-16 at 21:33 +0200, Geert Stappers wrote: > On 16-10-2019 14:10, Stephen Finucane wrote: > > > 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 | 9 +++------ > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > diff --git tools/docker/Dockerfile tools/docker/Dockerfile > > index 35324b13..a8e85ef0 100644 > > --- tools/docker/Dockerfile > > +++ tools/docker/Dockerfile > > @@ -47,15 +47,12 @@ 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! > > The > > "ping the user in entrypoint.sh if the change them!" > > has some typo that I can't pin-point. > > At least it is something that I'm report for extra care :-) Yeah, fair point. Re-added (with grammar fixes) in v2. Stephen > > +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"] > > > Cheers > > Geert Stappers > > > > _______________________________________________ > Patchwork mailing list > Patchwork@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/patchwork
diff --git tools/docker/Dockerfile tools/docker/Dockerfile index 35324b13..a8e85ef0 100644 --- tools/docker/Dockerfile +++ tools/docker/Dockerfile @@ -47,15 +47,12 @@ 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! +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"]
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 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)