build

package
v0.0.0-...-5f60744 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name  = "build"
	Usage = "Analyzes, profiles and optimizes your container image auto-generating Seccomp and AppArmor security profiles"
	Alias = "b"
)
View Source
const (
	FlagImageBuildEngine = "image-build-engine"
	FlagImageBuildArch   = "image-build-arch"

	FlagDeleteFatImage = "delete-generated-fat-image"

	FlagShowBuildLogs = "show-blogs"

	FlagPathPerms        = "path-perms"
	FlagPathPermsFile    = "path-perms-file"
	FlagPreservePath     = "preserve-path"
	FlagPreservePathFile = "preserve-path-file"
	FlagIncludePath      = "include-path"
	FlagIncludePathFile  = "include-path-file"
	FlagIncludeBin       = "include-bin"
	FlagIncludeBinFile   = "include-bin-file"
	FlagIncludeExe       = "include-exe"
	FlagIncludeExeFile   = "include-exe-file"
	FlagIncludeShell     = "include-shell"

	FlagIncludeWorkdir            = "include-workdir"
	FlagWorkdirExclude            = "workdir-exclude"
	FlagIncludeAppImageAddCopyAll = "include-app-image-addcopy-all"
	FlagIncludeAppImageRun        = "include-app-image-run"
	FlagIncludeAppImageAll        = "include-app-image-all"

	FlagAppImageStartInst       = "app-image-start-instruction"
	FlagAppImageStartLayerCount = "app-image-start-layer-count"
	FlagAppImageStartInstGroup  = "app-image-start-instruction-group"
	FlagAppImageStartDetect     = "app-image-start-detect"
	FlagAppImageDockerfile      = "app-image-dockerfile" //TODO: make it work with FlagBuildFromDockerfile too

	FlagIncludePathsCreportFile = "include-paths-creport-file"

	FlagIncludeOSLibsNet = "include-oslibs-net"

	FlagIncludeZoneInfo = "include-zoneinfo"

	FlagIncludeCertAll     = "include-cert-all"
	FlagIncludeCertBundles = "include-cert-bundles-only"
	FlagIncludeCertDirs    = "include-cert-dirs"
	FlagIncludeCertPKAll   = "include-cert-pk-all"
	FlagIncludeCertPKDirs  = "include-cert-pk-dirs"

	FlagIncludeNew = "include-new"

	FlagKeepTmpArtifacts = "keep-tmp-artifacts"

	FlagIncludeAppNuxtDir            = "include-app-nuxt-dir"
	FlagIncludeAppNuxtBuildDir       = "include-app-nuxt-build-dir"
	FlagIncludeAppNuxtDistDir        = "include-app-nuxt-dist-dir"
	FlagIncludeAppNuxtStaticDir      = "include-app-nuxt-static-dir"
	FlagIncludeAppNuxtNodeModulesDir = "include-app-nuxt-nodemodules-dir"

	FlagIncludeAppNextDir            = "include-app-next-dir"
	FlagIncludeAppNextBuildDir       = "include-app-next-build-dir"
	FlagIncludeAppNextDistDir        = "include-app-next-dist-dir"
	FlagIncludeAppNextStaticDir      = "include-app-next-static-dir"
	FlagIncludeAppNextNodeModulesDir = "include-app-next-nodemodules-dir"

	FlagIncludeNodePackage = "include-node-package"

	FlagKeepPerms = "keep-perms"

	//Flags to edit (modify, add and remove) image metadata
	FlagNewEntrypoint = "new-entrypoint"
	FlagNewCmd        = "new-cmd"
	FlagNewLabel      = "new-label"
	FlagNewVolume     = "new-volume"
	FlagNewExpose     = "new-expose"
	FlagNewWorkdir    = "new-workdir"
	FlagNewEnv        = "new-env"
	FlagRemoveVolume  = "remove-volume"
	FlagRemoveExpose  = "remove-expose"
	FlagRemoveEnv     = "remove-env"
	FlagRemoveLabel   = "remove-label"

	FlagTag = "tag"

	FlagImageOverrides = "image-overrides"

	//Flags to build fat images from Dockerfile
	FlagTagFat              = "tag-fat"
	FlagBuildFromDockerfile = "dockerfile"
	FlagDockerfileContext   = "dockerfile-context"
	FlagCBOAddHost          = "cbo-add-host"
	FlagCBOBuildArg         = "cbo-build-arg"
	FlagCBOLabel            = "cbo-label"
	FlagCBOTarget           = "cbo-target"
	FlagCBONetwork          = "cbo-network"
	FlagCBOCacheFrom        = "cbo-cache-from"

	//Experimenal flags
	FlagObfuscateMetadata = "obfuscate-metadata"
)

Build command flag names

View Source
const (
	FlagImageBuildEngineUsage = "Select image build engine: internal | docker | none"
	FlagImageBuildArchUsage   = "Select output image build architecture"

	FlagDeleteFatImageUsage = "Delete generated fat image requires --dockerfile flag"

	FlagShowBuildLogsUsage = "Show image build logs"

	FlagPathPermsUsage        = "Set path permissions in optimized image"
	FlagPathPermsFileUsage    = "File with path permissions to set"
	FlagPreservePathUsage     = "" /* 128-byte string literal not displayed */
	FlagPreservePathFileUsage = "" /* 146-byte string literal not displayed */
	FlagIncludePathUsage      = "Keep path from original image"
	FlagIncludePathFileUsage  = "File with paths to keep from original image"
	FlagIncludeBinUsage       = "Keep binary from original image (executable or shared object using its absolute path)"
	FlagIncludeExeUsage       = "Keep executable from original image (by executable name)"
	FlagIncludeShellUsage     = "Keep basic shell functionality"

	FlagIncludeWorkdirUsage = "Keep files in working directory"

	FlagIncludeAppImageAllUsage     = "Keep everything in the app part of the container image"
	FlagAppImageStartInstGroupUsage = "Instruction group (reverse) index that indicates where the app starts in the container image"
	FlagAppImageStartInstUsage      = "Instruction (prefix) that indicates where the app starts in the container image"
	FlagAppImageDockerfileUsage     = "Path to app image Dockerfile (used to determine where the application part of the image starts)"

	FlagIncludePathsCreportFileUsage = "Keep files from the referenced creport"

	FlagIncludeOSLibsNetUsage = "Keep the common networking OS libraries"

	FlagIncludeZoneInfoUsage = "Keep the OS/libc zoneinfo data"

	FlagIncludeCertAllUsage     = "Keep all discovered cert files"
	FlagIncludeCertBundlesUsage = "Keep only cert bundles"
	FlagIncludeCertDirsUsage    = "Keep known cert directories and all files in them"
	FlagIncludeCertPKAllUsage   = "Keep all discovered cert private keys"
	FlagIncludeCertPKDirsUsage  = "Keep known cert private key directories and all files in them"

	FlagIncludeNewUsage = "Keep new files created by target during dynamic analysis"

	FlagKeepTmpArtifactsUsage = "Keep temporary artifacts when command is done"

	FlagIncludeAppNuxtDirUsage            = "Keep the root Nuxt.js app directory"
	FlagIncludeAppNuxtBuildDirUsage       = "Keep the build Nuxt.js app directory"
	FlagIncludeAppNuxtDistDirUsage        = "Keep the dist Nuxt.js app directory"
	FlagIncludeAppNuxtStaticDirUsage      = "Keep the static asset directory for Nuxt.js apps"
	FlagIncludeAppNuxtNodeModulesDirUsage = "Keep the node modules directory for Nuxt.js apps"

	FlagIncludeAppNextDirUsage            = "Keep the root Next.js app directory"
	FlagIncludeAppNextBuildDirUsage       = "Keep the build directory for Next.js app"
	FlagIncludeAppNextDistDirUsage        = "Keep the static SPA directory for Next.js apps"
	FlagIncludeAppNextStaticDirUsage      = "Keep the static public asset directory for Next.js apps"
	FlagIncludeAppNextNodeModulesDirUsage = "Keep the node modules directory for Next.js apps"

	FlagIncludeNodePackageUsage = "Keep node.js package by name"

	FlagKeepPermsUsage = "Keep artifact permissions as-is"

	FlagNewEntrypointUsage = "New ENTRYPOINT instruction for the optimized image"
	FlagNewCmdUsage        = "New CMD instruction for the optimized image"
	FlagNewVolumeUsage     = "New VOLUME instructions for the optimized image"
	FlagNewLabelUsage      = "New LABEL instructions for the optimized image"
	FlagNewExposeUsage     = "New EXPOSE instructions for the optimized image"
	FlagNewWorkdirUsage    = "New WORKDIR instruction for the optimized image"
	FlagNewEnvUsage        = "New ENV instructions for the optimized image"
	FlagRemoveExposeUsage  = "Remove EXPOSE instructions for the optimized image"
	FlagRemoveEnvUsage     = "Remove ENV instructions for the optimized image"
	FlagRemoveLabelUsage   = "Remove LABEL instructions for the optimized image"
	FlagRemoveVolumeUsage  = "Remove VOLUME instructions for the optimized image"

	FlagTagUsage = "Custom tags for the generated image"

	FlagImageOverridesUsage = "" /* 171-byte string literal not displayed */

	FlagIncludeBinFileUsage = "File with shared binary file names to include from image"
	FlagIncludeExeFileUsage = "File with executable file names to include from image"

	FlagTagFatUsage              = "Custom tag for the fat image built from Dockerfile"
	FlagBuildFromDockerfileUsage = "The source Dockerfile name to build the fat image before it's optimized"
	FlagDockerfileContextUsage   = "The build context directory when building source Dockerfile"
	FlagCBOAddHostUsage          = "Add an extra host-to-IP mapping in /etc/hosts to use when building an image"
	FlagCBOBuildArgUsage         = "Add a build-time variable"
	FlagCBOLabelUsage            = "Add a label when building from Dockerfiles"
	FlagCBOTargetUsage           = "Target stage to build for multi-stage Dockerfiles"
	FlagCBONetworkUsage          = "Networking mode to use for the RUN instructions at build-time"
	FlagCBOCacheFromUsage        = "Add an image to the build cache"

	FlagObfuscateMetadataUsage = "Obfuscate the standard system and application metadata to make it more challenging to identify the image components"
)

Build command flag usage info

View Source
const (
	IBENone     = "none"
	IBEInternal = "internal"
	IBEDocker   = "docker"
	IBEBuildKit = "buildkit"
)
View Source
const (
	ArchEmpty = ""
	ArchAmd64 = "amd64"
	ArchArm64 = "arm64"
)

Variables

View Source
var CLI = &cli.Command{
	Name:    Name,
	Aliases: []string{Alias},
	Usage:   Usage,
	Flags: append([]cli.Flag{
		commands.Cflag(commands.FlagCommandParamsFile),
		commands.Cflag(commands.FlagTarget),
		commands.Cflag(commands.FlagPull),
		commands.Cflag(commands.FlagDockerConfigPath),
		commands.Cflag(commands.FlagRegistryAccount),
		commands.Cflag(commands.FlagRegistrySecret),
		commands.Cflag(commands.FlagShowPullLogs),

		commands.Cflag(commands.FlagComposeFile),
		commands.Cflag(commands.FlagTargetComposeSvc),
		commands.Cflag(commands.FlagTargetComposeSvcImage),
		commands.Cflag(commands.FlagComposeSvcStartWait),
		commands.Cflag(commands.FlagComposeSvcNoPorts),
		commands.Cflag(commands.FlagDepExcludeComposeSvcAll),
		commands.Cflag(commands.FlagDepIncludeComposeSvc),
		commands.Cflag(commands.FlagDepExcludeComposeSvc),
		commands.Cflag(commands.FlagDepIncludeComposeSvcDeps),
		commands.Cflag(commands.FlagDepIncludeTargetComposeSvcDeps),
		commands.Cflag(commands.FlagComposeNet),
		commands.Cflag(commands.FlagComposeEnvNoHost),
		commands.Cflag(commands.FlagComposeEnvFile),
		commands.Cflag(commands.FlagComposeProjectName),
		commands.Cflag(commands.FlagComposeWorkdir),
		commands.Cflag(commands.FlagContainerProbeComposeSvc),
		commands.Cflag(commands.FlagHostExec),
		commands.Cflag(commands.FlagHostExecFile),

		commands.Cflag(commands.FlagTargetKubeWorkload),
		commands.Cflag(commands.FlagTargetKubeWorkloadNamespace),
		commands.Cflag(commands.FlagTargetKubeWorkloadContainer),
		commands.Cflag(commands.FlagTargetKubeWorkloadImage),
		commands.Cflag(commands.FlagKubeManifestFile),
		commands.Cflag(commands.FlagKubeKubeconfigFile),

		commands.Cflag(commands.FlagPublishPort),
		commands.Cflag(commands.FlagPublishExposedPorts),
		commands.Cflag(commands.FlagRunTargetAsUser),
		commands.Cflag(commands.FlagShowContainerLogs),
		commands.Cflag(commands.FlagEnableMondelLogs),
		cflag(FlagShowBuildLogs),
		commands.Cflag(commands.FlagCopyMetaArtifacts),
		commands.Cflag(commands.FlagRemoveFileArtifacts),
		commands.Cflag(commands.FlagExec),
		commands.Cflag(commands.FlagExecFile),

		cflag(FlagTag),
		cflag(FlagImageOverrides),

		commands.Cflag(commands.FlagCRORuntime),
		commands.Cflag(commands.FlagCROHostConfigFile),
		commands.Cflag(commands.FlagCROSysctl),
		commands.Cflag(commands.FlagCROShmSize),
		commands.Cflag(commands.FlagUser),
		commands.Cflag(commands.FlagEntrypoint),
		commands.Cflag(commands.FlagCmd),
		commands.Cflag(commands.FlagWorkdir),
		commands.Cflag(commands.FlagEnv),
		commands.Cflag(commands.FlagEnvFile),
		commands.Cflag(commands.FlagLabel),
		commands.Cflag(commands.FlagVolume),
		commands.Cflag(commands.FlagLink),
		commands.Cflag(commands.FlagEtcHostsMap),
		commands.Cflag(commands.FlagContainerDNS),
		commands.Cflag(commands.FlagContainerDNSSearch),
		commands.Cflag(commands.FlagNetwork),
		commands.Cflag(commands.FlagHostname),
		commands.Cflag(commands.FlagExpose),
		commands.Cflag(commands.FlagMount),

		cflag(FlagImageBuildEngine),
		cflag(FlagImageBuildArch),
		cflag(FlagBuildFromDockerfile),
		cflag(FlagDockerfileContext),
		cflag(FlagTagFat),
		cflag(FlagCBOAddHost),
		cflag(FlagCBOBuildArg),
		cflag(FlagCBOCacheFrom),
		cflag(FlagCBOLabel),
		cflag(FlagCBOTarget),
		cflag(FlagCBONetwork),
		cflag(FlagDeleteFatImage),

		cflag(FlagNewEntrypoint),
		cflag(FlagNewCmd),
		cflag(FlagNewExpose),
		cflag(FlagNewWorkdir),
		cflag(FlagNewEnv),
		cflag(FlagNewVolume),
		cflag(FlagNewLabel),
		cflag(FlagRemoveExpose),
		cflag(FlagRemoveEnv),
		cflag(FlagRemoveLabel),
		cflag(FlagRemoveVolume),
		commands.Cflag(commands.FlagExcludeMounts),
		commands.Cflag(commands.FlagExcludePattern),
		cflag(FlagPreservePath),
		cflag(FlagPreservePathFile),
		cflag(FlagIncludePath),
		cflag(FlagIncludePathFile),
		cflag(FlagIncludeBin),
		cflag(FlagIncludeBinFile),
		cflag(FlagIncludeExeFile),
		cflag(FlagIncludeExe),
		cflag(FlagIncludeShell),
		cflag(FlagIncludeWorkdir),
		cflag(FlagIncludeAppImageAll),
		cflag(FlagAppImageStartInstGroup),
		cflag(FlagAppImageStartInst),
		cflag(FlagAppImageDockerfile),
		cflag(FlagIncludePathsCreportFile),
		cflag(FlagIncludeOSLibsNet),
		cflag(FlagIncludeZoneInfo),
		cflag(FlagIncludeCertAll),
		cflag(FlagIncludeCertBundles),
		cflag(FlagIncludeCertDirs),
		cflag(FlagIncludeCertPKAll),
		cflag(FlagIncludeCertPKDirs),
		cflag(FlagIncludeNew),
		cflag(FlagKeepTmpArtifacts),
		cflag(FlagIncludeAppNuxtDir),
		cflag(FlagIncludeAppNuxtBuildDir),
		cflag(FlagIncludeAppNuxtDistDir),
		cflag(FlagIncludeAppNuxtStaticDir),
		cflag(FlagIncludeAppNuxtNodeModulesDir),
		cflag(FlagIncludeAppNextDir),
		cflag(FlagIncludeAppNextBuildDir),
		cflag(FlagIncludeAppNextDistDir),
		cflag(FlagIncludeAppNextStaticDir),
		cflag(FlagIncludeAppNextNodeModulesDir),
		cflag(FlagIncludeNodePackage),
		cflag(FlagKeepPerms),
		cflag(FlagPathPerms),
		cflag(FlagPathPermsFile),
		cflag(FlagObfuscateMetadata),
		commands.Cflag(commands.FlagContinueAfter),
		commands.Cflag(commands.FlagUseLocalMounts),
		commands.Cflag(commands.FlagUseSensorVolume),
		commands.Cflag(commands.FlagRTAOnbuildBaseImage),
		commands.Cflag(commands.FlagRTASourcePT),

		commands.Cflag(commands.FlagSensorIPCEndpoint),
		commands.Cflag(commands.FlagSensorIPCMode),
	}, commands.HTTPProbeFlags()...),
	Action: func(ctx *cli.Context) error {
		xc := app.NewExecutionContext(Name, ctx.String(commands.FlagConsoleFormat))
		_ = ctx.String(commands.FlagCommandParamsFile)

		cbOpts, err := GetContainerBuildOptions(ctx)
		if err != nil {
			xc.Out.Error("param.error.container.build.options", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		deleteFatImage := ctx.Bool(commands.FlagDeleteFatImage)
		if cbOpts.Dockerfile == "" {
			deleteFatImage = false
		}

		composeFiles := ctx.StringSlice(commands.FlagComposeFile)

		targetComposeSvc := ctx.String(commands.FlagTargetComposeSvc)
		targetComposeSvcImage := ctx.String(commands.FlagTargetComposeSvcImage)
		composeSvcNoPorts := ctx.Bool(commands.FlagComposeSvcNoPorts)
		depExcludeComposeSvcAll := ctx.Bool(commands.FlagDepExcludeComposeSvcAll)
		depIncludeComposeSvcDeps := ctx.String(commands.FlagDepIncludeComposeSvcDeps)
		depIncludeTargetComposeSvcDeps := ctx.Bool(commands.FlagDepIncludeTargetComposeSvcDeps)
		depIncludeComposeSvcs := ctx.StringSlice(commands.FlagDepIncludeComposeSvc)
		depExcludeComposeSvcs := ctx.StringSlice(commands.FlagDepExcludeComposeSvc)
		composeNets := ctx.StringSlice(commands.FlagComposeNet)

		composeSvcStartWait := ctx.Int(commands.FlagComposeSvcStartWait)

		composeEnvNoHost := ctx.Bool(commands.FlagComposeEnvNoHost)
		composeEnvVars, err := commands.ParseLinesWithCommentsFile(ctx.String(commands.FlagComposeEnvFile))
		if err != nil {
			xc.Out.Error("param.error.compose.env.file", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		composeProjectName := ctx.String(commands.FlagComposeProjectName)
		composeWorkdir := ctx.String(commands.FlagComposeWorkdir)
		containerProbeComposeSvc := ctx.String(commands.FlagContainerProbeComposeSvc)

		kubeOpts, err := GetKubernetesOptions(ctx)
		if err != nil {
			xc.Out.Error("param.error.kubernetes.options", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		var targetRef string

		if kubeOpts.HasTargetSet() {
			targetRef = kubeOpts.Target.Workload
		} else if len(composeFiles) > 0 && targetComposeSvc != "" {
			targetRef = targetComposeSvc
		} else if cbOpts.Dockerfile == "" {
			targetRef = ctx.String(commands.FlagTarget)

			if targetRef == "" {
				if ctx.Args().Len() < 1 {
					xc.Out.Error("param.target", "missing image ID/name")
					cli.ShowCommandHelp(ctx, Name)
					return nil
				} else {
					targetRef = ctx.Args().First()
				}
			}
		} else {
			targetRef = cbOpts.DockerfileContext
			if targetRef == "" {
				if ctx.Args().Len() < 1 {
					xc.Out.Error("param.target", "missing Dockerfile build context directory")
					cli.ShowCommandHelp(ctx, Name)
					return nil
				} else {
					targetRef = ctx.Args().First()
				}
			}
		}

		if targetRef == "" {
			xc.Out.Error("param.target", "missing target - make sure to set one of the target params")
			cli.ShowCommandHelp(ctx, Name)
			return nil
		}

		gparams, ok := commands.CLIContextGet(ctx.Context, commands.GlobalParams).(*commands.GenericParams)
		if !ok || gparams == nil {
			xc.Out.Error("param.global", "missing params")
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		appOpts, ok := commands.CLIContextGet(ctx.Context, commands.AppParams).(*config.AppOptions)
		if !kubeOpts.HasTargetSet() && (!ok || appOpts == nil) {
			log.Debug("param.error.app.options - no app params")
		}

		crOpts, err := commands.GetContainerRunOptions(ctx)
		if err != nil {
			xc.Out.Error("param.error.container.run.options", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		doPull := ctx.Bool(commands.FlagPull)
		dockerConfigPath := ctx.String(commands.FlagDockerConfigPath)
		registryAccount := ctx.String(commands.FlagRegistryAccount)
		registrySecret := ctx.String(commands.FlagRegistrySecret)
		doShowPullLogs := ctx.Bool(commands.FlagShowPullLogs)

		doRmFileArtifacts := ctx.Bool(commands.FlagRemoveFileArtifacts)
		doCopyMetaArtifacts := ctx.String(commands.FlagCopyMetaArtifacts)

		portBindings, err := commands.ParsePortBindings(ctx.StringSlice(commands.FlagPublishPort))
		if err != nil {
			xc.Out.Error("param.publish.port", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		doPublishExposedPorts := ctx.Bool(commands.FlagPublishExposedPorts)

		httpProbeOpts := commands.GetHTTPProbeOptions(xc, ctx)

		continueAfter, err := commands.GetContinueAfter(ctx)
		if err != nil {
			xc.Out.Error("param.error.continue.after", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		if continueAfter.Mode == config.CAMProbe && !httpProbeOpts.Do {
			continueAfter.Mode = ""
			xc.Out.Info("exec",
				ovars{
					"message": "changing continue-after from probe to nothing because http-probe is disabled",
				})
		}

		execCmd := ctx.String(commands.FlagExec)
		execFile := ctx.String(commands.FlagExecFile)
		if strings.Contains(continueAfter.Mode, config.CAMExec) &&
			len(execCmd) == 0 &&
			len(execFile) == 0 {
			continueAfter.Mode = config.CAMEnter
			xc.Out.Info("exec",
				ovars{
					"message": "changing continue-after from exec to enter because there are no exec flags",
				})
		}

		if len(execCmd) != 0 && len(execFile) != 0 {
			xc.Out.Error("param.error.exec", "fatal: cannot use both --exec and --exec-file")
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}
		var execFileCmd []byte
		if len(execFile) > 0 {
			execFileCmd, err = os.ReadFile(execFile)
			errutil.FailOn(err)

			if !strings.Contains(continueAfter.Mode, config.CAMExec) {
				if continueAfter.Mode == "" {
					continueAfter.Mode = config.CAMExec
				} else {
					continueAfter.Mode = fmt.Sprintf("%s&%s", continueAfter.Mode, config.CAMExec)
				}

				xc.Out.Info("exec",
					ovars{
						"message": fmt.Sprintf("updating continue-after mode to %s", continueAfter.Mode),
					})
			}

		} else if len(execCmd) > 0 {
			if !strings.Contains(continueAfter.Mode, config.CAMExec) {
				if continueAfter.Mode == "" {
					continueAfter.Mode = config.CAMExec
				} else {
					continueAfter.Mode = fmt.Sprintf("%s&%s", continueAfter.Mode, config.CAMExec)
				}

				xc.Out.Info("exec",
					ovars{
						"message": fmt.Sprintf("updating continue-after mode to %s", continueAfter.Mode),
					})
			}
		}

		if containerProbeComposeSvc != "" {
			if !strings.Contains(continueAfter.Mode, config.CAMContainerProbe) {
				if continueAfter.Mode == "" {
					continueAfter.Mode = config.CAMContainerProbe
				} else {
					continueAfter.Mode = fmt.Sprintf("%s&%s", continueAfter.Mode, config.CAMContainerProbe)
				}

				xc.Out.Info("continue.after",
					ovars{
						"message": fmt.Sprintf("updating mode to %s", continueAfter.Mode),
					})
			}
		}

		if continueAfter.Mode == "" {
			continueAfter.Mode = config.CAMEnter
			xc.Out.Info("exec",
				ovars{
					"message": "changing continue-after to enter",
				})
		}

		hostExecProbes := ctx.StringSlice(commands.FlagHostExec)
		moreHostExecProbes, err := commands.ParseHTTPProbeExecFile(ctx.String(commands.FlagHostExecFile))
		if err != nil {
			xc.Out.Error("param.host.exec.file", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		if len(moreHostExecProbes) > 0 {
			hostExecProbes = append(hostExecProbes, moreHostExecProbes...)
		}

		if strings.Contains(continueAfter.Mode, config.CAMHostExec) &&
			len(hostExecProbes) == 0 {
			if continueAfter.Mode == config.CAMHostExec {
				continueAfter.Mode = config.CAMEnter
				xc.Out.Info("host-exec",
					ovars{
						"message": "changing continue-after from host-exec to enter because there are no host-exec commands",
					})
			} else {
				continueAfter.Mode = commands.RemoveContinueAfterMode(continueAfter.Mode, config.CAMHostExec)
				xc.Out.Info("host-exec",
					ovars{
						"message": "removing host-exec continue-after mode because there are no host-exec commands",
					})
			}
		}

		if len(hostExecProbes) > 0 {
			if !strings.Contains(continueAfter.Mode, config.CAMHostExec) {
				if continueAfter.Mode == "" {
					continueAfter.Mode = config.CAMHostExec
				} else {
					continueAfter.Mode = fmt.Sprintf("%s&%s", continueAfter.Mode, config.CAMHostExec)
				}

				xc.Out.Info("exec",
					ovars{
						"message": fmt.Sprintf("updating continue-after mode to %s", continueAfter.Mode),
					})
			}
		}

		doKeepPerms := ctx.Bool(FlagKeepPerms)

		doRunTargetAsUser := ctx.Bool(commands.FlagRunTargetAsUser)

		doShowContainerLogs := ctx.Bool(commands.FlagShowContainerLogs)
		doEnableMondel := ctx.Bool(commands.FlagEnableMondelLogs)
		doShowBuildLogs := ctx.Bool(FlagShowBuildLogs)
		outputTags := ctx.StringSlice(FlagTag)

		doImageOverrides := ctx.String(FlagImageOverrides)
		overrides, err := commands.GetContainerOverrides(xc, ctx)
		if err != nil {
			xc.Out.Error("param.error.image.overrides", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		instructions, err := GetImageInstructions(ctx)
		if err != nil {
			xc.Out.Error("param.error.image.instructions", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		volumeMounts, err := commands.ParseVolumeMounts(ctx.StringSlice(commands.FlagMount))
		if err != nil {
			xc.Out.Error("param.error.mount", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		excludePatterns := commands.ParsePaths(ctx.StringSlice(commands.FlagExcludePattern))

		preservePaths := commands.ParsePaths(ctx.StringSlice(FlagPreservePath))
		morePreservePaths, err := commands.ParsePathsFile(ctx.String(FlagPreservePathFile))
		if err != nil {
			xc.Out.Error("param.error.preserve.path.file", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		} else {
			for k, v := range morePreservePaths {
				preservePaths[k] = v
			}
		}

		if len(preservePaths) > 0 {
			for filtered := range artifact.FilteredPaths {
				if _, found := preservePaths[filtered]; found {
					delete(preservePaths, filtered)
					xc.Out.Info("params",
						ovars{
							"preserve.path": filtered,
							"message":       "ignoring",
						})
				}
			}

			var toDelete []string
			for ip := range preservePaths {
				if artifact.IsFilteredPath(ip) {
					toDelete = append(toDelete, ip)
				}
			}

			for _, dp := range toDelete {
				delete(preservePaths, dp)
				xc.Out.Info("params",
					ovars{
						"preserve.path": dp,
						"message":       "ignoring",
					})
			}
		}

		includePaths := commands.ParsePaths(ctx.StringSlice(FlagIncludePath))
		moreIncludePaths, err := commands.ParsePathsFile(ctx.String(FlagIncludePathFile))
		if err != nil {
			xc.Out.Error("param.error.include.path.file", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		} else {
			for k, v := range moreIncludePaths {
				includePaths[k] = v
			}
		}

		if len(includePaths) > 0 {
			for filtered := range artifact.FilteredPaths {
				if _, found := includePaths[filtered]; found {
					delete(includePaths, filtered)
					xc.Out.Info("params",
						ovars{
							"include.path": filtered,
							"message":      "ignoring",
						})
				}
			}

			var toDelete []string
			for ip := range includePaths {
				if artifact.IsFilteredPath(ip) {
					toDelete = append(toDelete, ip)
				}
			}

			for _, dp := range toDelete {
				delete(includePaths, dp)
				xc.Out.Info("params",
					ovars{
						"include.path": dp,
						"message":      "ignoring",
					})
			}
		}

		creportIncludePaths, err := commands.ParsePathsCreportFile(ctx.String(FlagIncludePathsCreportFile))
		if err != nil {
			xc.Out.Error("param.error.include.paths.creport.file", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		} else {
			for k, v := range creportIncludePaths {
				includePaths[k] = v
			}
		}

		pathPerms := commands.ParsePaths(ctx.StringSlice(FlagPathPerms))
		morePathPerms, err := commands.ParsePathsFile(ctx.String(FlagPathPermsFile))
		if err != nil {
			xc.Out.Error("param.error.path.perms.file", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		} else {
			for k, v := range morePathPerms {
				pathPerms[k] = v
			}
		}

		includeBins := commands.ParsePaths(ctx.StringSlice(FlagIncludeBin))
		moreIncludeBins, err := commands.ParsePathsFile(ctx.String(FlagIncludeBinFile))
		if err != nil {
			xc.Out.Error("param.error.include.bin.file", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		} else {
			for k, v := range moreIncludeBins {
				includeBins[k] = v
			}
		}

		if len(includeBins) > 0 {

			for filtered := range artifact.FilteredPaths {
				if _, found := includeBins[filtered]; found {
					delete(includeBins, filtered)
					xc.Out.Info("params",
						ovars{
							"include.bin": filtered,
							"message":     "ignoring",
						})
				}
			}

			var toDelete []string
			for ip := range includeBins {
				if artifact.IsFilteredPath(ip) {
					toDelete = append(toDelete, ip)
				}
			}

			for _, dp := range toDelete {
				delete(includeBins, dp)
				xc.Out.Info("params",
					ovars{
						"include.bin": dp,
						"message":     "ignoring",
					})
			}
		}

		includeExes := commands.ParsePaths(ctx.StringSlice(FlagIncludeExe))
		moreIncludeExes, err := commands.ParsePathsFile(ctx.String(FlagIncludeExeFile))
		if err != nil {
			xc.Out.Error("param.error.include.exe.file", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		} else {
			for k, v := range moreIncludeExes {
				includeExes[k] = v
			}
		}

		doIncludeShell := ctx.Bool(FlagIncludeShell)

		doIncludeWorkdir := ctx.Bool(FlagIncludeWorkdir)
		includeLastImageLayers := uint(0)
		doIncludeAppImageAll := ctx.Bool(FlagIncludeAppImageAll)
		appImageStartInstGroup := ctx.Int(FlagAppImageStartInstGroup)
		appImageStartInst := ctx.String(FlagAppImageStartInst)

		appImageDockerfilePath := ctx.String(FlagAppImageDockerfile)
		appImageDockerfileInsts, err := commands.ParseLinesWithCommentsFile(appImageDockerfilePath)
		if err != nil {
			xc.Out.Error("param.error.app.image.dockerfile", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		doIncludeOSLibsNet := ctx.Bool(FlagIncludeOSLibsNet)

		doIncludeZoneInfo := ctx.Bool(FlagIncludeZoneInfo)

		doIncludeCertAll := ctx.Bool(FlagIncludeCertAll)
		doIncludeCertBundles := ctx.Bool(FlagIncludeCertBundles)
		doIncludeCertDirs := ctx.Bool(FlagIncludeCertDirs)
		doIncludeCertPKAll := ctx.Bool(FlagIncludeCertPKAll)
		doIncludeCertPKDirs := ctx.Bool(FlagIncludeCertPKDirs)

		doIncludeNew := ctx.Bool(FlagIncludeNew)

		doUseLocalMounts := ctx.Bool(commands.FlagUseLocalMounts)
		doUseSensorVolume := ctx.String(commands.FlagUseSensorVolume)

		doKeepTmpArtifacts := ctx.Bool(FlagKeepTmpArtifacts)

		doExcludeMounts := ctx.Bool(commands.FlagExcludeMounts)
		if doExcludeMounts {
			for mpath := range volumeMounts {
				excludePatterns[mpath] = nil
				mpattern := fmt.Sprintf("%s/**", mpath)
				excludePatterns[mpattern] = nil
			}
		}

		commandReport := ctx.String(commands.FlagCommandReport)
		if commandReport == "off" {
			commandReport = ""
		}

		rtaOnbuildBaseImage := ctx.Bool(commands.FlagRTAOnbuildBaseImage)
		rtaSourcePT := ctx.Bool(commands.FlagRTASourcePT)

		doObfuscateMetadata := ctx.Bool(FlagObfuscateMetadata)

		imageBuildEngine, err := getImageBuildEngine(ctx)
		if err != nil {
			xc.Out.Error("param.error.image-build-engine", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		imageBuildArch, err := getImageBuildArch(ctx)
		if err != nil {
			xc.Out.Error("param.error.image-build-arch", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

		OnCommand(
			xc,
			gparams,
			targetRef,
			doPull,
			dockerConfigPath,
			registryAccount,
			registrySecret,
			doShowPullLogs,
			composeFiles,
			targetComposeSvc,
			targetComposeSvcImage,
			composeSvcStartWait,
			composeSvcNoPorts,
			depExcludeComposeSvcAll,
			depIncludeComposeSvcDeps,
			depIncludeTargetComposeSvcDeps,
			depIncludeComposeSvcs,
			depExcludeComposeSvcs,
			composeNets,
			composeEnvVars,
			composeEnvNoHost,
			composeWorkdir,
			composeProjectName,
			containerProbeComposeSvc,
			cbOpts,
			crOpts,
			outputTags,
			httpProbeOpts,
			portBindings,
			doPublishExposedPorts,
			hostExecProbes,
			doRmFileArtifacts,
			doCopyMetaArtifacts,
			doRunTargetAsUser,
			doShowContainerLogs,
			doEnableMondel,
			doShowBuildLogs,
			commands.ParseImageOverrides(doImageOverrides),
			overrides,
			instructions,
			ctx.StringSlice(commands.FlagLink),
			ctx.StringSlice(commands.FlagEtcHostsMap),
			ctx.StringSlice(commands.FlagContainerDNS),
			ctx.StringSlice(commands.FlagContainerDNSSearch),
			volumeMounts,
			doKeepPerms,
			pathPerms,
			excludePatterns,
			preservePaths,
			includePaths,
			includeBins,
			includeExes,
			doIncludeShell,
			doIncludeWorkdir,
			includeLastImageLayers,
			doIncludeAppImageAll,
			appImageStartInstGroup,
			appImageStartInst,
			appImageDockerfileInsts,
			doIncludeOSLibsNet,
			doIncludeZoneInfo,
			doIncludeCertAll,
			doIncludeCertBundles,
			doIncludeCertDirs,
			doIncludeCertPKAll,
			doIncludeCertPKDirs,
			doIncludeNew,
			doUseLocalMounts,
			doUseSensorVolume,
			doKeepTmpArtifacts,
			continueAfter,
			execCmd,
			string(execFileCmd),
			deleteFatImage,
			rtaOnbuildBaseImage,
			rtaSourcePT,
			doObfuscateMetadata,
			ctx.String(commands.FlagSensorIPCEndpoint),
			ctx.String(commands.FlagSensorIPCMode),
			kubeOpts,
			GetAppNodejsInspectOptions(ctx),
			imageBuildEngine,
			imageBuildArch)

		return nil
	},
}
View Source
var CommandFlagSuggestions = &commands.FlagSuggestions{
	Names: []prompt.Suggest{
		{Text: commands.FullFlagName(commands.FlagCommandParamsFile), Description: commands.FlagCommandParamsFileUsage},
		{Text: commands.FullFlagName(commands.FlagTarget), Description: commands.FlagTargetUsage},
		{Text: commands.FullFlagName(commands.FlagComposeFile), Description: commands.FlagComposeFileUsage},
		{Text: commands.FullFlagName(commands.FlagTargetComposeSvc), Description: commands.FlagTargetComposeSvcUsage},
		{Text: commands.FullFlagName(commands.FlagTargetComposeSvcImage), Description: commands.FlagTargetComposeSvcImageUsage},
		{Text: commands.FullFlagName(commands.FlagComposeSvcStartWait), Description: commands.FlagComposeSvcStartWaitUsage},
		{Text: commands.FullFlagName(commands.FlagDepIncludeComposeSvc), Description: commands.FlagDepIncludeComposeSvcUsage},
		{Text: commands.FullFlagName(commands.FlagDepExcludeComposeSvc), Description: commands.FlagDepExcludeComposeSvcUsage},
		{Text: commands.FullFlagName(commands.FlagDepIncludeComposeSvcDeps), Description: commands.FlagDepIncludeComposeSvcDepsUsage},
		{Text: commands.FullFlagName(commands.FlagComposeNet), Description: commands.FlagComposeNetUsage},
		{Text: commands.FullFlagName(commands.FlagDepIncludeTargetComposeSvcDeps), Description: commands.FlagDepIncludeTargetComposeSvcDepsUsage},
		{Text: commands.FullFlagName(commands.FlagComposeEnvNoHost), Description: commands.FlagComposeEnvNoHostUsage},
		{Text: commands.FullFlagName(commands.FlagComposeEnvFile), Description: commands.FlagComposeEnvFileUsage},
		{Text: commands.FullFlagName(commands.FlagComposeProjectName), Description: commands.FlagComposeProjectNameUsage},
		{Text: commands.FullFlagName(commands.FlagComposeWorkdir), Description: commands.FlagComposeWorkdirUsage},
		{Text: commands.FullFlagName(commands.FlagContainerProbeComposeSvc), Description: commands.FlagContainerProbeComposeSvcUsage},
		{Text: commands.FullFlagName(commands.FlagTargetKubeWorkload), Description: commands.FlagTargetKubeWorkloadUsage},
		{Text: commands.FullFlagName(commands.FlagTargetKubeWorkloadNamespace), Description: commands.FlagTargetKubeWorkloadNamespaceUsage},
		{Text: commands.FullFlagName(commands.FlagTargetKubeWorkloadContainer), Description: commands.FlagTargetKubeWorkloadContainerUsage},
		{Text: commands.FullFlagName(commands.FlagTargetKubeWorkloadImage), Description: commands.FlagTargetKubeWorkloadImageUsage},
		{Text: commands.FullFlagName(commands.FlagKubeManifestFile), Description: commands.FlagKubeManifestFileUsage},
		{Text: commands.FullFlagName(commands.FlagKubeKubeconfigFile), Description: commands.FlagKubeKubeconfigFileUsage},
		{Text: commands.FullFlagName(commands.FlagPull), Description: commands.FlagPullUsage},
		{Text: commands.FullFlagName(commands.FlagShowPullLogs), Description: commands.FlagShowPullLogsUsage},
		{Text: commands.FullFlagName(commands.FlagRegistryAccount), Description: commands.FlagRegistryAccountUsage},
		{Text: commands.FullFlagName(commands.FlagRegistrySecret), Description: commands.FlagRegistrySecretUsage},
		{Text: commands.FullFlagName(commands.FlagDockerConfigPath), Description: commands.FlagDockerConfigPathUsage},
		{Text: commands.FullFlagName(FlagShowBuildLogs), Description: FlagShowBuildLogsUsage},
		{Text: commands.FullFlagName(commands.FlagShowContainerLogs), Description: commands.FlagShowContainerLogsUsage},
		{Text: commands.FullFlagName(commands.FlagEnableMondelLogs), Description: commands.FlagEnableMondelLogsUsage},
		{Text: commands.FullFlagName(commands.FlagCRORuntime), Description: commands.FlagCRORuntimeUsage},
		{Text: commands.FullFlagName(commands.FlagCROHostConfigFile), Description: commands.FlagCROHostConfigFileUsage},
		{Text: commands.FullFlagName(commands.FlagCROSysctl), Description: commands.FlagCROSysctlUsage},
		{Text: commands.FullFlagName(commands.FlagCROShmSize), Description: commands.FlagCROShmSizeUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeOff), Description: commands.FlagHTTPProbeOffUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbe), Description: commands.FlagHTTPProbeUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeCmd), Description: commands.FlagHTTPProbeCmdUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeCmdFile), Description: commands.FlagHTTPProbeCmdFileUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeStartWait), Description: commands.FlagHTTPProbeStartWaitUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeRetryCount), Description: commands.FlagHTTPProbeRetryCountUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeRetryWait), Description: commands.FlagHTTPProbeRetryWaitUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbePorts), Description: commands.FlagHTTPProbePortsUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeFull), Description: commands.FlagHTTPProbeFullUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeExitOnFailure), Description: commands.FlagHTTPProbeExitOnFailureUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeCrawl), Description: commands.FlagHTTPProbeCrawlUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPCrawlMaxDepth), Description: commands.FlagHTTPCrawlMaxDepthUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPCrawlMaxPageCount), Description: commands.FlagHTTPCrawlMaxPageCountUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPCrawlConcurrency), Description: commands.FlagHTTPCrawlConcurrencyUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPMaxConcurrentCrawlers), Description: commands.FlagHTTPMaxConcurrentCrawlersUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeAPISpec), Description: commands.FlagHTTPProbeAPISpecUsage},
		{Text: commands.FullFlagName(commands.FlagHTTPProbeAPISpecFile), Description: commands.FlagHTTPProbeAPISpecFileUsage},
		{Text: commands.FullFlagName(commands.FlagPublishPort), Description: commands.FlagPublishPortUsage},
		{Text: commands.FullFlagName(commands.FlagPublishExposedPorts), Description: commands.FlagPublishExposedPortsUsage},
		{Text: commands.FullFlagName(commands.FlagHostExec), Description: commands.FlagHostExecUsage},
		{Text: commands.FullFlagName(commands.FlagHostExecFile), Description: commands.FlagHostExecFileUsage},
		{Text: commands.FullFlagName(FlagKeepPerms), Description: FlagKeepPermsUsage},
		{Text: commands.FullFlagName(commands.FlagRunTargetAsUser), Description: commands.FlagRunTargetAsUserUsage},
		{Text: commands.FullFlagName(commands.FlagCopyMetaArtifacts), Description: commands.FlagCopyMetaArtifactsUsage},
		{Text: commands.FullFlagName(commands.FlagRemoveFileArtifacts), Description: commands.FlagRemoveFileArtifactsUsage},
		{Text: commands.FullFlagName(FlagTag), Description: FlagTagUsage},
		{Text: commands.FullFlagName(FlagImageOverrides), Description: FlagImageOverridesUsage},
		{Text: commands.FullFlagName(commands.FlagUser), Description: commands.FlagUserUsage},
		{Text: commands.FullFlagName(commands.FlagEntrypoint), Description: commands.FlagEntrypointUsage},
		{Text: commands.FullFlagName(commands.FlagCmd), Description: commands.FlagCmdUsage},
		{Text: commands.FullFlagName(commands.FlagWorkdir), Description: commands.FlagWorkdirUsage},
		{Text: commands.FullFlagName(commands.FlagEnv), Description: commands.FlagEnvUsage},
		{Text: commands.FullFlagName(commands.FlagEnvFile), Description: commands.FlagEnvFileUsage},
		{Text: commands.FullFlagName(commands.FlagLabel), Description: commands.FlagLabelUsage},
		{Text: commands.FullFlagName(commands.FlagVolume), Description: commands.FlagVolumeUsage},
		{Text: commands.FullFlagName(commands.FlagLink), Description: commands.FlagLinkUsage},
		{Text: commands.FullFlagName(commands.FlagEtcHostsMap), Description: commands.FlagEtcHostsMapUsage},
		{Text: commands.FullFlagName(commands.FlagContainerDNS), Description: commands.FlagContainerDNSUsage},
		{Text: commands.FullFlagName(commands.FlagContainerDNSSearch), Description: commands.FlagContainerDNSSearchUsage},
		{Text: commands.FullFlagName(commands.FlagNetwork), Description: commands.FlagNetworkUsage},
		{Text: commands.FullFlagName(commands.FlagHostname), Description: commands.FlagHostnameUsage},
		{Text: commands.FullFlagName(commands.FlagExpose), Description: commands.FlagExposeUsage},
		{Text: commands.FullFlagName(FlagNewEntrypoint), Description: FlagNewEntrypointUsage},
		{Text: commands.FullFlagName(FlagNewCmd), Description: FlagNewCmdUsage},
		{Text: commands.FullFlagName(FlagNewExpose), Description: FlagNewExposeUsage},
		{Text: commands.FullFlagName(FlagNewWorkdir), Description: FlagNewWorkdirUsage},
		{Text: commands.FullFlagName(FlagNewEnv), Description: FlagNewEnvUsage},
		{Text: commands.FullFlagName(FlagNewVolume), Description: FlagNewVolumeUsage},
		{Text: commands.FullFlagName(FlagNewLabel), Description: FlagNewLabelUsage},
		{Text: commands.FullFlagName(FlagRemoveExpose), Description: FlagRemoveExposeUsage},
		{Text: commands.FullFlagName(FlagRemoveEnv), Description: FlagRemoveEnvUsage},
		{Text: commands.FullFlagName(FlagRemoveLabel), Description: FlagRemoveLabelUsage},
		{Text: commands.FullFlagName(FlagRemoveVolume), Description: FlagRemoveVolumeUsage},
		{Text: commands.FullFlagName(commands.FlagExcludeMounts), Description: commands.FlagExcludeMountsUsage},
		{Text: commands.FullFlagName(commands.FlagExcludePattern), Description: commands.FlagExcludePatternUsage},
		{Text: commands.FullFlagName(FlagPathPerms), Description: FlagPathPermsUsage},
		{Text: commands.FullFlagName(FlagPathPermsFile), Description: FlagPathPermsFileUsage},
		{Text: commands.FullFlagName(FlagPreservePath), Description: FlagPreservePathUsage},
		{Text: commands.FullFlagName(FlagPreservePathFile), Description: FlagPreservePathFileUsage},
		{Text: commands.FullFlagName(FlagIncludePath), Description: FlagIncludePathUsage},
		{Text: commands.FullFlagName(FlagIncludePathFile), Description: FlagIncludePathFileUsage},
		{Text: commands.FullFlagName(FlagIncludeBin), Description: FlagIncludeBinUsage},
		{Text: commands.FullFlagName(FlagIncludeBinFile), Description: FlagIncludeBinFileUsage},
		{Text: commands.FullFlagName(FlagIncludeExe), Description: FlagIncludeExeUsage},
		{Text: commands.FullFlagName(FlagIncludeExeFile), Description: FlagIncludeExeFileUsage},
		{Text: commands.FullFlagName(FlagIncludeShell), Description: FlagIncludeShellUsage},
		{Text: commands.FullFlagName(FlagIncludeWorkdir), Description: FlagIncludeWorkdirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppImageAll), Description: FlagIncludeAppImageAllUsage},
		{Text: commands.FullFlagName(FlagAppImageStartInstGroup), Description: FlagAppImageStartInstGroupUsage},
		{Text: commands.FullFlagName(FlagAppImageStartInst), Description: FlagAppImageStartInstUsage},
		{Text: commands.FullFlagName(FlagAppImageDockerfile), Description: FlagAppImageDockerfileUsage},
		{Text: commands.FullFlagName(FlagIncludePathsCreportFile), Description: FlagIncludePathsCreportFileUsage},
		{Text: commands.FullFlagName(FlagIncludeOSLibsNet), Description: FlagIncludeOSLibsNetUsage},
		{Text: commands.FullFlagName(FlagIncludeCertAll), Description: FlagIncludeCertAllUsage},
		{Text: commands.FullFlagName(FlagIncludeCertBundles), Description: FlagIncludeCertBundlesUsage},
		{Text: commands.FullFlagName(FlagIncludeCertDirs), Description: FlagIncludeCertDirsUsage},
		{Text: commands.FullFlagName(FlagIncludeCertPKAll), Description: FlagIncludeCertPKAllUsage},
		{Text: commands.FullFlagName(FlagIncludeCertPKDirs), Description: FlagIncludeCertPKDirsUsage},
		{Text: commands.FullFlagName(FlagIncludeNew), Description: FlagIncludeNewUsage},
		{Text: commands.FullFlagName(commands.FlagMount), Description: commands.FlagMountUsage},
		{Text: commands.FullFlagName(commands.FlagContinueAfter), Description: commands.FlagContinueAfterUsage},
		{Text: commands.FullFlagName(commands.FlagUseLocalMounts), Description: commands.FlagUseLocalMountsUsage},
		{Text: commands.FullFlagName(commands.FlagUseSensorVolume), Description: commands.FlagUseSensorVolumeUsage},
		{Text: commands.FullFlagName(FlagKeepTmpArtifacts), Description: FlagKeepTmpArtifactsUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNuxtDir), Description: FlagIncludeAppNuxtDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNuxtBuildDir), Description: FlagIncludeAppNuxtBuildDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNuxtDistDir), Description: FlagIncludeAppNuxtDistDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNuxtStaticDir), Description: FlagIncludeAppNuxtStaticDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNuxtNodeModulesDir), Description: FlagIncludeAppNuxtNodeModulesDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNextDir), Description: FlagIncludeAppNextDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNextBuildDir), Description: FlagIncludeAppNextBuildDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNextDistDir), Description: FlagIncludeAppNextDistDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNextStaticDir), Description: FlagIncludeAppNextStaticDirUsage},
		{Text: commands.FullFlagName(FlagIncludeAppNextNodeModulesDir), Description: FlagIncludeAppNextNodeModulesDirUsage},
		{Text: commands.FullFlagName(FlagIncludeNodePackage), Description: FlagIncludeNodePackageUsage},
		{Text: commands.FullFlagName(FlagBuildFromDockerfile), Description: FlagBuildFromDockerfileUsage},
		{Text: commands.FullFlagName(FlagDockerfileContext), Description: FlagDockerfileContextUsage},
		{Text: commands.FullFlagName(FlagTagFat), Description: FlagTagFatUsage},
		{Text: commands.FullFlagName(FlagCBOAddHost), Description: FlagCBOAddHostUsage},
		{Text: commands.FullFlagName(FlagCBOBuildArg), Description: FlagCBOBuildArgUsage},
		{Text: commands.FullFlagName(FlagCBOLabel), Description: FlagCBOLabelUsage},
		{Text: commands.FullFlagName(FlagCBOTarget), Description: FlagCBOTargetUsage},
		{Text: commands.FullFlagName(FlagCBONetwork), Description: FlagCBONetworkUsage},
		{Text: commands.FullFlagName(FlagCBOCacheFrom), Description: FlagCBOCacheFromUsage},
		{Text: commands.FullFlagName(commands.FlagDeleteFatImage), Description: commands.FlagDeleteFatImageUsage},
		{Text: commands.FullFlagName(commands.FlagRTAOnbuildBaseImage), Description: commands.FlagRTAOnbuildBaseImageUsage},
		{Text: commands.FullFlagName(commands.FlagRTASourcePT), Description: commands.FlagRTASourcePTUsage},
		{Text: commands.FullFlagName(commands.FlagSensorIPCMode), Description: commands.FlagSensorIPCModeUsage},
		{Text: commands.FullFlagName(commands.FlagSensorIPCEndpoint), Description: commands.FlagSensorIPCEndpointUsage},
		{Text: commands.FullFlagName(FlagImageBuildEngine), Description: FlagImageBuildEngineUsage},
		{Text: commands.FullFlagName(FlagImageBuildArch), Description: FlagImageBuildArchUsage},
		{Text: commands.FullFlagName(FlagObfuscateMetadata), Description: FlagObfuscateMetadataUsage},
	},
	Values: map[string]commands.CompleteValue{
		commands.FullFlagName(commands.FlagCommandParamsFile): commands.CompleteFile,

		commands.FullFlagName(commands.FlagPull):                           commands.CompleteBool,
		commands.FullFlagName(commands.FlagShowPullLogs):                   commands.CompleteBool,
		commands.FullFlagName(commands.FlagDockerConfigPath):               commands.CompleteFile,
		commands.FullFlagName(commands.FlagTarget):                         commands.CompleteTarget,
		commands.FullFlagName(commands.FlagComposeFile):                    commands.CompleteFile,
		commands.FullFlagName(commands.FlagDepIncludeTargetComposeSvcDeps): commands.CompleteBool,
		commands.FullFlagName(commands.FlagComposeEnvNoHost):               commands.CompleteBool,
		commands.FullFlagName(commands.FlagComposeEnvFile):                 commands.CompleteFile,
		commands.FullFlagName(commands.FlagComposeWorkdir):                 commands.CompleteFile,
		commands.FullFlagName(commands.FlagKubeManifestFile):               commands.CompleteFile,
		commands.FullFlagName(commands.FlagKubeKubeconfigFile):             commands.CompleteFile,
		commands.FullFlagName(FlagShowBuildLogs):                           commands.CompleteBool,
		commands.FullFlagName(commands.FlagShowContainerLogs):              commands.CompleteBool,
		commands.FullFlagName(commands.FlagEnableMondelLogs):               commands.CompleteBool,
		commands.FullFlagName(commands.FlagPublishExposedPorts):            commands.CompleteBool,
		commands.FullFlagName(commands.FlagHTTPProbeOff):                   commands.CompleteBool,
		commands.FullFlagName(commands.FlagHTTPProbe):                      commands.CompleteTBool,
		commands.FullFlagName(commands.FlagHTTPProbeCmdFile):               commands.CompleteFile,
		commands.FullFlagName(commands.FlagHTTPProbeFull):                  commands.CompleteBool,
		commands.FullFlagName(commands.FlagHTTPProbeExitOnFailure):         commands.CompleteBool,
		commands.FullFlagName(commands.FlagHTTPProbeCrawl):                 commands.CompleteTBool,
		commands.FullFlagName(commands.FlagHTTPProbeAPISpecFile):           commands.CompleteFile,
		commands.FullFlagName(commands.FlagHostExecFile):                   commands.CompleteFile,
		commands.FullFlagName(FlagKeepPerms):                               commands.CompleteTBool,
		commands.FullFlagName(commands.FlagRunTargetAsUser):                commands.CompleteTBool,
		commands.FullFlagName(commands.FlagRemoveFileArtifacts):            commands.CompleteBool,
		commands.FullFlagName(commands.FlagNetwork):                        commands.CompleteNetwork,
		commands.FullFlagName(commands.FlagExcludeMounts):                  commands.CompleteTBool,
		commands.FullFlagName(FlagPathPermsFile):                           commands.CompleteFile,
		commands.FullFlagName(FlagPreservePathFile):                        commands.CompleteFile,
		commands.FullFlagName(FlagIncludePathFile):                         commands.CompleteFile,
		commands.FullFlagName(FlagIncludeBinFile):                          commands.CompleteFile,
		commands.FullFlagName(FlagIncludeExeFile):                          commands.CompleteFile,
		commands.FullFlagName(FlagIncludePathsCreportFile):                 commands.CompleteFile,
		commands.FullFlagName(FlagIncludeShell):                            commands.CompleteBool,
		commands.FullFlagName(FlagIncludeWorkdir):                          commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppImageAll):                      commands.CompleteBool,
		commands.FullFlagName(FlagIncludeOSLibsNet):                        commands.CompleteBool,
		commands.FullFlagName(FlagIncludeCertAll):                          commands.CompleteBool,
		commands.FullFlagName(FlagIncludeCertBundles):                      commands.CompleteBool,
		commands.FullFlagName(FlagIncludeCertDirs):                         commands.CompleteBool,
		commands.FullFlagName(FlagIncludeCertPKAll):                        commands.CompleteBool,
		commands.FullFlagName(FlagIncludeCertPKDirs):                       commands.CompleteBool,
		commands.FullFlagName(FlagIncludeNew):                              commands.CompleteBool,
		commands.FullFlagName(commands.FlagContinueAfter):                  commands.CompleteContinueAfter,

		commands.FullFlagName(commands.FlagUseLocalMounts):      commands.CompleteBool,
		commands.FullFlagName(commands.FlagUseSensorVolume):     commands.CompleteVolume,
		commands.FullFlagName(FlagKeepTmpArtifacts):             commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNuxtDir):            commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNuxtBuildDir):       commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNuxtDistDir):        commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNuxtStaticDir):      commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNuxtNodeModulesDir): commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNextDir):            commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNextBuildDir):       commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNextDistDir):        commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNextStaticDir):      commands.CompleteBool,
		commands.FullFlagName(FlagIncludeAppNextNodeModulesDir): commands.CompleteBool,
		commands.FullFlagName(commands.FlagCROHostConfigFile):   commands.CompleteFile,
		commands.FullFlagName(FlagDockerfileContext):            commands.CompleteFile,
		commands.FullFlagName(FlagDeleteFatImage):               commands.CompleteBool,
		commands.FullFlagName(commands.FlagRTAOnbuildBaseImage): commands.CompleteBool,
		commands.FullFlagName(commands.FlagRTASourcePT):         commands.CompleteBool,
		commands.FullFlagName(commands.FlagSensorIPCMode):       commands.CompleteIPCMode,
		commands.FullFlagName(FlagImageBuildEngine):             CompleteImageBuildEngine,
		commands.FullFlagName(FlagImageBuildArch):               CompleteImageBuildArch,
		commands.FullFlagName(FlagAppImageDockerfile):           commands.CompleteFile,
		commands.FullFlagName(FlagObfuscateMetadata):            commands.CompleteBool,
	},
}
View Source
var CommandSuggestion = prompt.Suggest{
	Text:        Name,
	Description: Usage,
}
View Source
var Flags = map[string]cli.Flag{
	FlagShowBuildLogs: &cli.BoolFlag{
		Name:    FlagShowBuildLogs,
		Usage:   FlagShowBuildLogsUsage,
		EnvVars: []string{"DSLIM_SHOW_BLOGS"},
	},
	FlagPathPerms: &cli.StringSliceFlag{
		Name:    FlagPathPerms,
		Value:   cli.NewStringSlice(),
		Usage:   FlagPathPermsUsage,
		EnvVars: []string{"DSLIM_PATH_PERMS"},
	},
	FlagPathPermsFile: &cli.StringFlag{
		Name:    FlagPathPermsFile,
		Value:   "",
		Usage:   FlagPathPermsFileUsage,
		EnvVars: []string{"DSLIM_PATH_PERMS_FILE"},
	},
	FlagPreservePath: &cli.StringSliceFlag{
		Name:    FlagPreservePath,
		Value:   cli.NewStringSlice(),
		Usage:   FlagPreservePathUsage,
		EnvVars: []string{"DSLIM_PRESERVE_PATH"},
	},
	FlagPreservePathFile: &cli.StringFlag{
		Name:    FlagPreservePathFile,
		Value:   "",
		Usage:   FlagPreservePathFileUsage,
		EnvVars: []string{"DSLIM_PRESERVE_PATH_FILE"},
	},
	FlagIncludePath: &cli.StringSliceFlag{
		Name:    FlagIncludePath,
		Value:   cli.NewStringSlice(),
		Usage:   FlagIncludePathUsage,
		EnvVars: []string{"DSLIM_INCLUDE_PATH"},
	},
	FlagIncludePathFile: &cli.StringFlag{
		Name:    FlagIncludePathFile,
		Value:   "",
		Usage:   FlagIncludePathFileUsage,
		EnvVars: []string{"DSLIM_INCLUDE_PATH_FILE"},
	},
	FlagIncludeBin: &cli.StringSliceFlag{
		Name:    FlagIncludeBin,
		Value:   cli.NewStringSlice(),
		Usage:   FlagIncludeBinUsage,
		EnvVars: []string{"DSLIM_INCLUDE_BIN"},
	},
	FlagIncludeExe: &cli.StringSliceFlag{
		Name:    FlagIncludeExe,
		Value:   cli.NewStringSlice(),
		Usage:   FlagIncludeExeUsage,
		EnvVars: []string{"DSLIM_INCLUDE_EXE"},
	},
	FlagIncludeShell: &cli.BoolFlag{
		Name:    FlagIncludeShell,
		Usage:   FlagIncludeShellUsage,
		EnvVars: []string{"DSLIM_INCLUDE_SHELL"},
	},

	FlagIncludeWorkdir: &cli.BoolFlag{
		Name:    FlagIncludeWorkdir,
		Usage:   FlagIncludeWorkdirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_WORKDIR"},
	},
	FlagIncludeAppImageAll: &cli.BoolFlag{
		Name:    FlagIncludeAppImageAll,
		Usage:   FlagIncludeAppImageAllUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_IMAGE_ALL"},
	},
	FlagAppImageStartInstGroup: &cli.IntFlag{
		Name:    FlagAppImageStartInstGroup,
		Value:   -1,
		Usage:   FlagAppImageStartInstGroupUsage,
		EnvVars: []string{"DSLIM_APP_IMAGE_START_INST_GROUP"},
	},
	FlagAppImageStartInst: &cli.StringFlag{
		Name:    FlagAppImageStartInst,
		Usage:   FlagAppImageStartInstUsage,
		EnvVars: []string{"DSLIM_APP_IMAGE_START_INST"},
	},
	FlagAppImageDockerfile: &cli.StringFlag{
		Name:    FlagAppImageDockerfile,
		Usage:   FlagAppImageDockerfileUsage,
		EnvVars: []string{"DSLIM_APP_IMAGE_DOCKERFILE"},
	},

	FlagIncludePathsCreportFile: &cli.StringFlag{
		Name:    FlagIncludePathsCreportFile,
		Value:   "",
		Usage:   FlagIncludePathsCreportFileUsage,
		EnvVars: []string{"DSLIM_INCLUDE_PATHS_CREPORT_FILE"},
	},

	FlagIncludeOSLibsNet: &cli.BoolFlag{
		Name:    FlagIncludeOSLibsNet,
		Value:   true,
		Usage:   FlagIncludeOSLibsNetUsage,
		EnvVars: []string{"DSLIM_INCLUDE_OSLIBS_NET"},
	},

	FlagIncludeZoneInfo: &cli.BoolFlag{
		Name:    FlagIncludeZoneInfo,
		Value:   false,
		Usage:   FlagIncludeZoneInfoUsage,
		EnvVars: []string{"DSLIM_INCLUDE_ZONEINFO"},
	},

	FlagIncludeCertAll: &cli.BoolFlag{
		Name:    FlagIncludeCertAll,
		Value:   true,
		Usage:   FlagIncludeCertAllUsage,
		EnvVars: []string{"DSLIM_INCLUDE_CERT_ALL"},
	},
	FlagIncludeCertBundles: &cli.BoolFlag{
		Name:    FlagIncludeCertBundles,
		Usage:   FlagIncludeCertBundlesUsage,
		EnvVars: []string{"DSLIM_INCLUDE_CERT_BUNDLES"},
	},
	FlagIncludeCertDirs: &cli.BoolFlag{
		Name:    FlagIncludeCertDirs,
		Usage:   FlagIncludeCertDirsUsage,
		EnvVars: []string{"DSLIM_INCLUDE_CERT_DIRS"},
	},
	FlagIncludeCertPKAll: &cli.BoolFlag{
		Name:    FlagIncludeCertPKAll,
		Usage:   FlagIncludeCertPKAllUsage,
		EnvVars: []string{"DSLIM_INCLUDE_CERT_PK_ALL"},
	},
	FlagIncludeCertPKDirs: &cli.BoolFlag{
		Name:    FlagIncludeCertPKDirs,
		Usage:   FlagIncludeCertPKDirsUsage,
		EnvVars: []string{"DSLIM_INCLUDE_CERT_PK_DIRS"},
	},
	FlagIncludeNew: &cli.BoolFlag{
		Name:    FlagIncludeNew,
		Value:   true,
		Usage:   FlagIncludeNewUsage,
		EnvVars: []string{"DSLIM_INCLUDE_NEW"},
	},

	FlagKeepTmpArtifacts: &cli.BoolFlag{
		Name:    FlagKeepTmpArtifacts,
		Usage:   FlagKeepTmpArtifactsUsage,
		EnvVars: []string{"DSLIM_KEEP_TMP_ARTIFACTS"},
	},
	FlagIncludeAppNuxtDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNuxtDir,
		Usage:   FlagIncludeAppNuxtDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NUXT_DIR"},
	},
	FlagIncludeAppNuxtBuildDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNuxtBuildDir,
		Usage:   FlagIncludeAppNuxtBuildDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NUXT_BUILD_DIR"},
	},
	FlagIncludeAppNuxtDistDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNuxtDistDir,
		Usage:   FlagIncludeAppNuxtDistDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NUXT_DIST_DIR"},
	},
	FlagIncludeAppNuxtStaticDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNuxtStaticDir,
		Usage:   FlagIncludeAppNuxtStaticDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NUXT_STATIC_DIR"},
	},
	FlagIncludeAppNuxtNodeModulesDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNuxtNodeModulesDir,
		Usage:   FlagIncludeAppNuxtNodeModulesDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NUXT_NM_DIR"},
	},
	FlagIncludeAppNextDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNextDir,
		Usage:   FlagIncludeAppNextDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NEXT_DIR"},
	},
	FlagIncludeAppNextBuildDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNextBuildDir,
		Usage:   FlagIncludeAppNextBuildDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NEXT_BUILD_DIR"},
	},
	FlagIncludeAppNextDistDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNextDistDir,
		Usage:   FlagIncludeAppNextDistDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NEXT_DIST_DIR"},
	},
	FlagIncludeAppNextStaticDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNextStaticDir,
		Usage:   FlagIncludeAppNextStaticDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NEXT_STATIC_DIR"},
	},
	FlagIncludeAppNextNodeModulesDir: &cli.BoolFlag{
		Name:    FlagIncludeAppNextNodeModulesDir,
		Usage:   FlagIncludeAppNextNodeModulesDirUsage,
		EnvVars: []string{"DSLIM_INCLUDE_APP_NEXT_NM_DIR"},
	},
	FlagIncludeNodePackage: &cli.StringSliceFlag{
		Name:    FlagIncludeNodePackage,
		Value:   cli.NewStringSlice(),
		Usage:   FlagIncludeNodePackageUsage,
		EnvVars: []string{"DSLIM_INCLUDE_NODE_PKG"},
	},
	FlagKeepPerms: &cli.BoolFlag{
		Name:    FlagKeepPerms,
		Value:   true,
		Usage:   FlagKeepPermsUsage,
		EnvVars: []string{"DSLIM_KEEP_PERMS"},
	},
	FlagNewEntrypoint: &cli.StringFlag{
		Name:    FlagNewEntrypoint,
		Value:   "",
		Usage:   FlagNewEntrypointUsage,
		EnvVars: []string{"DSLIM_NEW_ENTRYPOINT"},
	},
	FlagNewCmd: &cli.StringFlag{
		Name:    FlagNewCmd,
		Value:   "",
		Usage:   FlagNewCmdUsage,
		EnvVars: []string{"DSLIM_NEW_CMD"},
	},
	FlagNewExpose: &cli.StringSliceFlag{
		Name:    FlagNewExpose,
		Value:   cli.NewStringSlice(),
		Usage:   FlagNewExposeUsage,
		EnvVars: []string{"DSLIM_NEW_EXPOSE"},
	},
	FlagNewWorkdir: &cli.StringFlag{
		Name:    FlagNewWorkdir,
		Value:   "",
		Usage:   FlagNewWorkdirUsage,
		EnvVars: []string{"DSLIM_NEW_WORKDIR"},
	},
	FlagNewEnv: &cli.StringSliceFlag{
		Name:    FlagNewEnv,
		Value:   cli.NewStringSlice(),
		Usage:   FlagNewEnvUsage,
		EnvVars: []string{"DSLIM_NEW_ENV"},
	},
	FlagNewVolume: &cli.StringSliceFlag{
		Name:    FlagNewVolume,
		Value:   cli.NewStringSlice(),
		Usage:   FlagNewVolumeUsage,
		EnvVars: []string{"DSLIM_NEW_VOLUME"},
	},
	FlagNewLabel: &cli.StringSliceFlag{
		Name:    FlagNewLabel,
		Value:   cli.NewStringSlice(),
		Usage:   FlagNewLabelUsage,
		EnvVars: []string{"DSLIM_NEW_LABEL"},
	},
	FlagTag: &cli.StringSliceFlag{
		Name:    FlagTag,
		Value:   cli.NewStringSlice(),
		Usage:   FlagTagUsage,
		EnvVars: []string{"DSLIM_TARGET_TAG"},
	},
	FlagImageOverrides: &cli.StringFlag{
		Name:    FlagImageOverrides,
		Value:   "",
		Usage:   FlagImageOverridesUsage,
		EnvVars: []string{"DSLIM_TARGET_OVERRIDES"},
	},

	FlagBuildFromDockerfile: &cli.StringFlag{
		Name:    FlagBuildFromDockerfile,
		Value:   "",
		Usage:   FlagBuildFromDockerfileUsage,
		EnvVars: []string{"DSLIM_BUILD_DOCKERFILE"},
	},
	FlagDockerfileContext: &cli.StringFlag{
		Name:    FlagDockerfileContext,
		Value:   "",
		Usage:   FlagDockerfileContextUsage,
		EnvVars: []string{"DSLIM_BUILD_DOCKERFILE_CTX"},
	},
	FlagTagFat: &cli.StringFlag{
		Name:    FlagTagFat,
		Value:   "",
		Usage:   FlagTagFatUsage,
		EnvVars: []string{"DSLIM_TARGET_TAG_FAT"},
	},
	FlagCBOAddHost: &cli.StringSliceFlag{
		Name:    FlagCBOAddHost,
		Value:   cli.NewStringSlice(),
		Usage:   FlagCBOAddHostUsage,
		EnvVars: []string{"DSLIM_CBO_ADD_HOST"},
	},
	FlagCBOBuildArg: &cli.StringSliceFlag{
		Name:    FlagCBOBuildArg,
		Value:   cli.NewStringSlice(),
		Usage:   FlagCBOBuildArgUsage,
		EnvVars: []string{"DSLIM_CBO_BUILD_ARG"},
	},
	FlagCBOCacheFrom: &cli.StringSliceFlag{
		Name:    FlagCBOCacheFrom,
		Value:   cli.NewStringSlice(),
		Usage:   FlagCBOCacheFromUsage,
		EnvVars: []string{"DSLIM_CBO_CACHE_FROM"},
	},
	FlagCBOLabel: &cli.StringSliceFlag{
		Name:    FlagCBOLabel,
		Value:   cli.NewStringSlice(),
		Usage:   FlagCBOLabelUsage,
		EnvVars: []string{"DSLIM_CBO_LABEL"},
	},
	FlagCBOTarget: &cli.StringFlag{
		Name:    FlagCBOTarget,
		Value:   "",
		Usage:   FlagCBOTargetUsage,
		EnvVars: []string{"DSLIM_CBO_TARGET"},
	},
	FlagCBONetwork: &cli.StringFlag{
		Name:    FlagCBONetwork,
		Value:   "",
		Usage:   FlagCBONetworkUsage,
		EnvVars: []string{"DSLIM_CBO_NETWORK"},
	},
	FlagImageBuildEngine: &cli.StringFlag{
		Name:    FlagImageBuildEngine,
		Value:   IBEInternal,
		Usage:   FlagImageBuildEngineUsage,
		EnvVars: []string{"DSLIM_IMAGE_BUILD_ENG"},
	},
	FlagImageBuildArch: &cli.StringFlag{
		Name:    FlagImageBuildArch,
		Usage:   FlagImageBuildArchUsage,
		EnvVars: []string{"DSLIM_IMAGE_BUILD_ARCH"},
	},
	FlagDeleteFatImage: &cli.BoolFlag{
		Name:    FlagDeleteFatImage,
		Usage:   FlagDeleteFatImageUsage,
		EnvVars: []string{"DSLIM_DELETE_FAT"},
	},
	FlagRemoveExpose: &cli.StringSliceFlag{
		Name:    FlagRemoveExpose,
		Value:   cli.NewStringSlice(),
		Usage:   FlagRemoveExposeUsage,
		EnvVars: []string{"DSLIM_RM_EXPOSE"},
	},
	FlagRemoveEnv: &cli.StringSliceFlag{
		Name:    FlagRemoveEnv,
		Value:   cli.NewStringSlice(),
		Usage:   FlagRemoveEnvUsage,
		EnvVars: []string{"DSLIM_RM_ENV"},
	},
	FlagRemoveLabel: &cli.StringSliceFlag{
		Name:    FlagRemoveLabel,
		Value:   cli.NewStringSlice(),
		Usage:   FlagRemoveLabelUsage,
		EnvVars: []string{"DSLIM_RM_LABEL"},
	},
	FlagRemoveVolume: &cli.StringSliceFlag{
		Name:    FlagRemoveVolume,
		Value:   cli.NewStringSlice(),
		Usage:   FlagRemoveVolumeUsage,
		EnvVars: []string{"DSLIM_RM_VOLUME"},
	},
	FlagIncludeBinFile: &cli.StringFlag{
		Name:    FlagIncludeBinFile,
		Value:   "",
		Usage:   FlagIncludeBinFileUsage,
		EnvVars: []string{"DSLIM_INCLUDE_BIN_FILE"},
	},
	FlagIncludeExeFile: &cli.StringFlag{
		Name:    FlagIncludeExeFile,
		Value:   "",
		Usage:   FlagIncludeExeFileUsage,
		EnvVars: []string{"DSLIM_INCLUDE_EXE_FILE"},
	},

	FlagObfuscateMetadata: &cli.BoolFlag{
		Name:    FlagObfuscateMetadata,
		Usage:   FlagObfuscateMetadataUsage,
		EnvVars: []string{"DSLIM_OBFUSCATE_METADATA"},
	},
}

Functions

func CompleteImageBuildArch

func CompleteImageBuildArch(ia *commands.InteractiveApp, token string, params prompt.Document) []prompt.Suggest

func CompleteImageBuildEngine

func CompleteImageBuildEngine(ia *commands.InteractiveApp, token string, params prompt.Document) []prompt.Suggest

func GetAppNodejsInspectOptions

func GetAppNodejsInspectOptions(ctx *cli.Context) config.AppNodejsInspectOptions

func GetContainerBuildOptions

func GetContainerBuildOptions(ctx *cli.Context) (*config.ContainerBuildOptions, error)

func GetImageInstructions

func GetImageInstructions(ctx *cli.Context) (*config.ImageNewInstructions, error)

func GetKubernetesOptions

func GetKubernetesOptions(ctx *cli.Context) (config.KubernetesOptions, error)

func NewLogWriter

func NewLogWriter(name string) *chanWriter

func OnCommand

func OnCommand(
	xc *app.ExecutionContext,
	gparams *commands.GenericParams,
	targetRef string,
	doPull bool,
	dockerConfigPath string,
	registryAccount string,
	registrySecret string,
	doShowPullLogs bool,

	composeFiles []string,
	targetComposeSvc string,
	targetComposeSvcImage string,
	composeSvcStartWait int,
	composeSvcNoPorts bool,
	depExcludeComposeSvcAll bool,
	depIncludeComposeSvcDeps string,
	depIncludeTargetComposeSvcDeps bool,
	depIncludeComposeSvcs []string,
	depExcludeComposeSvcs []string,
	composeNets []string,
	composeEnvVars []string,
	composeEnvNoHost bool,
	composeWorkdir string,
	composeProjectName string,
	containerProbeComposeSvc string,

	cbOpts *config.ContainerBuildOptions,
	crOpts *config.ContainerRunOptions,
	outputTags []string,

	httpProbeOpts config.HTTPProbeOptions,

	portBindings map[dockerapi.Port][]dockerapi.PortBinding,
	doPublishExposedPorts bool,
	hostExecProbes []string,
	doRmFileArtifacts bool,
	copyMetaArtifactsLocation string,
	doRunTargetAsUser bool,
	doShowContainerLogs bool,
	doEnableMondel bool,
	doShowBuildLogs bool,
	imageOverrideSelectors map[string]bool,
	overrides *config.ContainerOverrides,
	instructions *config.ImageNewInstructions,
	links []string,
	etcHostsMaps []string,
	dnsServers []string,
	dnsSearchDomains []string,
	explicitVolumeMounts map[string]config.VolumeMount,
	doKeepPerms bool,
	pathPerms map[string]*fsutil.AccessInfo,

	excludePatterns map[string]*fsutil.AccessInfo,
	preservePaths map[string]*fsutil.AccessInfo,
	includePaths map[string]*fsutil.AccessInfo,
	includeBins map[string]*fsutil.AccessInfo,
	includeExes map[string]*fsutil.AccessInfo,
	doIncludeShell bool,
	doIncludeWorkdir bool,
	includeLastImageLayers uint,
	doIncludeAppImageAll bool,
	appImageStartInstGroup int,
	appImageStartInst string,
	appImageDockerfileInsts []string,
	doIncludeOSLibsNet bool,
	doIncludeZoneInfo bool,
	doIncludeCertAll bool,
	doIncludeCertBundles bool,
	doIncludeCertDirs bool,
	doIncludeCertPKAll bool,
	doIncludeCertPKDirs bool,
	doIncludeNew bool,
	doUseLocalMounts bool,
	doUseSensorVolume string,
	doKeepTmpArtifacts bool,
	continueAfter *config.ContinueAfter,
	execCmd string,
	execFileCmd string,
	doDeleteFatImage bool,
	rtaOnbuildBaseImage bool,
	rtaSourcePT bool,
	doObfuscateMetadata bool,
	sensorIPCEndpoint string,
	sensorIPCMode string,
	kubeOpts config.KubernetesOptions,
	appNodejsInspectOpts config.AppNodejsInspectOptions,
	imageBuildEngine string,
	imageBuildArch string,
)

OnCommand implements the 'build' command

func RegisterCommand

func RegisterCommand()

func SourceToOutputImageLabels

func SourceToOutputImageLabels(srcLabels map[string]string) map[string]string

func UpdateBuildOptionsWithNewInstructions

func UpdateBuildOptionsWithNewInstructions(
	options *imagebuilder.SimpleBuildOptions,
	instructions *config.ImageNewInstructions)

func UpdateBuildOptionsWithOverrides

func UpdateBuildOptionsWithOverrides(
	options *imagebuilder.SimpleBuildOptions,
	overrideSelectors map[string]bool,
	overrides *config.ContainerOverrides)

func UpdateBuildOptionsWithSrcImageInfo

func UpdateBuildOptionsWithSrcImageInfo(
	options *imagebuilder.SimpleBuildOptions,
	imageInfo *dockerapi.Image)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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