Caching a single file on Travis CI

2019-06-25 05:45发布

问题:

Inside my build on travis I need to first download a large .tar.gz file.

This .tar.gz never changes so it's a good idea cache it.

The .tar.gz it's downloaded inside my Dockerfile:

RUN curl ftp://mycompanyftp.com/foo/bar/mylargefile.tar.gz -o /tmp/mylarge.tar.gz

With that the docker container build with the file inside.

How can I cache this file?

PS: It's also possible to download the file on before_install and use docker ADD to put it inside the Docker container.