proposals/archives/build_tarball.md
Currently, Jib can build a container image to either a registry or a Docker daemon. Recently, there
have been requests for the ability to build an image tarball directly to the filesystem so that the
user may load it into a Docker daemon via docker load, either manually or via a build system.
jib-image.tarThe user will be able to output a docker loadable image tarball by running gradle jibBuildTar
for Gradle or mvn jib:buildTar for Maven.
The "build tarball" task is almost identical to the "build to docker daemon" task, except for the
final step, which writes the final tarball to a file instead of piping it to a docker load
command. To avoid duplicate code, a boolean parameter can be used in the steps runners to determine
whether to build to a Docker daemon or build to a tarball.
The following changes will be made to the code:
BuildConfigurationBuildTarballAndLoadDockerStep to LoadDockerStepWriteTarFileStep for writing a Blob to diskBuildSteps#forBuildToTarball(), which would contain the same steps as
forBuildToDockerDaemon() up until after the FinalizingStep, where it would run a
WriteTarFileStep instead of a LoadDockerStepBuildSteps.forBuildToTarball()