build

package
v0.20.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "build",
	Usage: "build image on cluster",

	Flags: []cli.Flag{
		app.NamespaceFlag,

		&cli.StringFlag{
			Name:    "file",
			Usage:   "Name of the Dockerfile (default: \"PATH/Dockerfile\")",
			Aliases: []string{"f"},
		},

		&cli.StringFlag{
			Name:  "image",
			Usage: "image name (format: registry/repository:tag)",
		},

		&cli.BoolFlag{
			Name:  "insecure",
			Usage: "use insecure registry",
		},

		&cli.StringFlag{
			Name:  "username",
			Usage: "registry username",
		},

		&cli.StringFlag{
			Name:  "password",
			Usage: "registry password",
		},
	},

	Action: func(ctx context.Context, cmd *cli.Command) error {
		client := app.MustClient(ctx, cmd)
		namespace := app.Namespace(ctx, cmd)

		file := cmd.String("file")

		path, err := build.ParsePath(cmd.Args().Get(0))

		if err != nil {
			return err
		}

		image, err := build.ParseImage(cmd.String("image"))

		if err != nil {
			return err
		}

		image.Insecure = cmd.Bool("insecure")

		image.Username = cmd.String("username")
		image.Password = cmd.String("password")

		options := &build.RunOptions{
			Namespace: namespace,
		}

		return build.Run(ctx, client, image, path, file, options)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL