docker language - benclifford/text GitHub Wiki
Extensions that I'd like to dockerfile-like language that address weaknesses that I've worked around a bit on previous projects
(based in part on experience in production)
-
ability to add subdirs without sending entire pwd as context:
use: monorepo, want to add subdirs A/ and B/ into image but dont care about C/, D/ .. Z/ and those latter ones are very large so expensive and wasteful to ship to docker daemon only to be ignored.
current workaround: in haskell, build image with A/ pwd, then build another image with B/ pwd, chained on from first build with dynamic image ID
- cache invalidation
workarounds:
-
explicit token in ENV / ADD a force file, and code to figure it out.
-
explicitly named intermediate steps (eg. component.requirements build depending on the requirements.txt file)
- docker does this already but I've been in situations where I have wanted things done a bit differently (eg using a shared wheel directory, or getting access to the requirements install image without the end component installed)
- local tags / local naming
- scoped eg to local tree
- shared filesystem at build
- for local caches. argument against is weak when build also allows access to the internet which is totally non-deterministic.
workaround: run those commands as a docker run / docker image snapshot
- out of tree dockerfiles / machine generated docker files
though this is perhaps a side-effect of working around the stuff above?
workaround: generate into tree. run docker. delete.
main problem with generating into tree and not deleting is your tree is now dirty.
more generally, build environment is very much a "package this subtree off and send it over" style, which gives certain constraints.