build

package
v0.0.0-...-9159377 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 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"

	FlagIncludeDirBins      = "include-dir-bins"
	FlagIncludeDirBinsUsage = "" /* 127-byte string literal not displayed */

	FlagIncludeWorkdir      = "include-workdir"
	FlagIncludeWorkdirUsage = "Keep files in working directory"

	//TBD
	FlagWorkdirExclude      = "workdir-exclude"
	FlagWorkdirExcludeUsage = "Exclude filter for artifacts when working directory is included"

	FlagIncludeAppImageAddCopyAll = "include-app-image-addcopy-all" //TBD
	FlagIncludeAppImageRun        = "include-app-image-run"         //TBD

	FlagIncludeAppImageAll      = "include-app-image-all"
	FlagIncludeAppImageAllUsage = "Keep everything in the app part of the container image"

	FlagAppImageStartInst      = "app-image-start-instruction"
	FlagAppImageStartInstUsage = "Instruction (prefix) that indicates where the app starts in the container image"

	FlagAppImageStartLayerCount = "app-image-start-layer-count" //TBD

	FlagAppImageStartInstGroup      = "app-image-start-instruction-group"
	FlagAppImageStartInstGroupUsage = "Instruction group (reverse) index that indicates where the app starts in the container image"

	FlagAppImageStartDetect = "app-image-start-detect" //TBD

	FlagAppImageDockerfile      = "app-image-dockerfile" //TODO: make it work with FlagBuildFromDockerfile too
	FlagAppImageDockerfileUsage = "Path to app image Dockerfile (used to determine where the application part of the image starts)"

	FlagIncludePathsCreportFile      = "include-paths-creport-file"
	FlagIncludePathsCreportFileUsage = "Keep files from the referenced creport"

	FlagIncludeOSLibsNet      = "include-oslibs-net"
	FlagIncludeOSLibsNetUsage = "Keep the common networking OS libraries"

	FlagIncludeSSHClient           = "include-ssh-client"
	FlagIncludeSSHClientUsage      = "Keep the common SSH client components and configs"
	FlagIncludeSSHClientAll        = "include-ssh-client-all"
	FlagIncludeSSHClientAllUsage   = "Keep all SSH client components and configs"
	FlagIncludeSSHClientBasic      = "include-ssh-client-basic"
	FlagIncludeSSHClientBasicUsage = "Keep the basic SSH client components and configs"

	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"

	FlagExcludePattern      = "exclude-pattern"
	FlagExcludePatternUsage = "Exclude path pattern (Glob/Match in Go and **) from image"

	FlagExcludeVarLockFiles      = "exclude-varlock-files"
	FlagExcludeVarLockFilesUsage = "Exclude the files in the var and run lock directory"

	FlagExcludeMounts      = "exclude-mounts"
	FlagExcludeMountsUsage = "Exclude mounted volumes from image"

	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"

	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{
		command.Cflag(command.FlagCommandParamsFile),
		command.Cflag(command.FlagTarget),
		command.Cflag(command.FlagPull),
		command.Cflag(command.FlagDockerConfigPath),
		command.Cflag(command.FlagRegistryAccount),
		command.Cflag(command.FlagRegistrySecret),
		command.Cflag(command.FlagShowPullLogs),

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

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

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

		cflag(FlagTag),
		cflag(FlagImageOverrides),

		command.Cflag(command.FlagCRORuntime),
		command.Cflag(command.FlagCROHostConfigFile),
		command.Cflag(command.FlagCROSysctl),
		command.Cflag(command.FlagCROShmSize),
		command.Cflag(command.FlagUser),
		command.Cflag(command.FlagEntrypoint),
		command.Cflag(command.FlagCmd),
		command.Cflag(command.FlagWorkdir),
		command.Cflag(command.FlagEnv),
		command.Cflag(command.FlagEnvFile),
		command.Cflag(command.FlagLabel),
		command.Cflag(command.FlagVolume),
		command.Cflag(command.FlagLink),
		command.Cflag(command.FlagEtcHostsMap),
		command.Cflag(command.FlagContainerDNS),
		command.Cflag(command.FlagContainerDNSSearch),
		command.Cflag(command.FlagNetwork),
		command.Cflag(command.FlagHostname),
		command.Cflag(command.FlagExpose),
		command.Cflag(command.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),
		cflag(FlagPreservePath),
		cflag(FlagPreservePathFile),
		cflag(FlagIncludePath),
		cflag(FlagIncludePathFile),
		cflag(FlagIncludeDirBins),
		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(FlagIncludeSSHClient),
		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(FlagExcludePattern),
		cflag(FlagExcludeVarLockFiles),
		cflag(FlagExcludeMounts),

		cflag(FlagObfuscateMetadata),
		command.Cflag(command.FlagContinueAfter),
		command.Cflag(command.FlagUseLocalMounts),
		command.Cflag(command.FlagUseSensorVolume),
		command.Cflag(command.FlagRTAOnbuildBaseImage),
		command.Cflag(command.FlagRTASourcePT),

		command.Cflag(command.FlagSensorIPCEndpoint),
		command.Cflag(command.FlagSensorIPCMode),
	}, command.HTTPProbeFlags()...),
	Action: func(ctx *cli.Context) error {
		gparams, ok := command.CLIContextGet(ctx.Context, command.GlobalParams).(*command.GenericParams)
		if !ok || gparams == nil {
			return command.ErrNoGlobalParams
		}

		xc := app.NewExecutionContext(
			Name,
			gparams.QuietCLIMode,
			gparams.OutputFormat)

		_ = ctx.String(command.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(command.FlagDeleteFatImage)
		if cbOpts.Dockerfile == "" {
			deleteFatImage = false
		}

		composeFiles := ctx.StringSlice(command.FlagComposeFile)

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

		composeSvcStartWait := ctx.Int(command.FlagComposeSvcStartWait)

		composeEnvNoHost := ctx.Bool(command.FlagComposeEnvNoHost)
		composeEnvVars, err := command.ParseLinesWithCommentsFile(ctx.String(command.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(command.FlagComposeProjectName)
		composeWorkdir := ctx.String(command.FlagComposeWorkdir)
		containerProbeComposeSvc := ctx.String(command.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(command.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
		}

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

		crOpts, err := command.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(command.FlagPull)
		dockerConfigPath := ctx.String(command.FlagDockerConfigPath)
		registryAccount := ctx.String(command.FlagRegistryAccount)
		registrySecret := ctx.String(command.FlagRegistrySecret)
		doShowPullLogs := ctx.Bool(command.FlagShowPullLogs)

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

		portBindings, err := command.ParsePortBindings(ctx.StringSlice(command.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(command.FlagPublishExposedPorts)

		httpProbeOpts := command.GetHTTPProbeOptions(xc, ctx, false)

		continueAfter, err := command.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(command.FlagExec)
		execFile := ctx.String(command.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)
			xc.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(command.FlagHostExec)
		moreHostExecProbes, err := command.ParseHTTPProbeExecFile(ctx.String(command.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 = command.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(command.FlagRunTargetAsUser)

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

		doImageOverrides := ctx.String(FlagImageOverrides)
		overrides, err := command.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 := command.ParseVolumeMounts(ctx.StringSlice(command.FlagMount))
		if err != nil {
			xc.Out.Error("param.error.mount", err.Error())
			xc.Out.State("exited",
				ovars{
					"exit.code": -1,
				})
			xc.Exit(-1)
		}

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

		preservePaths := command.ParsePaths(ctx.StringSlice(FlagPreservePath))
		morePreservePaths, err := command.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 := command.ParsePaths(ctx.StringSlice(FlagIncludePath))
		moreIncludePaths, err := command.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 := command.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 := command.ParsePaths(ctx.StringSlice(FlagPathPerms))
		morePathPerms, err := command.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 := command.ParsePaths(ctx.StringSlice(FlagIncludeBin))
		moreIncludeBins, err := command.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",
					})
			}
		}

		includeDirBinsList := command.ParsePaths(ctx.StringSlice(FlagIncludeDirBins))

		includeExes := command.ParsePaths(ctx.StringSlice(FlagIncludeExe))
		moreIncludeExes, err := command.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 := command.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)
		}

		doIncludeSSHClient := ctx.Bool(FlagIncludeSSHClient)
		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(command.FlagUseLocalMounts)
		doUseSensorVolume := ctx.String(command.FlagUseSensorVolume)

		doKeepTmpArtifacts := ctx.Bool(FlagKeepTmpArtifacts)

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

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

		rtaOnbuildBaseImage := ctx.Bool(command.FlagRTAOnbuildBaseImage)
		rtaSourcePT := ctx.Bool(command.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,
			command.ParseImageOverrides(doImageOverrides),
			overrides,
			instructions,
			ctx.StringSlice(command.FlagLink),
			ctx.StringSlice(command.FlagEtcHostsMap),
			ctx.StringSlice(command.FlagContainerDNS),
			ctx.StringSlice(command.FlagContainerDNSSearch),
			volumeMounts,
			doKeepPerms,
			pathPerms,
			excludePatterns,
			doExcludeVarLockFiles,
			preservePaths,
			includePaths,
			includeBins,
			includeDirBinsList,
			includeExes,
			doIncludeShell,
			doIncludeWorkdir,
			includeLastImageLayers,
			doIncludeAppImageAll,
			appImageStartInstGroup,
			appImageStartInst,
			appImageDockerfileInsts,
			doIncludeSSHClient,
			doIncludeOSLibsNet,
			doIncludeZoneInfo,
			doIncludeCertAll,
			doIncludeCertBundles,
			doIncludeCertDirs,
			doIncludeCertPKAll,
			doIncludeCertPKDirs,
			doIncludeNew,
			doUseLocalMounts,
			doUseSensorVolume,
			doKeepTmpArtifacts,
			continueAfter,
			execCmd,
			string(execFileCmd),
			deleteFatImage,
			rtaOnbuildBaseImage,
			rtaSourcePT,
			doObfuscateMetadata,
			ctx.String(command.FlagSensorIPCEndpoint),
			ctx.String(command.FlagSensorIPCMode),
			kubeOpts,
			GetAppNodejsInspectOptions(ctx),
			imageBuildEngine,
			imageBuildArch)

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

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

		command.FullFlagName(command.FlagUseLocalMounts):       command.CompleteBool,
		command.FullFlagName(command.FlagUseSensorVolume):      command.CompleteVolume,
		command.FullFlagName(FlagKeepTmpArtifacts):             command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNuxtDir):            command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNuxtBuildDir):       command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNuxtDistDir):        command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNuxtStaticDir):      command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNuxtNodeModulesDir): command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNextDir):            command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNextBuildDir):       command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNextDistDir):        command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNextStaticDir):      command.CompleteBool,
		command.FullFlagName(FlagIncludeAppNextNodeModulesDir): command.CompleteBool,
		command.FullFlagName(command.FlagCROHostConfigFile):    command.CompleteFile,
		command.FullFlagName(FlagDockerfileContext):            command.CompleteFile,
		command.FullFlagName(FlagDeleteFatImage):               command.CompleteBool,
		command.FullFlagName(command.FlagRTAOnbuildBaseImage):  command.CompleteBool,
		command.FullFlagName(command.FlagRTASourcePT):          command.CompleteBool,
		command.FullFlagName(command.FlagSensorIPCMode):        command.CompleteIPCMode,
		command.FullFlagName(FlagImageBuildEngine):             CompleteImageBuildEngine,
		command.FullFlagName(FlagImageBuildArch):               CompleteImageBuildArch,
		command.FullFlagName(FlagAppImageDockerfile):           command.CompleteFile,
		command.FullFlagName(FlagObfuscateMetadata):            command.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"},
	},
	FlagIncludeDirBins: &cli.StringSliceFlag{
		Name:    FlagIncludeDirBins,
		Value:   cli.NewStringSlice(),
		Usage:   FlagIncludeDirBinsUsage,
		EnvVars: []string{"DSLIM_INCLUDE_DIR_BINS"},
	},
	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"},
	},

	FlagIncludeSSHClient: &cli.BoolFlag{
		Name:    FlagIncludeSSHClient,
		Value:   false,
		Usage:   FlagIncludeSSHClientUsage,
		EnvVars: []string{"DSLIM_INCLUDE_SSH_CLIENT"},
	},

	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"},
	},

	FlagExcludePattern: &cli.StringSliceFlag{
		Name:    FlagExcludePattern,
		Value:   cli.NewStringSlice(),
		Usage:   FlagExcludePatternUsage,
		EnvVars: []string{"DSLIM_EXCLUDE_PATTERN"},
	},
	FlagExcludeVarLockFiles: &cli.BoolFlag{
		Name:    FlagExcludeVarLockFiles,
		Value:   true,
		Usage:   FlagExcludeVarLockFilesUsage,
		EnvVars: []string{"DSLIM_EXCLUDE_VARLOCK"},
	},
	FlagExcludeMounts: &cli.BoolFlag{
		Name:    FlagExcludeMounts,
		Value:   true,
		Usage:   FlagExcludeMountsUsage,
		EnvVars: []string{"DSLIM_EXCLUDE_MOUNTS"},
	},

	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 *command.InteractiveApp, token string, params prompt.Document) []prompt.Suggest

func CompleteImageBuildEngine

func CompleteImageBuildEngine(ia *command.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 *command.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,
	doExcludeVarLockFiles bool,
	preservePaths map[string]*fsutil.AccessInfo,
	includePaths map[string]*fsutil.AccessInfo,
	includeBins map[string]*fsutil.AccessInfo,
	includeDirBinsList map[string]*fsutil.AccessInfo,
	includeExes map[string]*fsutil.AccessInfo,
	doIncludeShell bool,
	doIncludeWorkdir bool,
	includeLastImageLayers uint,
	doIncludeAppImageAll bool,
	appImageStartInstGroup int,
	appImageStartInst string,
	appImageDockerfileInsts []string,
	doIncludeSSHClient bool,
	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