Consider using Docker custom build outputs (--output
) for generated Dockerfiles and Readmes
#5654
Labels
--output
) for generated Dockerfiles and Readmes
#5654
I noticed this new feature today (requires BuildKit): https://docs.docker.com/reference/cli/docker/image/build/#output
How we generate Dockerfiles and Readmes today is a bit of an anti-pattern - we call the ImageBuilder image (with the
dotnet-docker
repo baked in), leave the container on the disk, copy the files out of the container on the disk, and then delete the container.Using Docker's build output feature could simplify the generated files build process. All we'd need is a simple Dockerfile (one for Readmes, one for Dockerfiles) that is based on ImageBuilder. I'm imagining something like this -
Then just building the Dockerfile with the
-o .
argument to dump the outputsrc/
dir into the current directory. No containers left on disk to cleanup or copy files out of. This could simplify lots of our logic in Invoke-ImageBuilder.ps1. And potentially eliminate the need for Dockerfile.WithRepo? Just an idea.The text was updated successfully, but these errors were encountered: