Yes, we are working on documenting it better, and there are a couple of builder features coming in that will be good to publicise wider. Taking a note of it, and will do.
I think there are multiple things to clarify:
- If you use
latest
for the image, in normal Docker that is frequently cached, and that’s the intended behaviour, when it means one doesn’t care about the explicit version of the image to pull. If you want to care about the explicit image to pull, then use a specific tag there. You could for example version your dockerfile, and then pull in the specific version in your resin Dockerfile (so you always know what version is running, and caching is solved) - if I read the original issue correctly, the caching is the main thing for you, and that is generally the
no-cache
branch helps - the Env variables there are not used for the build, they are just a simple way to modify the Dockerfile, and force docker to rebuild everything after that point. So in your case that wouldn’t do the proper thing either, as
latest
might or might not be cached. - currently there’s no way to pass build arguments to docker on resin. If you’d like to build things differently, you would have to use the resin-cli and do local builds (instead of building on the resin servers). Build time variables are on the roadmap but not quite there yet.
So I guess the most reliable way in your setup would be versioning your own dockerfile (and moving away from using :latest
), in which case you will need to update the resin Dockerfile still, but it do caching exactly as you expect (and as a bonus, you will know exactly what version is deployed)