Open errordeveloper opened 7 years ago
what if #202 returned a reference which you could later use with a compose
dsl keyword which accepted a list of layer ids? There would also be a function to query the existing image store for layer ids.
I've been mulling over how to do image rebase in the DSL and this is what I have so far. Seems like paths are converging around this functionality.
ref1 = layer { run "ls" }
ref2 = layer { run "apt-get update" }
imgrefs = getrefs("golang:latest")
compose [*imgrefs, ref1, ref2]
ok I re-read this and I think I see what you're getting at, although I'm not certain how to accomplish it. You want to seed the cache after using from
to initialize it?
overmount gives us a lot more access to the cache's contents so perhaps we can do something once that has deeper integration. Maybe a re-targetable from?
Layer cache is great, but at times it's not smart enough or non-transparent in how it decided to rebuild something and there is only certain depth we can go into and sometimes it's much easier to use a tagging scheme using git revision and check for image SHA1 being present locally and make decisions about whether build should run at all or not.
I have a project where Makefile looks like this:
And rather very simple Dockerfile:
This Makefile is not amazing, but it is able to decide rather very quickly whether build needs to run at all or not. I could probably convert this to use
box
, but I'm not 100% sure how and to what extend I'd be able to simplify the Makefile. It's possible that some of this can already be done withbox
, but there may be a need for helpers that would allow either running local commands or being able to reference image SHA1's or may be I'm missing the point entierly?