Like Docker 1.8, Docker no longer uses mtimeto cancel the cache (this changed in this request to pull # 12031 ).
When creating an image
- For local content (
ADD myfiles /somewhere/ COPY myfiles /somewhere), docker uses checksum changes to invalidate cache - Remote content (
ADD http://example.com/foobar /somewhere) is always loaded, but the build cache is invalid based on checksum changes. RUN (, wget foo.com/latest.gz) , ; . , , URL (wget http://example.com/package-major.minor.patch.gz)
Docker 1.9 , , Docker, t Docker, , .
FROM foobar
ARG MAJOR=1
ARG MINOR=0
ARG PATCH=0
ADD http://example.com/package-$MAJOR.$MINOR.$PATCH.gz /
http://example.com/package-1.0.0.gz, "major", "minor" "patch" build-time ;
docker build --build-arg MINOR=2 . Sat Jan 16 13:22:40 2016
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM ubuntu
---> 1c9b046c2850
Step 2 : ARG MAJOR=1
---> Using cache
---> a149d88772ba
Step 3 : ARG MINOR=0
---> Using cache
---> e3dae0189ffd
Step 4 : ARG PATCH=0
---> Using cache
---> 678d7ae33054
Step 5 : ADD http://example.com/package-$MAJOR.$MINOR.$PATCH.gz /
Get http://example.com/package-1.2.0.gz: dial tcp 127.0.0.1:80: getsockopt: connection refused
.
(), . Debian ?
Docker , . , docker pull yourbaseimage , - , .
Docker , , , .