mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
Vendor in containers/buildah@v1.26.1
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
40
vendor/github.com/containers/buildah/pkg/cli/common.go
generated
vendored
40
vendor/github.com/containers/buildah/pkg/cli/common.go
generated
vendored
@@ -85,12 +85,16 @@ type BudResults struct {
|
||||
Squash bool
|
||||
Stdin bool
|
||||
Tag []string
|
||||
BuildOutput string
|
||||
Target string
|
||||
TLSVerify bool
|
||||
Jobs int
|
||||
LogRusage bool
|
||||
RusageLogFile string
|
||||
UnsetEnvs []string
|
||||
Envs []string
|
||||
OSFeatures []string
|
||||
OSVersion string
|
||||
}
|
||||
|
||||
// FromAndBugResults represents the results for common flags
|
||||
@@ -172,7 +176,7 @@ func GetNameSpaceFlagsCompletions() commonComp.FlagCompletions {
|
||||
// GetLayerFlags returns the common flags for layers
|
||||
func GetLayerFlags(flags *LayerResults) pflag.FlagSet {
|
||||
fs := pflag.FlagSet{}
|
||||
fs.BoolVar(&flags.ForceRm, "force-rm", false, "Always remove intermediate containers after a build, even if the build is unsuccessful.")
|
||||
fs.BoolVar(&flags.ForceRm, "force-rm", false, "always remove intermediate containers after a build, even if the build is unsuccessful.")
|
||||
fs.BoolVar(&flags.Layers, "layers", UseLayers(), "cache intermediate layers during build. Use BUILDAH_LAYERS environment variable to override.")
|
||||
return fs
|
||||
}
|
||||
@@ -184,22 +188,23 @@ func GetBudFlags(flags *BudResults) pflag.FlagSet {
|
||||
fs := pflag.FlagSet{}
|
||||
fs.BoolVar(&flags.AllPlatforms, "all-platforms", false, "attempt to build for all base image platforms")
|
||||
fs.String("arch", runtime.GOARCH, "set the ARCH of the image to the provided value instead of the architecture of the host")
|
||||
fs.StringArrayVar(&flags.Annotation, "annotation", []string{}, "Set metadata for an image (default [])")
|
||||
fs.StringArrayVar(&flags.Annotation, "annotation", []string{}, "set metadata for an image (default [])")
|
||||
fs.StringVar(&flags.Authfile, "authfile", "", "path of the authentication file.")
|
||||
fs.StringArrayVar(&flags.BuildArg, "build-arg", []string{}, "`argument=value` to supply to the builder")
|
||||
fs.StringVar(&flags.CacheFrom, "cache-from", "", "Images to utilise as potential cache sources. The build process does not currently support caching so this is a NOOP.")
|
||||
fs.StringVar(&flags.CacheFrom, "cache-from", "", "images to utilise as potential cache sources. The build process does not currently support caching so this is a NOOP.")
|
||||
fs.StringVar(&flags.CertDir, "cert-dir", "", "use certificates at the specified path to access the registry")
|
||||
fs.BoolVar(&flags.Compress, "compress", false, "This is legacy option, which has no effect on the image")
|
||||
fs.BoolVar(&flags.Compress, "compress", false, "this is a legacy option, which has no effect on the image")
|
||||
fs.StringVar(&flags.Creds, "creds", "", "use `[username[:password]]` for accessing the registry")
|
||||
fs.BoolVarP(&flags.DisableCompression, "disable-compression", "D", true, "don't compress layers by default")
|
||||
fs.BoolVar(&flags.DisableContentTrust, "disable-content-trust", false, "This is a Docker specific option and is a NOOP")
|
||||
fs.BoolVar(&flags.DisableContentTrust, "disable-content-trust", false, "this is a Docker specific option and is a NOOP")
|
||||
fs.StringArrayVar(&flags.Envs, "env", []string{}, "set environment variable for the image")
|
||||
fs.StringVar(&flags.From, "from", "", "image name used to replace the value in the first FROM instruction in the Containerfile")
|
||||
fs.StringVar(&flags.IgnoreFile, "ignorefile", "", "path to an alternate .dockerignore file")
|
||||
fs.StringSliceVarP(&flags.File, "file", "f", []string{}, "`pathname or URL` of a Dockerfile")
|
||||
fs.StringVar(&flags.Format, "format", DefaultFormat(), "`format` of the built image's manifest and metadata. Use BUILDAH_FORMAT environment variable to override.")
|
||||
fs.StringVar(&flags.Iidfile, "iidfile", "", "`file` to write the image ID to")
|
||||
fs.IntVar(&flags.Jobs, "jobs", 1, "how many stages to run in parallel")
|
||||
fs.StringArrayVar(&flags.Label, "label", []string{}, "Set metadata for an image (default [])")
|
||||
fs.StringArrayVar(&flags.Label, "label", []string{}, "set metadata for an image (default [])")
|
||||
fs.StringVar(&flags.Logfile, "logfile", "", "log to `file` instead of stdout/stderr")
|
||||
fs.Int("loglevel", 0, "NO LONGER USED, flag ignored, and hidden")
|
||||
if err := fs.MarkHidden("loglevel"); err != nil {
|
||||
@@ -214,9 +219,11 @@ func GetBudFlags(flags *BudResults) pflag.FlagSet {
|
||||
panic(fmt.Sprintf("error marking the rusage-logfile flag as hidden: %v", err))
|
||||
}
|
||||
fs.StringVar(&flags.Manifest, "manifest", "", "add the image to the specified manifest list. Creates manifest list if it does not exist")
|
||||
fs.BoolVar(&flags.NoHosts, "no-hosts", false, "Do not create the new containers /etc/hosts file, use the one from the current image.")
|
||||
fs.BoolVar(&flags.NoCache, "no-cache", false, "Do not use existing cached images for the container build. Build from the start with a new set of cached layers.")
|
||||
fs.BoolVar(&flags.NoHosts, "no-hosts", false, "do not create new /etc/hosts files for RUN instructions, use the one from the base image.")
|
||||
fs.BoolVar(&flags.NoCache, "no-cache", false, "do not use existing cached images for the container build. Build from the start with a new set of cached layers.")
|
||||
fs.String("os", runtime.GOOS, "set the OS to the provided value instead of the current operating system of the host")
|
||||
fs.StringArrayVar(&flags.OSFeatures, "os-feature", []string{}, "set required OS `feature` for the target image in addition to values from the base image")
|
||||
fs.StringVar(&flags.OSVersion, "os-version", "", "set required OS `version` for the target image instead of the value from the base image")
|
||||
fs.StringVar(&flags.Pull, "pull", "true", "pull the image from the registry if newer or not present in store, if false, only pull the image if not present, if always, pull the image even if the named image is present in store, if never, only use the image present in store if available")
|
||||
fs.Lookup("pull").NoOptDefVal = "true" //allow `--pull ` to be set to `true` as expected.
|
||||
fs.BoolVar(&flags.PullAlways, "pull-always", false, "pull the image even if the named image is present in store")
|
||||
@@ -229,7 +236,7 @@ func GetBudFlags(flags *BudResults) pflag.FlagSet {
|
||||
}
|
||||
fs.BoolVarP(&flags.Quiet, "quiet", "q", false, "refrain from announcing build instructions and image read/write progress")
|
||||
fs.BoolVar(&flags.IdentityLabel, "identity-label", true, "add default identity label (default true)")
|
||||
fs.BoolVar(&flags.Rm, "rm", true, "Remove intermediate containers after a successful build")
|
||||
fs.BoolVar(&flags.Rm, "rm", true, "remove intermediate containers after a successful build")
|
||||
// "runtime" definition moved to avoid name collision in podman build. Defined in cmd/buildah/build.go.
|
||||
fs.StringSliceVar(&flags.RuntimeFlags, "runtime-flag", []string{}, "add global flags for the container runtime")
|
||||
fs.StringArrayVar(&flags.Secrets, "secret", []string{}, "secret file to expose to the build")
|
||||
@@ -242,11 +249,12 @@ func GetBudFlags(flags *BudResults) pflag.FlagSet {
|
||||
fs.StringArrayVar(&flags.SSH, "ssh", []string{}, "SSH agent socket or keys to expose to the build. (format: default|<id>[=<socket>|<key>[,<key>]])")
|
||||
fs.BoolVar(&flags.Stdin, "stdin", false, "pass stdin into containers")
|
||||
fs.StringArrayVarP(&flags.Tag, "tag", "t", []string{}, "tagged `name` to apply to the built image")
|
||||
fs.StringVarP(&flags.BuildOutput, "output", "o", "", "output destination (format: type=local,dest=path)")
|
||||
fs.StringVar(&flags.Target, "target", "", "set the target build stage to build")
|
||||
fs.Int64Var(&flags.Timestamp, "timestamp", 0, "set created timestamp to the specified epoch seconds to allow for deterministic builds, defaults to current time")
|
||||
fs.BoolVar(&flags.TLSVerify, "tls-verify", true, "require HTTPS and verify certificates when accessing the registry")
|
||||
fs.String("variant", "", "override the `variant` of the specified image")
|
||||
fs.StringSliceVar(&flags.UnsetEnvs, "unsetenv", nil, "Unset environment variable from final image")
|
||||
fs.StringSliceVar(&flags.UnsetEnvs, "unsetenv", nil, "unset environment variable from final image")
|
||||
return fs
|
||||
}
|
||||
|
||||
@@ -260,6 +268,7 @@ func GetBudFlagsCompletions() commonComp.FlagCompletions {
|
||||
flagCompletion["cache-from"] = commonComp.AutocompleteNone
|
||||
flagCompletion["cert-dir"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["creds"] = commonComp.AutocompleteNone
|
||||
flagCompletion["env"] = commonComp.AutocompleteNone
|
||||
flagCompletion["file"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["from"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["format"] = commonComp.AutocompleteNone
|
||||
@@ -270,6 +279,8 @@ func GetBudFlagsCompletions() commonComp.FlagCompletions {
|
||||
flagCompletion["logfile"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["manifest"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["os"] = commonComp.AutocompleteNone
|
||||
flagCompletion["os-feature"] = commonComp.AutocompleteNone
|
||||
flagCompletion["os-version"] = commonComp.AutocompleteNone
|
||||
flagCompletion["pull"] = commonComp.AutocompleteDefault
|
||||
flagCompletion["runtime-flag"] = commonComp.AutocompleteNone
|
||||
flagCompletion["secret"] = commonComp.AutocompleteNone
|
||||
@@ -281,6 +292,7 @@ func GetBudFlagsCompletions() commonComp.FlagCompletions {
|
||||
flagCompletion["timestamp"] = commonComp.AutocompleteNone
|
||||
flagCompletion["variant"] = commonComp.AutocompleteNone
|
||||
flagCompletion["unsetenv"] = commonComp.AutocompleteNone
|
||||
flagCompletion["output"] = commonComp.AutocompleteNone
|
||||
return flagCompletion
|
||||
}
|
||||
|
||||
@@ -306,10 +318,10 @@ func GetFromAndBudFlags(flags *FromAndBudResults, usernsResults *UserNSResults,
|
||||
fs.StringVar(&flags.CPUSetCPUs, "cpuset-cpus", "", "CPUs in which to allow execution (0-3, 0,1)")
|
||||
fs.StringVar(&flags.CPUSetMems, "cpuset-mems", "", "memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.")
|
||||
fs.StringSliceVar(&flags.DecryptionKeys, "decryption-key", nil, "key needed to decrypt the image")
|
||||
fs.StringArrayVar(&flags.Devices, "device", defaultContainerConfig.Containers.Devices, "Additional devices to be used within containers (default [])")
|
||||
fs.StringSliceVar(&flags.DNSSearch, "dns-search", defaultContainerConfig.Containers.DNSSearches, "Set custom DNS search domains")
|
||||
fs.StringSliceVar(&flags.DNSServers, "dns", defaultContainerConfig.Containers.DNSServers, "Set custom DNS servers or disable it completely by setting it to 'none', which prevents the automatic creation of `/etc/resolv.conf`.")
|
||||
fs.StringSliceVar(&flags.DNSOptions, "dns-option", defaultContainerConfig.Containers.DNSOptions, "Set custom DNS options")
|
||||
fs.StringArrayVar(&flags.Devices, "device", defaultContainerConfig.Containers.Devices, "additional devices to be used within containers (default [])")
|
||||
fs.StringSliceVar(&flags.DNSSearch, "dns-search", defaultContainerConfig.Containers.DNSSearches, "set custom DNS search domains")
|
||||
fs.StringSliceVar(&flags.DNSServers, "dns", defaultContainerConfig.Containers.DNSServers, "set custom DNS servers or disable it completely by setting it to 'none', which prevents the automatic creation of `/etc/resolv.conf`.")
|
||||
fs.StringSliceVar(&flags.DNSOptions, "dns-option", defaultContainerConfig.Containers.DNSOptions, "set custom DNS options")
|
||||
fs.BoolVar(&flags.HTTPProxy, "http-proxy", true, "pass through HTTP Proxy environment variables")
|
||||
fs.StringVar(&flags.Isolation, "isolation", DefaultIsolation(), "`type` of process isolation to use. Use BUILDAH_ISOLATION environment variable to override.")
|
||||
fs.StringVarP(&flags.Memory, "memory", "m", "", "memory limit (format: <number>[<unit>], where unit = b, k, m or g)")
|
||||
|
||||
Reference in New Issue
Block a user