Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker::Image.build_from_dir breaks caching #269

Closed
errm opened this issue Mar 24, 2015 · 2 comments · Fixed by #275
Closed

Docker::Image.build_from_dir breaks caching #269

errm opened this issue Mar 24, 2015 · 2 comments · Fixed by #275

Comments

@errm
Copy link

errm commented Mar 24, 2015

The mtime on all the files is updated and thus breaks caching.

@errm
Copy link
Author

errm commented Mar 24, 2015

@randywallace
Copy link
Contributor

have you tried the util function included with this rubygem for creating a tar?

This works for me just fine and uses the cache:

img = Docker::Image.build_from_tar(Docker::Util.create_dir_tar('.')) do |chunk|
  puts JSON.parse(chunk)['stream']
end

img.tag 'repo' => 'test', 'tag' => 'test', 'force' => true

puts img.inspect

Here is my very simple Dockerfile used to demonstrate this (I tested this by running it a few times):

Step 0 : FROM ubuntu:14.04
 ---> d0955f21bf24
Step 1 : ADD lib/ /startup-functions
 ---> Using cache
 ---> 7054d9148442
Successfully built 7054d9148442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants