0

I think it's the http headers that are being sent by Bitbucket. I have this in a Dockerfile:

ADD https://bitbucket.org/teros/datavana/raw/"$commit"/moodwire/mwapi/requirements.txt  '/teros/temp/requirements.txt'
ADD https://bitbucket.org/teros/datavana/raw/"$commit"/moodwire/mwapi/constraints.txt '/teros/temp/constraints.txt'

but the problem is those files haven't changed, but Docker doesn't cache them - it re-runs them:

Step 32/63 : ARG commit
 ---> Using cache
 ---> a60e2b6be500
Step 33/63 : ADD https://bitbucket.org/teros/datavana/raw/"$commit"/moodwire/mwapi/requirements.txt  '/teros/temp/requirements.txt'
Downloading  1.545kB
 ---> 2e3b379a1ac4
Step 34/63 : ADD https://bitbucket.org/teros/datavana/raw/"$commit"/moodwire/mwapi/constraints.txt '/teros/temp/constraints.txt'
Downloading  1.545kB

is because Bitbucket is not responding with an HTTP 300 code? Maybe there is a query param I can use something like:

https://bitbucket.org/teros/datavana/raw/"$commit"/moodwire/mwapi/constraints.txt?use_cache=yes

or something like that?

1 Answers1

0

Docker is looking at the Last-Modified header to determine caching behavior.

https://docs.docker.com/engine/reference/builder/#add

mmla
  • 1,578
  • 19
  • 21