{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/20380","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/20380/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/20380/comments","events_url":"https://api.github.com/repos/docker/docker/issues/20380/events","html_url":"https://github.com/docker/docker/issues/20380","id":134155200,"number":20380,"title":"Caching not working with docker load in 1.10.0","user":{"login":"kimh","id":924390,"avatar_url":"https://avatars.githubusercontent.com/u/924390?v=3","gravatar_id":"","url":"https://api.github.com/users/kimh","html_url":"https://github.com/kimh","followers_url":"https://api.github.com/users/kimh/followers","following_url":"https://api.github.com/users/kimh/following{/other_user}","gists_url":"https://api.github.com/users/kimh/gists{/gist_id}","starred_url":"https://api.github.com/users/kimh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimh/subscriptions","organizations_url":"https://api.github.com/users/kimh/orgs","repos_url":"https://api.github.com/users/kimh/repos","events_url":"https://api.github.com/users/kimh/events{/privacy}","received_events_url":"https://api.github.com/users/kimh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-17T02:07:12Z","updated_at":"2016-02-17T02:17:42Z","closed_at":null,"body":"I'm relying on `docker save` and `docker load` to take the advantage of the caching until 1.9.1 but this technique seems not working in 1.10.0. I'm doing this instead of using normal caching because this is on CI where created images and cache do not persist in next build.\r\n\r\nHere is how to reproduce.\r\n\r\nDockerfile\r\n```\r\n$ cat Dockerfile\r\nFrom busybox\r\nRUN echo 'bbbb'\r\nRUN echo 'ffff'\r\n```\r\n\r\nCreate a image\r\n```\r\n$ docker build -t cache-test .\r\nSending build context to Docker daemon 2.048 kB\r\nStep 1 : FROM busybox\r\n ---> 3240943c9ea3\r\nStep 2 : RUN echo 'bbbb'\r\n ---> Running in c56df4a6e3f4\r\nbbbb\r\n ---> 8e5bb62e1278\r\nRemoving intermediate container c56df4a6e3f4\r\nStep 3 : RUN echo 'ffff'\r\n ---> Running in bf656c2b5385\r\nffff\r\n ---> 043911d06ec5\r\nRemoving intermediate container bf656c2b5385\r\nSuccessfully built 043911d06ec5\r\n```\r\n\r\nSave the image to tar file\r\n```\r\n$ docker save cache-test > /tmp/cache-test.tar\r\n```\r\n\r\nDelete the image\r\n```\r\n$ docker rmi cache-test\r\nUntagged: cache-test:latest\r\nDeleted: bca6443ae25a399e8922a876df0a87b5b948598000e44e66324c5b40b08b6c04\r\nDeleted: 36585925a99995799b1ba60a5032738f8fa3ea9a13bcc8de54cd3ea13b9e47b4\r\n```\r\n\r\nLoad the cache\r\n```\r\n$ docker load -i /tmp/cache-test.tar\r\n```\r\n\r\nNow cache is not being used\r\n```\r\n$ docker build -t cache-test .\r\nSending build context to Docker daemon 2.048 kB\r\nStep 1 : FROM busybox\r\n ---> 3240943c9ea3\r\nStep 2 : RUN echo 'bbbb'\r\n ---> Running in c56df4a6e3f4\r\nbbbb\r\n ---> 8e5bb62e1278\r\nRemoving intermediate container c56df4a6e3f4\r\nStep 3 : RUN echo 'ffff'\r\n ---> Running in bf656c2b5385\r\nffff\r\n ---> 043911d06ec5\r\nRemoving intermediate container bf656c2b5385\r\nSuccessfully built 043911d06ec5\r\n````\r\n\r\nWhen I do the same process with 1.9.1, cache is used as expected. Is this the expected behavior?\r\n\r\n---------------------------\r\n`docker -v`:Docker version 1.10.0, build 590d5108\r\n\r\n`docker info`:\r\n\r\n```\r\nContainers: 0\r\n Running: 0\r\n Paused: 0\r\n Stopped: 0\r\nImages: 53\r\nServer Version: 1.10.0\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 34\r\n Dirperm1 Supported: false\r\nExecution Driver: native-0.2\r\nLogging Driver: json-file\r\nPlugins:\r\n Volume: local\r\n Network: host bridge null\r\nKernel Version: 3.13.0-24-generic\r\nOperating System: Ubuntu 14.04 LTS\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 1\r\nTotal Memory: 1.955 GiB\r\nName: vagrant-ubuntu-trusty\r\nID: ZEOX:ICBJ:GU66:P5OB:H5LD:4ZBV:HRFA:GF2K:JPGJ:RNVW:C5BM:6PCG\r\nWARNING: No swap limit support\r\n```\r\n\r\n`uname -a`:  Linux vagrant-ubuntu-trusty 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/184978854","html_url":"https://github.com/docker/docker/issues/20380#issuecomment-184978854","issue_url":"https://api.github.com/repos/docker/docker/issues/20380","id":184978854,"user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T02:17:42Z","updated_at":"2016-02-17T02:17:42Z","body":"This is expected behavior and is caused by content addressable storage.\r\n\r\nIn Docker 1.10, images are now content addressable. Part of this change means that images are flat bundles instead of a chain of dependencies where 1 layer == 1 image.\r\n\r\nIn order for caching to work with save/load you'd have to save each build step as an image and then load it as an image.\r\n\r\nPinging @tonistiigi since this has been discussed a number of times recently."}}