Documentation ¶
Index ¶
Constants ¶
View Source
const ( Name = "merge" Usage = "Merge two container images (optimized to merge minified images)" Alias = "m" )
View Source
const ( FlagImage = "image" FlagUseLastImageMetadata = "use-last-image-metadata" FlagTag = "tag" )
Merge command flag names
View Source
const ( FlagImageUsage = "Image to merge (flag instance position determines the merge order)" FlagUseLastImageMetadataUsage = "Use only the last image metadata for the merged image" FlagTagUsage = "Custom tags for the output image" )
Merge command flag usage info
Variables ¶
View Source
var CLI = &cli.Command{ Name: Name, Aliases: []string{Alias}, Usage: Usage, Flags: []cli.Flag{ cflag(FlagImage), cflag(FlagUseLastImageMetadata), cflag(FlagTag), }, Action: func(ctx *cli.Context) error { gfvalues := command.GlobalFlagValues(ctx) xc := app.NewExecutionContext( Name, gfvalues.QuietCLIMode, gfvalues.OutputFormat) if ctx.Args().Len() < 1 { xc.Out.Error("param.target", "missing target image ID/name") cli.ShowCommandHelp(ctx, Name) return nil } cfvalues, err := CommandFlagValues(xc, ctx) if err != nil { return nil } OnCommand( xc, gfvalues, cfvalues) return nil }, }
View Source
var CommandFlagSuggestions = &command.FlagSuggestions{ Names: []prompt.Suggest{ {Text: command.FullFlagName(FlagImage), Description: FlagImageUsage}, {Text: command.FullFlagName(FlagUseLastImageMetadata), Description: FlagUseLastImageMetadataUsage}, {Text: command.FullFlagName(FlagTag), Description: FlagTagUsage}, }, Values: map[string]command.CompleteValue{ command.FullFlagName(FlagUseLastImageMetadata): command.CompleteBool, }, }
View Source
var CommandSuggestion = prompt.Suggest{ Text: Name, Description: Usage, }
View Source
var Flags = map[string]cli.Flag{ FlagImage: &cli.StringSliceFlag{ Name: FlagImage, Value: cli.NewStringSlice(), Usage: FlagImageUsage, EnvVars: []string{"DSLIM_MERGE_IMAGE"}, }, FlagUseLastImageMetadata: &cli.BoolFlag{ Name: FlagUseLastImageMetadata, Value: false, Usage: FlagUseLastImageMetadataUsage, EnvVars: []string{"DSLIM_MERGE_USE_LAST_IMAGE_META"}, }, FlagTag: &cli.StringSliceFlag{ Name: FlagTag, Value: cli.NewStringSlice(), Usage: FlagTagUsage, EnvVars: []string{"DSLIM_TARGET_TAG"}, }, }
Functions ¶
func OnCommand ¶
func OnCommand( xc *app.ExecutionContext, gparams *command.GenericParams, cparams *CommandParams)
OnCommand implements the 'merge' command
func RegisterCommand ¶
func RegisterCommand()
Types ¶
type CommandParams ¶
type CommandParams struct { FirstImage string `json:"first_image"` LastImage string `json:"last_image"` UseLastImageMetadata bool `json:"use_last_image_metadata"` OutputTags []string `json:"output_tags"` }
func CommandFlagValues ¶
func CommandFlagValues(xc *app.ExecutionContext, ctx *cli.Context) (*CommandParams, error)
Click to show internal directories.
Click to hide internal directories.