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 { if ctx.Args().Len() < 1 { fmt.Printf("slim[%s]: missing target info...\n\n", Name) cli.ShowCommandHelp(ctx, Name) return nil } gfvalues, err := commands.GlobalFlagValues(ctx) if err != nil { return err } xc := app.NewExecutionContext(Name, ctx.String(commands.FlagConsoleFormat)) cfvalues, err := CommandFlagValues(xc, ctx) if err != nil { return nil } OnCommand( xc, gfvalues, cfvalues) return nil }, }
View Source
var CommandFlagSuggestions = &commands.FlagSuggestions{ Names: []prompt.Suggest{ {Text: commands.FullFlagName(FlagImage), Description: FlagImageUsage}, {Text: commands.FullFlagName(FlagUseLastImageMetadata), Description: FlagUseLastImageMetadataUsage}, {Text: commands.FullFlagName(FlagTag), Description: FlagTagUsage}, }, Values: map[string]commands.CompleteValue{ commands.FullFlagName(FlagUseLastImageMetadata): commands.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 *commands.GenericParams, cparams *CommandParams)
OnCommand implements the 'merge' command
func RegisterCommand ¶
func RegisterCommand()
func TarTypeName ¶
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.