datawire / forge

Define and run multi-container apps in Kubernetes
http://forge.sh
Apache License 2.0
415 stars 43 forks source link

speed up docker builds by using --cache-from #216

Open geekflyer opened 5 years ago

geekflyer commented 5 years ago

Hi,

docker builds can be sped up in certain scenarios using the --cache-from argument. This is particularly useful when using forge in a docker-in-docker CI environment (in our case gitlab-ci) where every build starts with a fresh environment. For a better explanation see for example: https://medium.com/@gajus/making-docker-in-docker-builds-x2-faster-using-docker-cache-from-option-c01febd8ef84

Is it possible to add a feature to specify one or multiple images to use as cache in the service.yaml?

Thanks!

ghost commented 5 years ago

reading through the code I found this: https://github.com/datawire/forge/blob/e78a297425d402ce5a87c1d193915c182706f06f/forge/docker.py#L32-L33 so I'm sure we could pass this with buildargs, I'd like to have this feature too.

I'll look into it and share what I find!

ghost commented 5 years ago

Can probably add this here: https://github.com/datawire/forge/blob/e78a297425d402ce5a87c1d193915c182706f06f/forge/docker.py#L92-L107

I could probably handle adding this feature in though it might be a while before I can get the PR up.