feat: add push-only and tar path options for Docker image handling

This commit is contained in:
Ompragash Viswanathan
2025-07-07 19:13:10 +05:30
parent 576fa63696
commit c9f5cc5e37
2 changed files with 163 additions and 6 deletions
+20 -2
View File
@@ -222,6 +222,21 @@ func main() {
Usage: "User Layers",
EnvVar: "PLUGIN_LAYERS",
},
cli.BoolFlag{
Name: "push-only",
Usage: "Push existing Docker images without building",
EnvVar: "PLUGIN_PUSH_ONLY",
},
cli.StringFlag{
Name: "source-tar-path",
Usage: "Path to Docker image tar file to load and push",
EnvVar: "PLUGIN_SOURCE_TAR_PATH",
},
cli.StringFlag{
Name: "tar-path",
Usage: "Path to save Docker image as tar file",
EnvVar: "PLUGIN_TAR_PATH",
},
}
if err := app.Run(os.Args); err != nil {
@@ -231,8 +246,11 @@ func main() {
func run(c *cli.Context) error {
plugin := docker.Plugin{
Dryrun: c.Bool("dry-run"),
Cleanup: c.BoolT("docker.purge"),
Dryrun: c.Bool("dry-run"),
Cleanup: c.BoolT("docker.purge"),
PushOnly: c.Bool("push-only"),
SourceTarPath: c.String("source-tar-path"),
TarPath: c.String("tar-path"),
Login: docker.Login{
Registry: c.String("docker.registry"),
Username: c.String("docker.username"),