-
Notifications
You must be signed in to change notification settings - Fork 799
Push using Dockerfile not using cache in ADD command #1334
Comments
I agree that it'd be nice for them to work. The issue stems from how our builder is set up:
So the file could be uncached for a couple reasons possibly:
Those assumptions are what pop into my mind, but I'm not too sure about the specifics on cache busting. |
@bacongobbler does Heroku pass build flags through
Neither are ideal. I'd much prefer a |
What build flags are you referring to? I think I'm getting lost with what you mean by that term. I honestly think this is more of the fact that we strip file metadata or that we're modifying the file flags like "last updated" without even knowing it. |
To ensure backwards compatibility, some apps on creation do not have the respective directory in etcd set before a build. Because of that, the build directory would be deleted in the middle of a build. With the proposed fix, the directory will not be deleted if there is a build running. because of how gitreceive works, the repository is built on a push, making it possible to build, delete, then build again. The downside to this is the loss of being able to cache Dockerfile builds, but that's already an issue as noted in deis#1334.
This comes up through Google when searching for the keywords "git archive docker build," so I thought I'd just add this cross-reference for the benefit of anyone else who might find this. Here's a workaround for the cache-busting properties of
And here's a thread on the Git mailing list: http://thread.gmane.org/gmane.comp.version-control.git/257432 |
Thanks @dbrock! We have a PR going to re-write the builder script in bash so we could definitely investigate using this snippet. 😄 |
this effects COPY statements also right? |
+1 @mhahn |
Since caching is pretty important for some applications shouldn't this issue be added as a note to http://docs.deis.io/en/latest/using_deis/using-dockerfiles/#using-dockerfiles ? |
Yes, I think so. I'll make a PR with the documentation change. |
IMO, we're trying to avoid adding bugs in the documentation. Bugs should stay in bug trackers; docs in the documentation. If it's a common problem (read: not a bug; usually a UX issue) that users see often, then we'd add it in Troubleshooting Deis. If it's a limitation with the platform that we'd like to see, but is unsolvable without a major re-write/breaking changes then we'd list it as a note (such as the note about publishing multiple ports in http://docs.deis.io/en/latest/using_deis/using-dockerfiles/#dockerfile-requirements). Otherwise, we direct users here for bug reports as we do in other issues. |
This isn't really appropriate for the Troubleshooting Deis doc, as there is no workaround currently. Although it is really a UX problem. I'm persuaded by your argument @bacongobbler. |
Docker v1.8 release notes say "Make build cache ignore mtime." When we are able to use that newer Docker in builder, this bug should be fixed. |
Horray! :-) |
We should verify this now that we're on Docker 1.8.3. |
This has been fixed.
|
I'm deploying my nodejs application using Dockerfile. To avoid having to install the dependencies in every push, I tried to take advantage of docker cache. But with
git push deis master
, the cache has never been used like when I tried withdocker build
:The cache is supposed to be used in Step 7 and so on, because there was no modification in
.npmrc
andpackage.json
.Could anyone please explain why the behavior is different from using directly
docker build
? Thanks!!The text was updated successfully, but these errors were encountered: