aiodocker
aiodocker copied to clipboard
Add `mktar_from_directory` util
Long story short
I have used aiodocker in a couple of projects, the one thing i find myself implementing is a mktar_from_directory
function (or similar) to enable building an image with artefacts
my implementaion/s are very similar to the existing mktar_from_directory
, im wondering if it would be helpful to PR this addition
How to reproduce
try to build an image that has artefacts
Looks like a great idea. Would you prepare a pull request? Tests are required, they should be an easy excercise.
@asvetlov does it mean that existing mktar_from_tar
just needs a new arg directory
and new line with t.add(directory, arcname='.')
?
Sorry, I cannot find mktar_from_tar
function in the project.
Sorry, mb - mktar_from_dockerfile
I think a separate function is needed.
The function should not accept dockerfile
argument but a folder (with dockerfile inside usually) to archive.
the most simple implementation would be to send the entire directory/context - ideally it would be able to filter according to any .dockerignore
function, but not sure how easy that is in terms of parsing/filtering
Maybe use docker-py implementation with PatternMatcher
for .dockerignore
?
sounds like a plan, but im guessing we would want to avoid a dependency, so i guess it would be a matter of cribbing it
they also cribbed it from moby