diff --git a/Makefile b/Makefile index 8af2a19e9e..37cc90f6f0 100644 --- a/Makefile +++ b/Makefile @@ -214,7 +214,7 @@ endif # gvisor-tap-vsock version for gvproxy.exe and win-sshproxy.exe downloads # the upstream project ships pre-built binaries since version 0.7.1 -GV_VERSION=v0.7.1 +GV_VERSION=v0.7.2 ### ### Primary entry-point targets diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 42830fda64..bbcdd4d272 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,18 @@ # Release Notes +## 4.9.0 +### Features +- The `podman farm` suite of commands for multi-architecture builds is now fully enabled and documented. +- Add a network recovery service to Podman Machine VMs using the QEMU backend to detect and recover from an inoperable host networking issues experienced by Mac users when running for long periods of time. + +### Bugfixes +- Fixed a bug where the HyperV provider for `podman machine` did not forward the API socket to the host machine. +- Fixed a bug where improperly formatted annotations passed to `podman kube play` could cause Podman to panic. +- Fixed a bug where `podman system reset` could fail if non-Podman containers (e.g. containers created by Buildah) were present. + +### Misc +- Containers run in `podman machine` VMs now default to a PID limit of unlimited, instead of 2048. + ## 4.8.3 ### Security - Fixed [GHSA-45x7-px36-x8w8](https://github.com/advisories/GHSA-45x7-px36-x8w8): CVE-2023-48795 by vendoring golang.org/x/crypto v0.17.0. @@ -58,7 +71,6 @@ - The amount of CPUs a podman machine uses now defaults to available cores/2 ([#17066](https://github.com/containers/podman/issues/17066)). - Podman machine now prohibits using provider names as machine names. `applehv`, `qemu`, `wsl`, and `hyperv` are no longer valid Podman machine names - ### Quadlet - Quadlet now supports the `UIDMap`, `GIDMap`, `SubUIDMap`, and `SubGIDMap` options in .container files. - Fixed a bug where symlinks were not resolved in search paths ([#20504](https://github.com/containers/podman/issues/20504)). @@ -73,7 +85,6 @@ - Quadlet now removes anonymous volumes when removing a container ([#20070](https://github.com/containers/podman/issues/20070)). - Quadlet now supports a new unit type, `.image`. - ### Bugfixes - Fixed a bug where mounted volumes on Podman machines on MacOS would have a max open files limit ([#16106](https://github.com/containers/podman/issues/16106)). - Fixed a bug where setting both the `--uts` and `--network` options to `host` did not fill /etc/hostname with the host's name ([#20448](https://github.com/containers/podman/issues/20448)). diff --git a/cmd/podman/common/build.go b/cmd/podman/common/build.go index 5e60d7f0f3..90f303d53e 100644 --- a/cmd/podman/common/build.go +++ b/cmd/podman/common/build.go @@ -49,7 +49,7 @@ type BuildFlagsWrapper struct { // FarmBuildHiddenFlags are the flags hidden from the farm build command because they are either not // supported or don't make sense in the farm build use case var FarmBuildHiddenFlags = []string{"arch", "all-platforms", "compress", "cw", "disable-content-trust", - "logsplit", "manifest", "os", "output", "platform", "sign-by", "signature-policy", "stdin", "tls-verify", + "logsplit", "manifest", "os", "output", "platform", "sign-by", "signature-policy", "stdin", "variant"} func DefineBuildFlags(cmd *cobra.Command, buildOpts *BuildFlagsWrapper, isFarmBuild bool) { @@ -252,6 +252,7 @@ func ParseBuildOpts(cmd *cobra.Command, args []string, buildOpts *BuildFlagsWrap } apiBuildOpts.BuildOptions = *buildahDefineOpts apiBuildOpts.ContainerFiles = containerFiles + apiBuildOpts.Authfile = buildOpts.Authfile return &apiBuildOpts, err } diff --git a/cmd/podman/farm/build.go b/cmd/podman/farm/build.go index 7ecb75baf1..57e46a93ca 100644 --- a/cmd/podman/farm/build.go +++ b/cmd/podman/farm/build.go @@ -4,12 +4,13 @@ import ( "errors" "fmt" "os" + "strings" + "github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/config" "github.com/containers/podman/v4/cmd/podman/common" "github.com/containers/podman/v4/cmd/podman/registry" "github.com/containers/podman/v4/cmd/podman/utils" - "github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/farm" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -19,17 +20,19 @@ type buildOptions struct { buildOptions common.BuildFlagsWrapper local bool platforms []string + farm string } var ( farmBuildDescription = `Build images on farm nodes, then bundle them into a manifest list` buildCommand = &cobra.Command{ - Use: "build [options] [CONTEXT]", - Short: "Build a container image for multiple architectures", - Long: farmBuildDescription, - RunE: build, - Example: "podman farm build [flags] buildContextDirectory", - Args: cobra.ExactArgs(1), + Use: "build [options] [CONTEXT]", + Short: "Build a container image for multiple architectures", + Long: farmBuildDescription, + RunE: build, + Example: "podman farm build [flags] buildContextDirectory", + ValidArgsFunction: common.AutocompleteDefaultOneArg, + Args: cobra.MaximumNArgs(1), } buildOpts = buildOptions{ buildOptions: common.BuildFlagsWrapper{}, @@ -44,15 +47,26 @@ func init() { flags := buildCommand.Flags() flags.SetNormalizeFunc(utils.AliasFlags) - localFlagName := "local" - // Default for local is true and hide this flag for the remote use case - if !registry.IsRemote() { - flags.BoolVarP(&buildOpts.local, localFlagName, "l", true, "Build image on local machine as well as on farm nodes") - } cleanupFlag := "cleanup" flags.BoolVar(&buildOpts.buildOptions.Cleanup, cleanupFlag, false, "Remove built images from farm nodes on success") + + podmanConfig := registry.PodmanConfig() + farmFlagName := "farm" + // If remote, don't read the client's containers.conf file + defaultFarm := "" + if !registry.IsRemote() { + defaultFarm = podmanConfig.ContainersConfDefaultsRO.Farms.Default + } + flags.StringVar(&buildOpts.farm, farmFlagName, defaultFarm, "Farm to use for builds") + _ = buildCommand.RegisterFlagCompletionFunc(farmFlagName, common.AutoCompleteFarms) + + localFlagName := "local" + // Default for local is true + flags.BoolVarP(&buildOpts.local, localFlagName, "l", true, "Build image on local machine as well as on farm nodes") + platformsFlag := "platforms" buildCommand.PersistentFlags().StringSliceVar(&buildOpts.platforms, platformsFlag, nil, "Build only on farm nodes that match the given platforms") + _ = buildCommand.RegisterFlagCompletionFunc(platformsFlag, completion.AutocompletePlatform) common.DefineBuildFlags(buildCommand, &buildOpts.buildOptions, true) } @@ -68,7 +82,18 @@ func build(cmd *cobra.Command, args []string) error { if !cmd.Flags().Changed("tag") { return errors.New("cannot create manifest list without a name, value for --tag is required") } - opts, err := common.ParseBuildOpts(cmd, args, &buildOpts.buildOptions) + // Ensure that the user gives a full name so we can push the built images from + // the node to the given registry and repository + // Should be of the format registry/repository/imageName + tag, err := cmd.Flags().GetStringArray("tag") + if err != nil { + return err + } + if !strings.Contains(tag[0], "/") { + return fmt.Errorf("%q is not a full image reference name", tag[0]) + } + bopts := buildOpts.buildOptions + opts, err := common.ParseBuildOpts(cmd, args, &bopts) if err != nil { return err } @@ -91,6 +116,11 @@ func build(cmd *cobra.Command, args []string) error { return err } opts.IIDFile = iidFile + tlsVerify, err := cmd.Flags().GetBool("tls-verify") + if err != nil { + return err + } + opts.SkipTLSVerify = !tlsVerify cfg, err := config.ReadCustomConfig() if err != nil { @@ -98,21 +128,17 @@ func build(cmd *cobra.Command, args []string) error { } defaultFarm := cfg.Farms.Default - if farmCmd.Flags().Changed("farm") { - f, err := farmCmd.Flags().GetString("farm") + if cmd.Flags().Changed("farm") { + f, err := cmd.Flags().GetString("farm") if err != nil { return err } defaultFarm = f } - var localEngine entities.ImageEngine - if buildOpts.local { - localEngine = registry.ImageEngine() - } - + localEngine := registry.ImageEngine() ctx := registry.Context() - farm, err := farm.NewFarm(ctx, defaultFarm, localEngine) + farm, err := farm.NewFarm(ctx, defaultFarm, localEngine, buildOpts.local) if err != nil { return fmt.Errorf("initializing: %w", err) } @@ -126,7 +152,7 @@ func build(cmd *cobra.Command, args []string) error { manifestName := opts.Output // Set Output to "" so that the images built on the farm nodes have no name opts.Output = "" - if err = farm.Build(ctx, schedule, *opts, manifestName); err != nil { + if err = farm.Build(ctx, schedule, *opts, manifestName, localEngine); err != nil { return fmt.Errorf("build: %w", err) } logrus.Infof("build: ok") diff --git a/cmd/podman/farm/create.go b/cmd/podman/farm/create.go index b9986b8118..6ba0e6d41b 100644 --- a/cmd/podman/farm/create.go +++ b/cmd/podman/farm/create.go @@ -16,7 +16,7 @@ var ( The "podman system connection add --farm" command can be used to add a new connection to a new or existing farm.` createCommand = &cobra.Command{ - Use: "create [options] NAME [CONNECTIONS...]", + Use: "create NAME [CONNECTIONS...]", Args: cobra.MinimumNArgs(1), Short: "Create a new farm", Long: farmCreateDescription, diff --git a/cmd/podman/farm/farm.go b/cmd/podman/farm/farm.go index c27ac2237c..01b39eff0b 100644 --- a/cmd/podman/farm/farm.go +++ b/cmd/podman/farm/farm.go @@ -16,27 +16,8 @@ var ( } ) -var ( - // Temporary struct to hold cli values. - farmOpts = struct { - Farm string - }{} -) - func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ Command: farmCmd, }) - farmCmd.Hidden = true - - flags := farmCmd.Flags() - podmanConfig := registry.PodmanConfig() - - farmFlagName := "farm" - // If remote, don't read the client's containers.conf file - defaultFarm := "" - if !registry.IsRemote() { - defaultFarm = podmanConfig.ContainersConfDefaultsRO.Farms.Default - } - flags.StringVarP(&farmOpts.Farm, farmFlagName, "f", defaultFarm, "Farm to use for builds") } diff --git a/contrib/pkginstaller/Makefile b/contrib/pkginstaller/Makefile index 3b467e31f1..b1d3e36c33 100644 --- a/contrib/pkginstaller/Makefile +++ b/contrib/pkginstaller/Makefile @@ -6,7 +6,7 @@ ifeq ($(ARCH), aarch64) else GOARCH:=$(ARCH) endif -GVPROXY_VERSION ?= 0.7.1 +GVPROXY_VERSION ?= 0.7.2 QEMU_VERSION ?= 8.0.0-1 GVPROXY_RELEASE_URL ?= https://github.com/containers/gvisor-tap-vsock/releases/download/v$(GVPROXY_VERSION)/gvproxy-darwin QEMU_RELEASE_URL ?= https://github.com/containers/podman-machine-qemu/releases/download/v$(QEMU_VERSION)/podman-machine-qemu-$(ARCH)-$(QEMU_VERSION).tar.xz diff --git a/docs/source/markdown/.gitignore b/docs/source/markdown/.gitignore index 3aae56e5c6..29bbf0b411 100644 --- a/docs/source/markdown/.gitignore +++ b/docs/source/markdown/.gitignore @@ -9,6 +9,7 @@ podman-container-runlabel.1.md podman-create.1.md podman-diff.1.md podman-exec.1.md +podman-farm-build.1.md podman-image-sign.1.md podman-image-trust.1.md podman-images.1.md diff --git a/docs/source/markdown/options/add-host.md b/docs/source/markdown/options/add-host.md index 968665d812..6e9f598ca0 100644 --- a/docs/source/markdown/options/add-host.md +++ b/docs/source/markdown/options/add-host.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, create, pod create, run +####> podman build, create, farm build, pod create, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--add-host**=*host:ip* diff --git a/docs/source/markdown/options/annotation.image.md b/docs/source/markdown/options/annotation.image.md new file mode 100644 index 0000000000..13964ec23d --- /dev/null +++ b/docs/source/markdown/options/annotation.image.md @@ -0,0 +1,11 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--annotation**=*annotation=value* + +Add an image *annotation* (e.g. annotation=*value*) to the image metadata. Can +be used multiple times. + +Note: this information is not present in Docker image formats, so it is +discarded when writing images in Docker formats. diff --git a/docs/source/markdown/options/authfile.md b/docs/source/markdown/options/authfile.md index 57416efe91..005573b1a9 100644 --- a/docs/source/markdown/options/authfile.md +++ b/docs/source/markdown/options/authfile.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman auto update, build, container runlabel, create, image sign, kube play, login, logout, manifest add, manifest inspect, manifest push, pull, push, run, search +####> podman auto update, build, container runlabel, create, farm build, image sign, kube play, login, logout, manifest add, manifest inspect, manifest push, pull, push, run, search ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--authfile**=*path* diff --git a/docs/source/markdown/options/build-arg-file.md b/docs/source/markdown/options/build-arg-file.md new file mode 100644 index 0000000000..cdae387776 --- /dev/null +++ b/docs/source/markdown/options/build-arg-file.md @@ -0,0 +1,22 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--build-arg-file**=*path* + +Specifies a file containing lines of build arguments of the form `arg=value`. +The suggested file name is `argfile.conf`. + +Comment lines beginning with `#` are ignored, along with blank lines. +All others must be of the `arg=value` format passed to `--build-arg`. + +If several arguments are provided via the `--build-arg-file` +and `--build-arg` options, the build arguments are merged across all +of the provided files and command line arguments. + +Any file provided in a `--build-arg-file` option is read before +the arguments supplied via the `--build-arg` option. + +When a given argument name is specified several times, the last instance +is the one that is passed to the resulting builds. This means `--build-arg` +values always override those in a `--build-arg-file`. diff --git a/docs/source/markdown/options/build-arg.md b/docs/source/markdown/options/build-arg.md new file mode 100644 index 0000000000..64ee690b90 --- /dev/null +++ b/docs/source/markdown/options/build-arg.md @@ -0,0 +1,8 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--build-arg**=*arg=value* + +Specifies a build argument and its value, which is interpolated in +instructions read from the Containerfiles in the same way that environment variables are, but which are not added to environment variable list in the resulting image's configuration. diff --git a/docs/source/markdown/options/build-context.md b/docs/source/markdown/options/build-context.md new file mode 100644 index 0000000000..a56a468d0d --- /dev/null +++ b/docs/source/markdown/options/build-context.md @@ -0,0 +1,30 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--build-context**=*name=value* + +Specify an additional build context using its short name and its location. +Additional build contexts can be referenced in the same manner as we access +different stages in COPY instruction. + +Valid values are: + +* Local directory – e.g. --build-context project2=../path/to/project2/src (This option is not available with the remote Podman client. On Podman machine setup (i.e macOS and Winows) path must exists on the machine VM) +* HTTP URL to a tarball – e.g. --build-context src=https://example.org/releases/src.tar +* Container image – specified with a container-image:// prefix, e.g. --build-context alpine=container-image://alpine:3.15, (also accepts docker://, docker-image://) + +On the Containerfile side, reference the build context on all +commands that accept the “from” parameter. Here’s how that might look: + +```dockerfile +FROM [name] +COPY --from=[name] ... +RUN --mount=from=[name] … +``` + +The value of [name] is matched with the following priority order: + +* Named build context defined with --build-context [name]=.. +* Stage defined with AS [name] inside Containerfile +* Image [name], either local or in a remote registry diff --git a/docs/source/markdown/options/cache-from.md b/docs/source/markdown/options/cache-from.md new file mode 100644 index 0000000000..d120683421 --- /dev/null +++ b/docs/source/markdown/options/cache-from.md @@ -0,0 +1,21 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--cache-from**=*image* + +Repository to utilize as a potential cache source. When specified, Buildah tries to look for +cache images in the specified repository and attempts to pull cache images instead of actually +executing the build steps locally. Buildah only attempts to pull previously cached images if they +are considered as valid cache hits. + +Use the `--cache-to` option to populate a remote repository with cache content. + +Example + +```bash +# populate a cache and also consult it +buildah build -t test --layers --cache-to registry/myrepo/cache --cache-from registry/myrepo/cache . +``` + +Note: `--cache-from` option is ignored unless `--layers` is specified. diff --git a/docs/source/markdown/options/cache-to.md b/docs/source/markdown/options/cache-to.md new file mode 100644 index 0000000000..521498b64a --- /dev/null +++ b/docs/source/markdown/options/cache-to.md @@ -0,0 +1,19 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--cache-to**=*image* + +Set this flag to specify a remote repository that is used to store cache images. Buildah attempts to +push newly built cache image to the remote repository. + +Note: Use the `--cache-from` option in order to use cache content in a remote repository. + +Example + +```bash +# populate a cache and also consult it +buildah build -t test --layers --cache-to registry/myrepo/cache --cache-from registry/myrepo/cache . +``` + +Note: `--cache-to` option is ignored unless `--layers` is specified. diff --git a/docs/source/markdown/options/cache-ttl.md b/docs/source/markdown/options/cache-ttl.md new file mode 100644 index 0000000000..831cd7bec9 --- /dev/null +++ b/docs/source/markdown/options/cache-ttl.md @@ -0,0 +1,12 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--cache-ttl** + +Limit the use of cached images to only consider images with created timestamps less than *duration* ago. +For example if `--cache-ttl=1h` is specified, Buildah considers intermediate cache images which are created +under the duration of one hour, and intermediate cache images outside this duration is ignored. + +Note: Setting `--cache-ttl=0` manually is equivalent to using `--no-cache` in the +implementation since this means that the user dones not want to use cache at all. diff --git a/docs/source/markdown/options/cap-add.image.md b/docs/source/markdown/options/cap-add.image.md new file mode 100644 index 0000000000..1874f558b8 --- /dev/null +++ b/docs/source/markdown/options/cap-add.image.md @@ -0,0 +1,10 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--cap-add**=*CAP\_xxx* + +When executing RUN instructions, run the command specified in the instruction +with the specified capability added to its capability set. +Certain capabilities are granted by default; this option can be used to add +more. diff --git a/docs/source/markdown/options/cap-drop.image.md b/docs/source/markdown/options/cap-drop.image.md new file mode 100644 index 0000000000..e003bc605c --- /dev/null +++ b/docs/source/markdown/options/cap-drop.image.md @@ -0,0 +1,16 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--cap-drop**=*CAP\_xxx* + +When executing RUN instructions, run the command specified in the instruction +with the specified capability removed from its capability set. +The CAP\_CHOWN, CAP\_DAC\_OVERRIDE, CAP\_FOWNER, +CAP\_FSETID, CAP\_KILL, CAP\_NET\_BIND\_SERVICE, CAP\_SETFCAP, +CAP\_SETGID, CAP\_SETPCAP, and CAP\_SETUID capabilities are +granted by default; this option can be used to remove them. + +If a capability is specified to both the **--cap-add** and **--cap-drop** +options, it is dropped, regardless of the order in which the options were +given. diff --git a/docs/source/markdown/options/cert-dir.md b/docs/source/markdown/options/cert-dir.md index 5fdb8602a5..dbb008a2d0 100644 --- a/docs/source/markdown/options/cert-dir.md +++ b/docs/source/markdown/options/cert-dir.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container runlabel, image sign, kube play, login, manifest add, manifest push, pull, push, search +####> podman build, container runlabel, farm build, image sign, kube play, login, manifest add, manifest push, pull, push, search ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--cert-dir**=*path* diff --git a/docs/source/markdown/options/cgroup-parent.md b/docs/source/markdown/options/cgroup-parent.md index ce9f28fdfb..cb8989f575 100644 --- a/docs/source/markdown/options/cgroup-parent.md +++ b/docs/source/markdown/options/cgroup-parent.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, create, pod clone, pod create, run +####> podman build, create, farm build, pod clone, pod create, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--cgroup-parent**=*path* diff --git a/docs/source/markdown/options/cgroupns.image.md b/docs/source/markdown/options/cgroupns.image.md new file mode 100644 index 0000000000..b4dbaa8646 --- /dev/null +++ b/docs/source/markdown/options/cgroupns.image.md @@ -0,0 +1,10 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--cgroupns**=*how* + +Sets the configuration for cgroup namespaces when handling `RUN` instructions. +The configured value can be "" (the empty string) or "private" to indicate +that a new cgroup namespace is created, or it can be "host" to indicate +that the cgroup namespace in which `buildah` itself is being run is reused. diff --git a/docs/source/markdown/options/cpp-flag.md b/docs/source/markdown/options/cpp-flag.md new file mode 100644 index 0000000000..d6ff25b815 --- /dev/null +++ b/docs/source/markdown/options/cpp-flag.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--cpp-flag**=*flags* + +Set additional flags to pass to the C Preprocessor cpp(1). Containerfiles ending with a ".in" suffix is preprocessed via cpp(1). This option can be used to pass additional flags to cpp.Note: You can also set default CPPFLAGS by setting the BUILDAH_CPPFLAGS environment variable (e.g., export BUILDAH_CPPFLAGS="-DDEBUG"). diff --git a/docs/source/markdown/options/cpu-period.md b/docs/source/markdown/options/cpu-period.md index 6177adf612..8a749db66b 100644 --- a/docs/source/markdown/options/cpu-period.md +++ b/docs/source/markdown/options/cpu-period.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container clone, create, run, update +####> podman build, container clone, create, farm build, run, update ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--cpu-period**=*limit* diff --git a/docs/source/markdown/options/cpu-quota.md b/docs/source/markdown/options/cpu-quota.md index 4875f73625..13629af9c8 100644 --- a/docs/source/markdown/options/cpu-quota.md +++ b/docs/source/markdown/options/cpu-quota.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container clone, create, run, update +####> podman build, container clone, create, farm build, run, update ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--cpu-quota**=*limit* diff --git a/docs/source/markdown/options/cpu-shares.md b/docs/source/markdown/options/cpu-shares.md index e3bec007ee..de2e809bd9 100644 --- a/docs/source/markdown/options/cpu-shares.md +++ b/docs/source/markdown/options/cpu-shares.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container clone, create, pod clone, pod create, run, update +####> podman build, container clone, create, farm build, pod clone, pod create, run, update ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--cpu-shares**, **-c**=*shares* diff --git a/docs/source/markdown/options/cpuset-cpus.md b/docs/source/markdown/options/cpuset-cpus.md index f8e167e4c7..1728a9ab5a 100644 --- a/docs/source/markdown/options/cpuset-cpus.md +++ b/docs/source/markdown/options/cpuset-cpus.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container clone, create, pod clone, pod create, run, update +####> podman build, container clone, create, farm build, pod clone, pod create, run, update ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--cpuset-cpus**=*number* diff --git a/docs/source/markdown/options/cpuset-mems.md b/docs/source/markdown/options/cpuset-mems.md index 751a1a0219..57f37f4caf 100644 --- a/docs/source/markdown/options/cpuset-mems.md +++ b/docs/source/markdown/options/cpuset-mems.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container clone, create, pod clone, pod create, run, update +####> podman build, container clone, create, farm build, pod clone, pod create, run, update ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--cpuset-mems**=*nodes* diff --git a/docs/source/markdown/options/creds.md b/docs/source/markdown/options/creds.md index 313d0e75ff..910895c20e 100644 --- a/docs/source/markdown/options/creds.md +++ b/docs/source/markdown/options/creds.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container runlabel, kube play, manifest add, manifest push, pull, push, search +####> podman build, container runlabel, farm build, kube play, manifest add, manifest push, pull, push, search ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--creds**=*[username[:password]]* diff --git a/docs/source/markdown/options/decryption-key.md b/docs/source/markdown/options/decryption-key.md index 0fe8527a87..67d6535086 100644 --- a/docs/source/markdown/options/decryption-key.md +++ b/docs/source/markdown/options/decryption-key.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman create, pull, run +####> podman build, create, farm build, pull, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--decryption-key**=*key[:passphrase]* diff --git a/docs/source/markdown/options/device.md b/docs/source/markdown/options/device.md index 3209f3e0ae..8875645b93 100644 --- a/docs/source/markdown/options/device.md +++ b/docs/source/markdown/options/device.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, create, pod clone, pod create, run +####> podman build, create, farm build, pod clone, pod create, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--device**=*host-device[:container-device][:permissions]* diff --git a/docs/source/markdown/options/disable-compression.md b/docs/source/markdown/options/disable-compression.md new file mode 100644 index 0000000000..c039259df8 --- /dev/null +++ b/docs/source/markdown/options/disable-compression.md @@ -0,0 +1,12 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--disable-compression**, **-D** + +Don't compress filesystem layers when building the image unless it is required +by the location where the image is being written. This is the default setting, +because image layers are compressed automatically when they are pushed to +registries, and images being written to local storage only need to be +decompressed again to be stored. Compression can be forced in all cases by +specifying **--disable-compression=false**. diff --git a/docs/source/markdown/options/dns-option.image.md b/docs/source/markdown/options/dns-option.image.md new file mode 100644 index 0000000000..345efd47c4 --- /dev/null +++ b/docs/source/markdown/options/dns-option.image.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--dns-option**=*option* + +Set custom DNS options to be used during the build. diff --git a/docs/source/markdown/options/dns-search.image.md b/docs/source/markdown/options/dns-search.image.md new file mode 100644 index 0000000000..5e75afde53 --- /dev/null +++ b/docs/source/markdown/options/dns-search.image.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--dns-search**=*domain* + +Set custom DNS search domains to be used during the build. diff --git a/docs/source/markdown/options/dns.md b/docs/source/markdown/options/dns.md index 1d016a3b53..ece952fc87 100644 --- a/docs/source/markdown/options/dns.md +++ b/docs/source/markdown/options/dns.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, create, run +####> podman build, create, farm build, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--dns**=*ipaddr* diff --git a/docs/source/markdown/options/env.image.md b/docs/source/markdown/options/env.image.md new file mode 100644 index 0000000000..d214291d53 --- /dev/null +++ b/docs/source/markdown/options/env.image.md @@ -0,0 +1,11 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--env**=*env[=value]* + +Add a value (e.g. env=*value*) to the built image. Can be used multiple times. +If neither `=` nor a *value* are specified, but *env* is set in the current +environment, the value from the current environment is added to the image. +To remove an environment variable from the built image, use the `--unsetenv` +option. diff --git a/docs/source/markdown/options/farm.md b/docs/source/markdown/options/farm.md new file mode 100644 index 0000000000..8ba605d0f7 --- /dev/null +++ b/docs/source/markdown/options/farm.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--farm** + +This option specifies the name of the farm to be used in the build process. diff --git a/docs/source/markdown/options/file.md b/docs/source/markdown/options/file.md new file mode 100644 index 0000000000..60c3aea5ad --- /dev/null +++ b/docs/source/markdown/options/file.md @@ -0,0 +1,16 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--file**, **-f**=*Containerfile* + +Specifies a Containerfile which contains instructions for building the image, +either a local file or an **http** or **https** URL. If more than one +Containerfile is specified, *FROM* instructions are only be accepted from the +last specified file. + +If a build context is not specified, and at least one Containerfile is a +local file, the directory in which it resides is used as the build +context. + +Specifying the option `-f -` causes the Containerfile contents to be read from stdin. diff --git a/docs/source/markdown/options/force-rm.md b/docs/source/markdown/options/force-rm.md new file mode 100644 index 0000000000..5af1f5a8af --- /dev/null +++ b/docs/source/markdown/options/force-rm.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--force-rm** + +Always remove intermediate containers after a build, even if the build fails (default true). diff --git a/docs/source/markdown/options/format.md b/docs/source/markdown/options/format.md new file mode 100644 index 0000000000..c864ef71f8 --- /dev/null +++ b/docs/source/markdown/options/format.md @@ -0,0 +1,12 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--format** + +Control the format for the built image's manifest and configuration data. +Recognized formats include *oci* (OCI image-spec v1.0, the default) and +*docker* (version 2, using schema format 2 for the manifest). + +Note: You can also override the default format by setting the BUILDAH\_FORMAT +environment variable. `export BUILDAH_FORMAT=docker` diff --git a/docs/source/markdown/options/from.md b/docs/source/markdown/options/from.md new file mode 100644 index 0000000000..d5d058537b --- /dev/null +++ b/docs/source/markdown/options/from.md @@ -0,0 +1,13 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--from** + +Overrides the first `FROM` instruction within the Containerfile. If there are multiple +FROM instructions in a Containerfile, only the first is changed. + +With the remote podman client, not all container transports work as +expected. For example, oci-archive:/x.tar references /x.tar on the remote +machine instead of on the client. When using podman remote clients it is +best to restrict use to *containers-storage*, and *docker:// transports*. diff --git a/docs/source/markdown/options/group-add.md b/docs/source/markdown/options/group-add.md index 4640e88ea3..dadb8b4f1c 100644 --- a/docs/source/markdown/options/group-add.md +++ b/docs/source/markdown/options/group-add.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman create, run +####> podman build, create, farm build, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--group-add**=*group* | *keep-groups* diff --git a/docs/source/markdown/options/help.md b/docs/source/markdown/options/help.md new file mode 100644 index 0000000000..a9a8e3aa2b --- /dev/null +++ b/docs/source/markdown/options/help.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--help**, **-h** + +Print usage statement diff --git a/docs/source/markdown/options/hooks-dir.md b/docs/source/markdown/options/hooks-dir.md new file mode 100644 index 0000000000..2149aed431 --- /dev/null +++ b/docs/source/markdown/options/hooks-dir.md @@ -0,0 +1,15 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--hooks-dir**=*path* + +Each *.json file in the path configures a hook for buildah build containers. For more details on the syntax of the JSON files and the semantics of hook injection. Buildah currently support both the 1.0.0 and 0.1.0 hook schemas, although the 0.1.0 schema is deprecated. + +This option may be set multiple times; paths from later options have higher precedence. + +For the annotation conditions, buildah uses any annotations set in the generated OCI configuration. + +For the bind-mount conditions, only mounts explicitly requested by the caller via --volume are considered. Bind mounts that buildah inserts by default (e.g. /dev/shm) are not considered. + +If --hooks-dir is unset for root callers, Buildah currently defaults to /usr/share/containers/oci/hooks.d and /etc/containers/oci/hooks.d in order of increasing precedence. Using these defaults is deprecated. Migrate to explicitly setting --hooks-dir. diff --git a/docs/source/markdown/options/http-proxy.md b/docs/source/markdown/options/http-proxy.md index 8bfbbcdca1..ac15af4382 100644 --- a/docs/source/markdown/options/http-proxy.md +++ b/docs/source/markdown/options/http-proxy.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, create, run +####> podman build, create, farm build, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--http-proxy** diff --git a/docs/source/markdown/options/identity-label.md b/docs/source/markdown/options/identity-label.md new file mode 100644 index 0000000000..5408ce3ec5 --- /dev/null +++ b/docs/source/markdown/options/identity-label.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--identity-label** + +Adds default identity label `io.buildah.version` if set. (default true). diff --git a/docs/source/markdown/options/ignorefile.md b/docs/source/markdown/options/ignorefile.md new file mode 100644 index 0000000000..cf37ca5449 --- /dev/null +++ b/docs/source/markdown/options/ignorefile.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--ignorefile** + +Path to an alternative .containerignore file. diff --git a/docs/source/markdown/options/iidfile.md b/docs/source/markdown/options/iidfile.md new file mode 100644 index 0000000000..57d516c201 --- /dev/null +++ b/docs/source/markdown/options/iidfile.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--iidfile**=*ImageIDfile* + +Write the built image's ID to the file. When `--platform` is specified more than once, attempting to use this option triggers an error. diff --git a/docs/source/markdown/options/ipc.image.md b/docs/source/markdown/options/ipc.image.md new file mode 100644 index 0000000000..6b389b70a1 --- /dev/null +++ b/docs/source/markdown/options/ipc.image.md @@ -0,0 +1,12 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--ipc**=*how* + +Sets the configuration for IPC namespaces when handling `RUN` instructions. +The configured value can be "" (the empty string) or "container" to indicate +that a new IPC namespace is created, or it can be "host" to indicate +that the IPC namespace in which `podman` itself is being run is reused, +or it can be the path to an IPC namespace which is already in use by +another process. diff --git a/docs/source/markdown/options/isolation.md b/docs/source/markdown/options/isolation.md new file mode 100644 index 0000000000..e4641967df --- /dev/null +++ b/docs/source/markdown/options/isolation.md @@ -0,0 +1,17 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--isolation**=*type* + +Controls what type of isolation is used for running processes as part of `RUN` +instructions. Recognized types include *oci* (OCI-compatible runtime, the +default), *rootless* (OCI-compatible runtime invoked using a modified +configuration and its --rootless option enabled, with *--no-new-keyring +--no-pivot* added to its *create* invocation, with network and UTS namespaces +disabled, and IPC, PID, and user namespaces enabled; the default for +unprivileged users), and *chroot* (an internal wrapper that leans more toward +chroot(1) than container technology). + +Note: You can also override the default isolation type by setting the +BUILDAH\_ISOLATION environment variable. `export BUILDAH_ISOLATION=oci` diff --git a/docs/source/markdown/options/jobs.md b/docs/source/markdown/options/jobs.md new file mode 100644 index 0000000000..ec9c7e0203 --- /dev/null +++ b/docs/source/markdown/options/jobs.md @@ -0,0 +1,9 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--jobs**=*number* + +Run up to N concurrent stages in parallel. If the number of jobs is greater +than 1, stdin is read from /dev/null. If 0 is specified, then there is +no limit in the number of jobs that run in parallel. diff --git a/docs/source/markdown/options/label.image.md b/docs/source/markdown/options/label.image.md new file mode 100644 index 0000000000..d119c43625 --- /dev/null +++ b/docs/source/markdown/options/label.image.md @@ -0,0 +1,18 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--label**=*label* + +Add an image *label* (e.g. label=*value*) to the image metadata. Can be used +multiple times. + +Users can set a special LABEL **io.containers.capabilities=CAP1,CAP2,CAP3** in +a Containerfile that specifies the list of Linux capabilities required for the +container to run properly. This label specified in a container image tells +Podman to run the container with just these capabilities. Podman launches the +container with just the specified capabilities, as long as this list of +capabilities is a subset of the default list. + +If the specified capabilities are not in the default set, Podman prints an error +message and runs the container with the default capabilities. diff --git a/docs/source/markdown/options/layer-label.md b/docs/source/markdown/options/layer-label.md new file mode 100644 index 0000000000..5d66d97c92 --- /dev/null +++ b/docs/source/markdown/options/layer-label.md @@ -0,0 +1,11 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--layer-label**=*label[=value]* + +Add an intermediate image *label* (e.g. label=*value*) to the intermediate +image metadata. It can be used multiple times. + +If *label* is named, but neither `=` nor a `value` is provided, then +the *label* is set to an empty value. diff --git a/docs/source/markdown/options/layers.md b/docs/source/markdown/options/layers.md new file mode 100644 index 0000000000..1abe50f068 --- /dev/null +++ b/docs/source/markdown/options/layers.md @@ -0,0 +1,10 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--layers** + +Cache intermediate images during the build process (Default is `true`). + +Note: You can also override the default value of layers by setting the +BUILDAH\_LAYERS environment variable. `export BUILDAH_LAYERS=true` diff --git a/docs/source/markdown/options/logfile.md b/docs/source/markdown/options/logfile.md new file mode 100644 index 0000000000..fa5e743124 --- /dev/null +++ b/docs/source/markdown/options/logfile.md @@ -0,0 +1,9 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--logfile**=*filename* + +Log output which is sent to standard output and standard error to the +specified file instead of to standard output and standard error. +This option is not supported on the remote client, including Mac and Windows (excluding WSL2) machines. diff --git a/docs/source/markdown/options/manifest.md b/docs/source/markdown/options/manifest.md new file mode 100644 index 0000000000..86a0982a6f --- /dev/null +++ b/docs/source/markdown/options/manifest.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--manifest**=*manifest* + +Name of the manifest list to which the image is added. Creates the manifest list if it does not exist. This option is useful for building multi architecture images. diff --git a/docs/source/markdown/options/memory-swap.md b/docs/source/markdown/options/memory-swap.md index ecfb5c96f8..1bf8542fbb 100644 --- a/docs/source/markdown/options/memory-swap.md +++ b/docs/source/markdown/options/memory-swap.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container clone, create, pod clone, pod create, run, update +####> podman build, container clone, create, farm build, pod clone, pod create, run, update ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--memory-swap**=*number[unit]* diff --git a/docs/source/markdown/options/memory.md b/docs/source/markdown/options/memory.md index 3d1a4b7762..dd53d8d8e6 100644 --- a/docs/source/markdown/options/memory.md +++ b/docs/source/markdown/options/memory.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, container clone, create, pod clone, pod create, run, update +####> podman build, container clone, create, farm build, pod clone, pod create, run, update ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--memory**, **-m**=*number[unit]* diff --git a/docs/source/markdown/options/network.image.md b/docs/source/markdown/options/network.image.md new file mode 100644 index 0000000000..9184c784fa --- /dev/null +++ b/docs/source/markdown/options/network.image.md @@ -0,0 +1,63 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--network**=*mode*, **--net** + +Sets the configuration for network namespaces when handling `RUN` instructions. + +Valid _mode_ values are: + +- **none**: no networking. +- **host**: use the Podman host network stack. Note: the host mode gives the +container full access to local system services such as D-bus and is therefore +considered insecure. +- **ns:**_path_: path to a network namespace to join. +- **private**: create a new namespace for the container (default) +- **\**: Join the network with the given name or ID, e.g. use `--network mynet` to join the network with the name mynet. Only supported for rootful users. +- **slirp4netns[:OPTIONS,...]**: use **slirp4netns**(1) to create a user network stack. This is the default for rootless containers. It is possible to specify these additional options, they can also be set with `network_cmd_options` in containers.conf: + - **allow_host_loopback=true|false**: Allow slirp4netns to reach the host loopback IP (default is 10.0.2.2 or the second IP from slirp4netns cidr subnet when changed, see the cidr option below). The default is false. + - **mtu=MTU**: Specify the MTU to use for this network. (Default is `65520`). + - **cidr=CIDR**: Specify ip range to use for this network. (Default is `10.0.2.0/24`). + - **enable_ipv6=true|false**: Enable IPv6. Default is true. (Required for `outbound_addr6`). + - **outbound_addr=INTERFACE**: Specify the outbound interface slirp binds to (ipv4 traffic only). + - **outbound_addr=IPv4**: Specify the outbound ipv4 address slirp binds to. + - **outbound_addr6=INTERFACE**: Specify the outbound interface slirp binds to (ipv6 traffic only). + - **outbound_addr6=IPv6**: Specify the outbound ipv6 address slirp binds to. +- **pasta[:OPTIONS,...]**: use **pasta**(1) to create a user-mode networking + stack. \ + This is only supported in rootless mode. \ + By default, IPv4 and IPv6 addresses and routes, as well as the pod interface + name, are copied from the host. If port forwarding isn't configured, ports + are forwarded dynamically as services are bound on either side (init + namespace or container namespace). Port forwarding preserves the original + source IP address. Options described in pasta(1) can be specified as + comma-separated arguments. \ + In terms of pasta(1) options, **--config-net** is given by default, in + order to configure networking when the container is started, and + **--no-map-gw** is also assumed by default, to avoid direct access from + container to host using the gateway address. The latter can be overridden + by passing **--map-gw** in the pasta-specific options (despite not being an + actual pasta(1) option). \ + Also, **-t none** and **-u none** are passed to disable + automatic port forwarding based on bound ports. Similarly, **-T none** and + **-U none** are given to disable the same functionality from container to + host. \ + Some examples: + - **pasta:--map-gw**: Allow the container to directly reach the host using the + gateway address. + - **pasta:--mtu,1500**: Specify a 1500 bytes MTU for the _tap_ interface in + the container. + - **pasta:--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,-m,1500,--no-ndp,--no-dhcpv6,--no-dhcp**, + equivalent to default slirp4netns(1) options: disable IPv6, assign + `10.0.2.0/24` to the `tap0` interface in the container, with gateway + `10.0.2.3`, enable DNS forwarder reachable at `10.0.2.3`, set MTU to 1500 + bytes, disable NDP, DHCPv6 and DHCP support. + - **pasta:-I,tap0,--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,--no-ndp,--no-dhcpv6,--no-dhcp**, + equivalent to default slirp4netns(1) options with Podman overrides: same as + above, but leave the MTU to 65520 bytes + - **pasta:-t,auto,-u,auto,-T,auto,-U,auto**: enable automatic port forwarding + based on observed bound ports from both host and container sides + - **pasta:-T,5201**: enable forwarding of TCP port 5201 from container to + host, using the loopback interface instead of the tap interface for improved + performance diff --git a/docs/source/markdown/options/no-cache.md b/docs/source/markdown/options/no-cache.md new file mode 100644 index 0000000000..e1771866b7 --- /dev/null +++ b/docs/source/markdown/options/no-cache.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--no-cache** + +Do not use existing cached images for the container build. Build from the start with a new set of cached layers. diff --git a/docs/source/markdown/options/no-hostname.md b/docs/source/markdown/options/no-hostname.md new file mode 100644 index 0000000000..1cb4d8dfb6 --- /dev/null +++ b/docs/source/markdown/options/no-hostname.md @@ -0,0 +1,9 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--no-hostname** + +Do not create the _/etc/hostname_ file in the container for RUN instructions. + +By default, Buildah manages the _/etc/hostname_ file, adding the container's own hostname. When the **--no-hostname** option is set, the image's _/etc/hostname_ will be preserved unmodified if it exists. diff --git a/docs/source/markdown/options/no-hosts.md b/docs/source/markdown/options/no-hosts.md index 68eace9c88..9ed32be7a5 100644 --- a/docs/source/markdown/options/no-hosts.md +++ b/docs/source/markdown/options/no-hosts.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, create, kube play, pod create, run +####> podman build, create, farm build, kube play, pod create, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--no-hosts** diff --git a/docs/source/markdown/options/omit-history.md b/docs/source/markdown/options/omit-history.md new file mode 100644 index 0000000000..2446e147b3 --- /dev/null +++ b/docs/source/markdown/options/omit-history.md @@ -0,0 +1,12 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--omit-history** + +Omit build history information in the built image. (default false). + +This option is useful for the cases where end users explicitly +want to set `--omit-history` to omit the optional `History` from +built images or when working with images built using build tools that +do not include `History` information in their images. diff --git a/docs/source/markdown/options/os-feature.md b/docs/source/markdown/options/os-feature.md new file mode 100644 index 0000000000..5d87e1759b --- /dev/null +++ b/docs/source/markdown/options/os-feature.md @@ -0,0 +1,9 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--os-feature**=*feature* + +Set the name of a required operating system *feature* for the image which is built. By default, if the image is not based on *scratch*, the base image's required OS feature list is kept, if the base image specified any. This option is typically only meaningful when the image's OS is Windows. + +If *feature* has a trailing `-`, then the *feature* is removed from the set of required features which is listed in the image. diff --git a/docs/source/markdown/options/os-version.image.md b/docs/source/markdown/options/os-version.image.md new file mode 100644 index 0000000000..a63f059875 --- /dev/null +++ b/docs/source/markdown/options/os-version.image.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--os-version**=*version* + +Set the exact required operating system *version* for the image which is built. By default, if the image is not based on *scratch*, the base image's required OS version is kept, if the base image specified one. This option is typically only meaningful when the image's OS is Windows, and is typically set in Windows base images, so using this option is usually unnecessary. diff --git a/docs/source/markdown/options/os.md b/docs/source/markdown/options/os.md new file mode 100644 index 0000000000..ff388f5826 --- /dev/null +++ b/docs/source/markdown/options/os.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--os**=*string* + +Set the OS of the image to be built, and that of the base image to be pulled, if the build uses one, instead of using the current operating system of the build host. Unless overridden, subsequent lookups of the same image in the local storage matches this OS, regardless of the host. diff --git a/docs/source/markdown/options/pid.image.md b/docs/source/markdown/options/pid.image.md new file mode 100644 index 0000000000..085f2b5a92 --- /dev/null +++ b/docs/source/markdown/options/pid.image.md @@ -0,0 +1,9 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--pid**=*pid* + +Sets the configuration for PID namespaces when handling `RUN` instructions. +The configured value can be "" (the empty string) or "container" to indicate that a new PID namespace is created, or it can be "host" to indicate that the PID namespace in which `podman` itself is being run is reused, or it can be the path to a PID namespace which is already in use by another +process. diff --git a/docs/source/markdown/options/pull.image.md b/docs/source/markdown/options/pull.image.md new file mode 100644 index 0000000000..0b0a6ccfda --- /dev/null +++ b/docs/source/markdown/options/pull.image.md @@ -0,0 +1,12 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--pull**=*policy* + +Pull image policy. The default is **always**. + +- **always**, **true**: Always pull the image and throw an error if the pull fails. +- **missing**: Only pull the image when it does not exist in the local containers storage. Throw an error if no image is found and the pull fails. +- **never**, **false**: Never pull the image but use the one from the local containers storage. Throw an error when no image is found. +- **newer**: Pull if the image on the registry is newer than the one in the local containers storage. An image is considered to be newer when the digests are different. Comparing the time stamps is prone to errors. Pull errors are suppressed if a local image was found. diff --git a/docs/source/markdown/options/quiet.md b/docs/source/markdown/options/quiet.md new file mode 100644 index 0000000000..73ecf7adfc --- /dev/null +++ b/docs/source/markdown/options/quiet.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--quiet**, **-q** + +Suppress output messages which indicate which instruction is being processed, and of progress when pulling images from a registry, and when writing the output image. diff --git a/docs/source/markdown/options/retry-delay.md b/docs/source/markdown/options/retry-delay.md new file mode 100644 index 0000000000..8271f4d6a8 --- /dev/null +++ b/docs/source/markdown/options/retry-delay.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--retry-delay**=*duration* + +Duration of delay between retry attempts in case of failure when performing pull of images from registry. Default is **2s**. diff --git a/docs/source/markdown/options/retry.md b/docs/source/markdown/options/retry.md new file mode 100644 index 0000000000..fd13b6e4e1 --- /dev/null +++ b/docs/source/markdown/options/retry.md @@ -0,0 +1,8 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--retry**=*attempts* + +Number of times to retry in case of failure when performing pull of +images from registry. Default is **3**. diff --git a/docs/source/markdown/options/rm.md b/docs/source/markdown/options/rm.md new file mode 100644 index 0000000000..432c2e50ac --- /dev/null +++ b/docs/source/markdown/options/rm.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--rm** + +Remove intermediate containers after a successful build (default true). diff --git a/docs/source/markdown/options/runtime-flag.md b/docs/source/markdown/options/runtime-flag.md new file mode 100644 index 0000000000..6d14f6c68d --- /dev/null +++ b/docs/source/markdown/options/runtime-flag.md @@ -0,0 +1,9 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--runtime-flag**=*flag* + +Adds global flags for the container rutime. To list the supported flags, please consult the manpages of the selected container runtime. + +Note: Do not pass the leading -- to the flag. To pass the runc flag --log-format json to buildah build, the option given is --runtime-flag log-format=json. diff --git a/docs/source/markdown/options/runtime.md b/docs/source/markdown/options/runtime.md new file mode 100644 index 0000000000..2371af7013 --- /dev/null +++ b/docs/source/markdown/options/runtime.md @@ -0,0 +1,10 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--runtime**=*path* + +The *path* to an alternate OCI-compatible runtime, which is used to run +commands specified by the **RUN** instruction. + +Note: You can also override the default runtime by setting the BUILDAH\_RUNTIME environment variable. `export BUILDAH_RUNTIME=/usr/local/bin/runc` diff --git a/docs/source/markdown/options/secret.image.md b/docs/source/markdown/options/secret.image.md new file mode 100644 index 0000000000..a8267801d7 --- /dev/null +++ b/docs/source/markdown/options/secret.image.md @@ -0,0 +1,13 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--secret**=**id=id,src=path** + +Pass secret information used in the Containerfile for building images +in a safe way that are not stored in the final image, or be seen in other stages. +The secret is mounted in the container at the default location of `/run/secrets/id`. + +To later use the secret, use the --mount option in a `RUN` instruction within a `Containerfile`: + +`RUN --mount=type=secret,id=mysecret cat /run/secrets/mysecret` diff --git a/docs/source/markdown/options/security-opt.image.md b/docs/source/markdown/options/security-opt.image.md new file mode 100644 index 0000000000..05d0e47d6e --- /dev/null +++ b/docs/source/markdown/options/security-opt.image.md @@ -0,0 +1,22 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--security-opt**=*option* + +Security Options + +- `apparmor=unconfined` : Turn off apparmor confinement for the container +- `apparmor=alternate-profile` : Set the apparmor confinement profile for the +container + +- `label=user:USER` : Set the label user for the container processes +- `label=role:ROLE` : Set the label role for the container processes +- `label=type:TYPE` : Set the label process type for the container processes +- `label=level:LEVEL` : Set the label level for the container processes +- `label=filetype:TYPE` : Set the label file type for the container files +- `label=disable` : Turn off label separation for the container +- `no-new-privileges` : Not supported + +- `seccomp=unconfined` : Turn off seccomp confinement for the container +- `seccomp=profile.json` : White listed syscalls seccomp Json file to be used as a seccomp filter diff --git a/docs/source/markdown/options/shm-size.md b/docs/source/markdown/options/shm-size.md index 381a123819..0f51a3f193 100644 --- a/docs/source/markdown/options/shm-size.md +++ b/docs/source/markdown/options/shm-size.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman build, create, pod clone, pod create, run +####> podman build, create, farm build, pod clone, pod create, run ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--shm-size**=*number[unit]* diff --git a/docs/source/markdown/options/skip-unused-stages.md b/docs/source/markdown/options/skip-unused-stages.md new file mode 100644 index 0000000000..980d889d72 --- /dev/null +++ b/docs/source/markdown/options/skip-unused-stages.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--skip-unused-stages** + +Skip stages in multi-stage builds which don't affect the target stage. (Default: **true**). diff --git a/docs/source/markdown/options/squash-all.md b/docs/source/markdown/options/squash-all.md new file mode 100644 index 0000000000..dea7777616 --- /dev/null +++ b/docs/source/markdown/options/squash-all.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--squash-all** + +Squash all of the new image's layers (including those inherited from a base image) into a single new layer. diff --git a/docs/source/markdown/options/squash.md b/docs/source/markdown/options/squash.md new file mode 100644 index 0000000000..e072fc42ae --- /dev/null +++ b/docs/source/markdown/options/squash.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--squash** + +Squash all of the image's new layers into a single new layer; any preexisting layers are not squashed. diff --git a/docs/source/markdown/options/ssh.md b/docs/source/markdown/options/ssh.md new file mode 100644 index 0000000000..0cd03c8b9e --- /dev/null +++ b/docs/source/markdown/options/ssh.md @@ -0,0 +1,12 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--ssh**=*default* | *id[=socket>* + +SSH agent socket or keys to expose to the build. +The socket path can be left empty to use the value of `default=$SSH_AUTH_SOCK` + +To later use the ssh agent, use the --mount option in a `RUN` instruction within a `Containerfile`: + +`RUN --mount=type=ssh,id=id mycmd` diff --git a/docs/source/markdown/options/tag.md b/docs/source/markdown/options/tag.md new file mode 100644 index 0000000000..63a24e59a5 --- /dev/null +++ b/docs/source/markdown/options/tag.md @@ -0,0 +1,8 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--tag**, **-t**=*imageName* + +Specifies the name which is assigned to the resulting image if the build process completes successfully. +If _imageName_ does not include a registry name, the registry name *localhost* is prepended to the image name. diff --git a/docs/source/markdown/options/target.md b/docs/source/markdown/options/target.md new file mode 100644 index 0000000000..5c5646a915 --- /dev/null +++ b/docs/source/markdown/options/target.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--target**=*stageName* + +Set the target build stage to build. When building a Containerfile with multiple build stages, --target can be used to specify an intermediate build stage by name as the final stage for the resulting image. Commands after the target stage is skipped. diff --git a/docs/source/markdown/options/timestamp.md b/docs/source/markdown/options/timestamp.md new file mode 100644 index 0000000000..f72cb818f6 --- /dev/null +++ b/docs/source/markdown/options/timestamp.md @@ -0,0 +1,10 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--timestamp**=*seconds* + +Set the create timestamp to seconds since epoch to allow for deterministic builds (defaults to current time). By default, the created timestamp is changed and written into the image manifest with every commit, causing the image's sha256 hash to be different even if the sources are exactly the same otherwise. +When --timestamp is set, the created timestamp is always set to the time specified and therefore not changed, allowing the image's sha256 hash to remain the same. All files committed to the layers of the image is created with the timestamp. + +If the only instruction in a Containerfile is `FROM`, this flag has no effect. diff --git a/docs/source/markdown/options/tls-verify.md b/docs/source/markdown/options/tls-verify.md index 13c2a6e634..62f1e3609c 100644 --- a/docs/source/markdown/options/tls-verify.md +++ b/docs/source/markdown/options/tls-verify.md @@ -1,5 +1,5 @@ ####> This option file is used in: -####> podman auto update, build, container runlabel, create, kube play, login, manifest add, manifest create, manifest inspect, manifest push, pull, push, run, search +####> podman auto update, build, container runlabel, create, farm build, kube play, login, manifest add, manifest create, manifest inspect, manifest push, pull, push, run, search ####> If file is edited, make sure the changes ####> are applicable to all of those. #### **--tls-verify** diff --git a/docs/source/markdown/options/ulimit.image.md b/docs/source/markdown/options/ulimit.image.md new file mode 100644 index 0000000000..a5a6ed0bc0 --- /dev/null +++ b/docs/source/markdown/options/ulimit.image.md @@ -0,0 +1,22 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--ulimit**=*type=soft-limit[:hard-limit]* + +Specifies resource limits to apply to processes launched when processing `RUN` instructions. This option can be specified multiple times. Recognized resource types include: + "core": maximum core dump size (ulimit -c) + "cpu": maximum CPU time (ulimit -t) + "data": maximum size of a process's data segment (ulimit -d) + "fsize": maximum size of new files (ulimit -f) + "locks": maximum number of file locks (ulimit -x) + "memlock": maximum amount of locked memory (ulimit -l) + "msgqueue": maximum amount of data in message queues (ulimit -q) + "nice": niceness adjustment (nice -n, ulimit -e) + "nofile": maximum number of open files (ulimit -n) + "nproc": maximum number of processes (ulimit -u) + "rss": maximum size of a process's (ulimit -m) + "rtprio": maximum real-time scheduling priority (ulimit -r) + "rttime": maximum amount of real-time execution between blocking syscalls + "sigpending": maximum number of pending signals (ulimit -i) + "stack": maximum stack size (ulimit -s) diff --git a/docs/source/markdown/options/unsetenv.image.md b/docs/source/markdown/options/unsetenv.image.md new file mode 100644 index 0000000000..5a8d9014a9 --- /dev/null +++ b/docs/source/markdown/options/unsetenv.image.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--unsetenv**=*env* + +Unset environment variables from the final image. diff --git a/docs/source/markdown/options/unsetlabel.md b/docs/source/markdown/options/unsetlabel.md new file mode 100644 index 0000000000..8288d837c0 --- /dev/null +++ b/docs/source/markdown/options/unsetlabel.md @@ -0,0 +1,7 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--unsetlabel**=*label* + +Unset the image label, causing the label not to be inherited from the base image. diff --git a/docs/source/markdown/options/userns-gid-map-group.md b/docs/source/markdown/options/userns-gid-map-group.md new file mode 100644 index 0000000000..bd987ba064 --- /dev/null +++ b/docs/source/markdown/options/userns-gid-map-group.md @@ -0,0 +1,14 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--userns-gid-map-group**=*group* + +Specifies that a GID mapping to be used to set ownership, at the +filesystem level, on the working container's contents, can be found in entries in the `/etc/subgid` file which correspond to the specified group. +Commands run when handling `RUN` instructions defaults to being run in +their own user namespaces, configured using the UID and GID maps. +If --userns-uid-map-user is specified, but --userns-gid-map-group is not specified, `podman` assumes that the specified user name is also a +suitable group name to use as the default setting for this option. + +**NOTE:** When this option is specified by a rootless user, the specified mappings are relative to the rootless user namespace in the container, rather than being relative to the host as it is when run rootful. diff --git a/docs/source/markdown/options/userns-gid-map.md b/docs/source/markdown/options/userns-gid-map.md new file mode 100644 index 0000000000..88ffbcc930 --- /dev/null +++ b/docs/source/markdown/options/userns-gid-map.md @@ -0,0 +1,19 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--userns-gid-map**=*mapping* + +Directly specifies a GID mapping to be used to set ownership, at the +filesystem level, on the working container's contents. +Commands run when handling `RUN` instructions defaults to being run in +their own user namespaces, configured using the UID and GID maps. + +Entries in this map take the form of one or more triples of a starting +in-container GID, a corresponding starting host-level GID, and the number of consecutive IDs which the map entry represents. + +This option overrides the *remap-gids* setting in the *options* section of /etc/containers/storage.conf. + +If this option is not specified, but a global --userns-gid-map setting is supplied, settings from the global option is used. + +If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-gid-map are specified, but --userns-uid-map is specified, the GID map is set to use the same numeric values as the UID map. diff --git a/docs/source/markdown/options/userns-uid-map-user.md b/docs/source/markdown/options/userns-uid-map-user.md new file mode 100644 index 0000000000..271a2cc56d --- /dev/null +++ b/docs/source/markdown/options/userns-uid-map-user.md @@ -0,0 +1,14 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--userns-uid-map-user**=*user* + +Specifies that a UID mapping to be used to set ownership, at the +filesystem level, on the working container's contents, can be found in entries in the `/etc/subuid` file which correspond to the specified user. +Commands run when handling `RUN` instructions defaults to being run in +their own user namespaces, configured using the UID and GID maps. +If --userns-gid-map-group is specified, but --userns-uid-map-user is not specified, `podman` assumes that the specified group name is also a +suitable user name to use as the default setting for this option. + +**NOTE:** When this option is specified by a rootless user, the specified mappings are relative to the rootless user namespace in the container, rather than being relative to the host as it is when run rootful. diff --git a/docs/source/markdown/options/userns-uid-map.md b/docs/source/markdown/options/userns-uid-map.md new file mode 100644 index 0000000000..7489453943 --- /dev/null +++ b/docs/source/markdown/options/userns-uid-map.md @@ -0,0 +1,19 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--userns-uid-map**=*mapping* + +Directly specifies a UID mapping to be used to set ownership, at the +filesystem level, on the working container's contents. +Commands run when handling `RUN` instructions default to being run in +their own user namespaces, configured using the UID and GID maps. + +Entries in this map take the form of one or more triples of a starting +in-container UID, a corresponding starting host-level UID, and the number of consecutive IDs which the map entry represents. + +This option overrides the *remap-uids* setting in the *options* section of /etc/containers/storage.conf. + +If this option is not specified, but a global --userns-uid-map setting is supplied, settings from the global option is used. + +If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-uid-map are specified, but --userns-gid-map is specified, the UID map is set to use the same numeric values as the GID map. diff --git a/docs/source/markdown/options/userns.image.md b/docs/source/markdown/options/userns.image.md new file mode 100644 index 0000000000..48d428e709 --- /dev/null +++ b/docs/source/markdown/options/userns.image.md @@ -0,0 +1,8 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--userns**=*how* + +Sets the configuration for user namespaces when handling `RUN` instructions. +The configured value can be "" (the empty string) or "container" to indicate that a new user namespace is created, it can be "host" to indicate that the user namespace in which `podman` itself is being run is reused, or it can be the path to a user namespace which is already in use by another process. diff --git a/docs/source/markdown/options/uts.md b/docs/source/markdown/options/uts.md new file mode 100644 index 0000000000..dc2cb58913 --- /dev/null +++ b/docs/source/markdown/options/uts.md @@ -0,0 +1,8 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--uts**=*how* + +Sets the configuration for UTS namespaces when handling `RUN` instructions. +The configured value can be "" (the empty string) or "container" to indicate that a new UTS namespace to be created, or it can be "host" to indicate that the UTS namespace in which `podman` itself is being run is reused, or it can be the path to a UTS namespace which is already in use by another process. diff --git a/docs/source/markdown/options/volume.image.md b/docs/source/markdown/options/volume.image.md new file mode 100644 index 0000000000..7549b47ea3 --- /dev/null +++ b/docs/source/markdown/options/volume.image.md @@ -0,0 +1,124 @@ +####> This option file is used in: +####> podman build, farm build +####> If file is edited, make sure the changes +####> are applicable to all of those. +#### **--volume**, **-v**=*[HOST-DIR:CONTAINER-DIR[:OPTIONS]]* + +Create a bind mount. Specifying the `-v /HOST-DIR:/CONTAINER-DIR` option, Podman +bind mounts `/HOST-DIR` from the host to `/CONTAINER-DIR` in the Podman +container. + +The `OPTIONS` are a comma-separated list and can be: [[1]](#Footnote1) + + * [rw|ro] + * [z|Z|O] + * [U] + * [`[r]shared`|`[r]slave`|`[r]private`] + +The `CONTAINER-DIR` must be an absolute path such as `/src/docs`. The `HOST-DIR` +must be an absolute path as well. Podman bind-mounts the `HOST-DIR` to the +specified path. For example, when specifying the host path `/foo`, +Podman copies the contents of `/foo` to the container filesystem on the host +and bind mounts that into the container. + +You can specify multiple **-v** options to mount one or more mounts to a +container. + +You can add the `:ro` or `:rw` suffix to a volume to mount it read-only or +read-write mode, respectively. By default, the volumes are mounted read-write. +See examples. + + `Chowning Volume Mounts` + +By default, Podman does not change the owner and group of source volume +directories mounted. When running using user namespaces, the UID and GID inside +the namespace may correspond to another UID and GID on the host. + +The `:U` suffix tells Podman to use the correct host UID and GID based on the +UID and GID within the namespace, to change recursively the owner and group of +the source volume. + +**Warning** use with caution since this modifies the host filesystem. + + `Labeling Volume Mounts` + +Labeling systems like SELinux require that proper labels are placed on volume +content mounted into a container. Without a label, the security system might +prevent the processes running inside the container from using the content. By +default, Podman does not change the labels set by the OS. + +To change a label in the container context, add one of these two suffixes +`:z` or `:Z` to the volume mount. These suffixes tell Podman to relabel file +objects on the shared volumes. The `z` option tells Podman that two containers +share the volume content. As a result, Podman labels the content with a shared +content label. Shared volume labels allow all containers to read/write content. +The `Z` option tells Podman to label the content with a private unshared label. +Only the current container can use a private volume. + +Note: Do not relabel system files and directories. Relabeling system content +might cause other confined services on the host machine to fail. For these types +of containers, disabling SELinux separation is recommended. The option +`--security-opt label=disable` disables SELinux separation for the container. +For example, if a user wanted to volume mount their entire home directory into the build containers, they need to disable SELinux separation. + + $ podman build --security-opt label=disable -v $HOME:/home/user . + + `Overlay Volume Mounts` + + The `:O` flag tells Podman to mount the directory from the host as a +temporary storage using the Overlay file system. The `RUN` command containers +are allowed to modify contents within the mountpoint and are stored in the +container storage in a separate directory. In Overlay FS terms the source +directory is the lower, and the container storage directory is the +upper. Modifications to the mount point are destroyed when the `RUN` command +finishes executing, similar to a tmpfs mount point. + + Any subsequent execution of `RUN` commands sees the original source directory +content, any changes from previous RUN commands no longer exists. + + One use case of the `overlay` mount is sharing the package cache from the +host into the container to allow speeding up builds. + + Note: + + - Overlay mounts are not currently supported in rootless mode. + - The `O` flag is not allowed to be specified with the `Z` or `z` flags. +Content mounted into the container is labeled with the private label. + On SELinux systems, labels in the source directory needs to be readable +by the container label. If not, SELinux container separation must be disabled +for the container to work. + - Modification of the directory volume mounted into the container with an +overlay mount can cause unexpected failures. Do not modify the directory until +the container finishes running. + +By default bind mounted volumes are `private`. That means any mounts done +inside containers are not be visible on the host and vice versa. This behavior +can be changed by specifying a volume mount propagation property. + +When the mount propagation policy is set to `shared`, any mounts completed +inside the container on that volume is visible to both the host and +container. When the mount propagation policy is set to `slave`, one way mount +propagation is enabled and any mounts completed on the host for that volume is +visible only inside of the container. To control the mount propagation +property of volume use the `:[r]shared`, `:[r]slave` or `:[r]private` +propagation flag. For mount propagation to work on the source mount point (mount +point where source dir is mounted on) has to have the right propagation properties. +For shared volumes, the source mount point has to be shared. And for slave volumes, +the source mount has to be either shared or slave. [[1]](#Footnote1) + +Use `df ` to determine the source mount and then use +`findmnt -o TARGET,PROPAGATION ` to determine propagation +properties of source mount, if `findmnt` utility is not available, the source +mount point can be determined by looking at the mount entry in +`/proc/self/mountinfo`. Look at `optional fields` and see if any propagation +properties are specified. +`shared:X` means the mount is `shared`, `master:X` means the mount is `slave` +and if nothing is there that means the mount is `private`. [[1]](#Footnote1) + +To change propagation properties of a mount point use the `mount` command. For +example, to bind mount the source directory `/foo` do +`mount --bind /foo /foo` and `mount --make-private --make-shared /foo`. This +converts /foo into a `shared` mount point. The propagation properties of +the source mount can be changed directly. For instance if `/` is the source +mount for `/foo`, then use `mount --make-shared /` to convert `/` into a +`shared` mount. diff --git a/docs/source/markdown/podman-build.1.md.in b/docs/source/markdown/podman-build.1.md.in index a711a13fff..0e013dea9d 100644 --- a/docs/source/markdown/podman-build.1.md.in +++ b/docs/source/markdown/podman-build.1.md.in @@ -55,13 +55,7 @@ command to see these containers. External containers can be removed with the Instead of building for a set of platforms specified using the **--platform** option, inspect the build's base images, and build for all of the platforms for which they are all available. Stages that use *scratch* as a starting point can not be inspected, so at least one non-*scratch* stage must be present for detection to work usefully. -#### **--annotation**=*annotation* - -Add an image *annotation* (e.g. annotation=*value*) to the image metadata. Can -be used multiple times. - -Note: this information is not present in Docker image formats, so it is -discarded when writing images in Docker formats. +@@option annotation.image #### **--arch**=*arch* @@ -73,132 +67,27 @@ host. (Examples: arm, arm64, 386, amd64, ppc64le, s390x) @@option authfile -#### **--build-arg**=*arg=value* +@@option build-arg -Specifies a build argument and its value, which is interpolated in -instructions read from the Containerfiles in the same way that environment -variables are, but which are not added to environment variable list in the -resulting image's configuration. +@@option build-arg-file -#### **--build-arg-file**=*path* +@@option build-context -Specifies a file containing lines of build arguments of the form `arg=value`. -The suggested file name is `argfile.conf`. +@@option cache-from -Comment lines beginning with `#` are ignored, along with blank lines. -All others must be of the `arg=value` format passed to `--build-arg`. +@@option cache-to -If several arguments are provided via the `--build-arg-file` -and `--build-arg` options, the build arguments are merged across all -of the provided files and command line arguments. +@@option cache-ttl -Any file provided in a `--build-arg-file` option is read before -the arguments supplied via the `--build-arg` option. +@@option cap-add.image -When a given argument name is specified several times, the last instance -is the one that is passed to the resulting builds. This means `--build-arg` -values always override those in a `--build-arg-file`. - -#### **--build-context**=*name=value* - -Specify an additional build context using its short name and its location. -Additional build contexts can be referenced in the same manner as we access -different stages in COPY instruction. - -Valid values are: - -* Local directory – e.g. --build-context project2=../path/to/project2/src (This option is not available with the remote Podman client. On Podman machine setup (i.e macOS and Winows) path must exists on the machine VM) -* HTTP URL to a tarball – e.g. --build-context src=https://example.org/releases/src.tar -* Container image – specified with a container-image:// prefix, e.g. --build-context alpine=container-image://alpine:3.15, (also accepts docker://, docker-image://) - -On the Containerfile side, reference the build context on all -commands that accept the “from” parameter. Here’s how that might look: - -```dockerfile -FROM [name] -COPY --from=[name] ... -RUN --mount=from=[name] … -``` - -The value of [name] is matched with the following priority order: - -* Named build context defined with --build-context [name]=.. -* Stage defined with AS [name] inside Containerfile -* Image [name], either local or in a remote registry - -#### **--cache-from** - -Repository to utilize as a potential cache source. When specified, Buildah tries to look for -cache images in the specified repository and attempts to pull cache images instead of actually -executing the build steps locally. Buildah only attempts to pull previously cached images if they -are considered as valid cache hits. - -Use the `--cache-to` option to populate a remote repository with cache content. - -Example - -```bash -# populate a cache and also consult it -buildah build -t test --layers --cache-to registry/myrepo/cache --cache-from registry/myrepo/cache . -``` - -Note: `--cache-from` option is ignored unless `--layers` is specified. - -#### **--cache-to** - -Set this flag to specify a remote repository that is used to store cache images. Buildah attempts to -push newly built cache image to the remote repository. - -Note: Use the `--cache-from` option in order to use cache content in a remote repository. - -Example - -```bash -# populate a cache and also consult it -buildah build -t test --layers --cache-to registry/myrepo/cache --cache-from registry/myrepo/cache . -``` - -Note: `--cache-to` option is ignored unless `--layers` is specified. - -#### **--cache-ttl** - -Limit the use of cached images to only consider images with created timestamps less than *duration* ago. -For example if `--cache-ttl=1h` is specified, Buildah considers intermediate cache images which are created -under the duration of one hour, and intermediate cache images outside this duration is ignored. - -Note: Setting `--cache-ttl=0` manually is equivalent to using `--no-cache` in the -implementation since this means that the user dones not want to use cache at all. - -#### **--cap-add**=*CAP\_xxx* - -When executing RUN instructions, run the command specified in the instruction -with the specified capability added to its capability set. -Certain capabilities are granted by default; this option can be used to add -more. - -#### **--cap-drop**=*CAP\_xxx* - -When executing RUN instructions, run the command specified in the instruction -with the specified capability removed from its capability set. -The CAP\_CHOWN, CAP\_DAC\_OVERRIDE, CAP\_FOWNER, -CAP\_FSETID, CAP\_KILL, CAP\_NET\_BIND\_SERVICE, CAP\_SETFCAP, -CAP\_SETGID, CAP\_SETPCAP, and CAP\_SETUID capabilities are -granted by default; this option can be used to remove them. - -If a capability is specified to both the **--cap-add** and **--cap-drop** -options, it is dropped, regardless of the order in which the options were -given. +@@option cap-drop.image @@option cert-dir @@option cgroup-parent -#### **--cgroupns**=*how* - -Sets the configuration for cgroup namespaces when handling `RUN` instructions. -The configured value can be "" (the empty string) or "private" to indicate -that a new cgroup namespace is created, or it can be "host" to indicate -that the cgroup namespace in which `buildah` itself is being run is reused. +@@option cgroupns.image #### **--compress** @@ -206,9 +95,7 @@ This option is added to be aligned with other containers CLIs. Podman doesn't communicate with a daemon or a remote server. Thus, compressing the data before sending it is irrelevant to Podman. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines) -#### **--cpp-flag**=*flags* - -Set additional flags to pass to the C Preprocessor cpp(1). Containerfiles ending with a ".in" suffix is preprocessed via cpp(1). This option can be used to pass additional flags to cpp.Note: You can also set default CPPFLAGS by setting the BUILDAH_CPPFLAGS environment variable (e.g., export BUILDAH_CPPFLAGS="-DDEBUG"). +@@option cpp-flag @@option cpu-period @@ -282,12 +169,7 @@ This option is not supported on the remote client, including Mac and Windows (excluding WSL2) machines. -#### **--decryption-key**=*key[:passphrase]* - -The [key[:passphrase]] to be used for decryption of images. Key can point to -keys and/or certificates. Decryption is tried with all keys. If the key is -protected by a passphrase, it is required to be passed in the argument and -omitted otherwise. +@@option decryption-key @@option device @@ -296,14 +178,7 @@ from inside a rootless container fails. The **[crun(1)](https://github.com/conta workaround for this by adding the option **--annotation run.oci.keep_original_groups=1**. -#### **--disable-compression**, **-D** - -Don't compress filesystem layers when building the image unless it is required -by the location where the image is being written. This is the default setting, -because image layers are compressed automatically when they are pushed to -registries, and images being written to local storage only need to be -decompressed again to be stored. Compression can be forced in all cases by -specifying **--disable-compression=false**. +@@option disable-compression @@option disable-content-trust @@ -314,169 +189,47 @@ This option cannot be combined with **--network** that is set to **none**. Note: this option takes effect only during *RUN* instructions in the build. It does not affect _/etc/resolv.conf_ in the final image. -#### **--dns-option**=*option* +@@option dns-option.image -Set custom DNS options to be used during the build. +@@option dns-search.image -#### **--dns-search**=*domain* +@@option env.image -Set custom DNS search domains to be used during the build. +@@option file -#### **--env**=*env[=value]* +@@option force-rm -Add a value (e.g. env=*value*) to the built image. Can be used multiple times. -If neither `=` nor a *value* are specified, but *env* is set in the current -environment, the value from the current environment is added to the image. -To remove an environment variable from the built image, use the `--unsetenv` -option. +@@option format -#### **--file**, **-f**=*Containerfile* +@@option from -Specifies a Containerfile which contains instructions for building the image, -either a local file or an **http** or **https** URL. If more than one -Containerfile is specified, *FROM* instructions are only be accepted from the -last specified file. +@@option group-add -If a build context is not specified, and at least one Containerfile is a -local file, the directory in which it resides is used as the build -context. +@@option help -Specifying the option `-f -` causes the Containerfile contents to be read from stdin. - -#### **--force-rm** - -Always remove intermediate containers after a build, even if the build fails -(default true). - -#### **--format** - -Control the format for the built image's manifest and configuration data. -Recognized formats include *oci* (OCI image-spec v1.0, the default) and -*docker* (version 2, using schema format 2 for the manifest). - -Note: You can also override the default format by setting the BUILDAH\_FORMAT -environment variable. `export BUILDAH_FORMAT=docker` - -#### **--from** - -Overrides the first `FROM` instruction within the Containerfile. If there are multiple -FROM instructions in a Containerfile, only the first is changed. - -With the remote podman client, not all container transports work as -expected. For example, oci-archive:/x.tar references /x.tar on the remote -machine instead of on the client. When using podman remote clients it is -best to restrict use to *containers-storage*, and *docker:// transports*. - -#### **--group-add**=*group* | *keep-groups* - -Assign additional groups to the primary user running within the container -process. - -- `keep-groups` is a special value that tells Buildah to keep the supplementary -group access. - -Allows container to use the user's supplementary group access. If file systems -or devices are only accessible by the rootless user's group, this flag tells the -OCI runtime to pass the group access into the container. Currently only -available with the `crun` OCI runtime. Note: `keep-groups` is exclusive, other -groups cannot be specified with this flag. - -#### **--help**, **-h** - -Print usage statement - -#### **--hooks-dir**=*path* - -Each *.json file in the path configures a hook for buildah build containers. For more details on the syntax of the JSON files and the semantics of hook injection. Buildah currently support both the 1.0.0 and 0.1.0 hook schemas, although the 0.1.0 schema is deprecated. - -This option may be set multiple times; paths from later options have higher precedence. - -For the annotation conditions, buildah uses any annotations set in the generated OCI configuration. - -For the bind-mount conditions, only mounts explicitly requested by the caller via --volume are considered. Bind mounts that buildah inserts by default (e.g. /dev/shm) are not considered. - -If --hooks-dir is unset for root callers, Buildah currently defaults to /usr/share/containers/oci/hooks.d and /etc/containers/oci/hooks.d in order of increasing precedence. Using these defaults is deprecated. Migrate to explicitly setting --hooks-dir. +@@option hooks-dir @@option http-proxy -#### **--identity-label** +@@option identity-label -Adds default identity label `io.buildah.version` if set. (default true). +@@option ignorefile -#### **--ignorefile** +@@option iidfile -Path to an alternative .containerignore file. +@@option ipc.image -#### **--iidfile**=*ImageIDfile* +@@option isolation -Write the built image's ID to the file. When `--platform` is specified more -than once, attempting to use this option triggers an error. +@@option jobs -#### **--ipc**=*how* +@@option label.image -Sets the configuration for IPC namespaces when handling `RUN` instructions. -The configured value can be "" (the empty string) or "container" to indicate -that a new IPC namespace is created, or it can be "host" to indicate -that the IPC namespace in which `podman` itself is being run is reused, -or it can be the path to an IPC namespace which is already in use by -another process. +@@option layer-label -#### **--isolation**=*type* +@@option layers -Controls what type of isolation is used for running processes as part of `RUN` -instructions. Recognized types include *oci* (OCI-compatible runtime, the -default), *rootless* (OCI-compatible runtime invoked using a modified -configuration and its --rootless option enabled, with *--no-new-keyring ---no-pivot* added to its *create* invocation, with network and UTS namespaces -disabled, and IPC, PID, and user namespaces enabled; the default for -unprivileged users), and *chroot* (an internal wrapper that leans more toward -chroot(1) than container technology). - -Note: You can also override the default isolation type by setting the -BUILDAH\_ISOLATION environment variable. `export BUILDAH_ISOLATION=oci` - -#### **--jobs**=*number* - -Run up to N concurrent stages in parallel. If the number of jobs is greater -than 1, stdin is read from /dev/null. If 0 is specified, then there is -no limit in the number of jobs that run in parallel. - -#### **--label**=*label* - -Add an image *label* (e.g. label=*value*) to the image metadata. Can be used -multiple times. - -Users can set a special LABEL **io.containers.capabilities=CAP1,CAP2,CAP3** in -a Containerfile that specifies the list of Linux capabilities required for the -container to run properly. This label specified in a container image tells -Podman to run the container with just these capabilities. Podman launches the -container with just the specified capabilities, as long as this list of -capabilities is a subset of the default list. - -If the specified capabilities are not in the default set, Podman prints an error -message and runs the container with the default capabilities. - -#### **--layer-label**=*label[=value]* - -Add an intermediate image *label* (e.g. label=*value*) to the intermediate -image metadata. It can be used multiple times. - -If *label* is named, but neither `=` nor a `value` is provided, then -the *label* is set to an empty value. - -#### **--layers** - -Cache intermediate images during the build process (Default is `true`). - -Note: You can also override the default value of layers by setting the -BUILDAH\_LAYERS environment variable. `export BUILDAH_LAYERS=true` - -#### **--logfile**=*filename* - -Log output which is sent to standard output and standard error to the -specified file instead of to standard output and standard error. -This option is not supported on the remote client, including Mac and Windows -(excluding WSL2) machines. +@@option logfile #### **--logsplit**=*bool-value* @@ -486,123 +239,29 @@ following format: `${logfile}_${platform-os}_${platform-arch}`. This option is not supported on the remote client, including Mac and Windows (excluding WSL2) machines. -#### **--manifest**=*manifest* - -Name of the manifest list to which the image is added. Creates the manifest list -if it does not exist. This option is useful for building multi architecture images. +@@option manifest @@option memory @@option memory-swap -#### **--network**=*mode*, **--net** +@@option network.image -Sets the configuration for network namespaces when handling `RUN` instructions. +@@option no-cache -Valid _mode_ values are: - -- **none**: no networking. -- **host**: use the Podman host network stack. Note: the host mode gives the -container full access to local system services such as D-bus and is therefore -considered insecure. -- **ns:**_path_: path to a network namespace to join. -- **private**: create a new namespace for the container (default) -- **\**: Join the network with the given name or ID, e.g. use `--network mynet` to join the network with the name mynet. Only supported for rootful users. -- **slirp4netns[:OPTIONS,...]**: use **slirp4netns**(1) to create a user network stack. This is the default for rootless containers. It is possible to specify these additional options, they can also be set with `network_cmd_options` in containers.conf: - - **allow_host_loopback=true|false**: Allow slirp4netns to reach the host loopback IP (default is 10.0.2.2 or the second IP from slirp4netns cidr subnet when changed, see the cidr option below). The default is false. - - **mtu=MTU**: Specify the MTU to use for this network. (Default is `65520`). - - **cidr=CIDR**: Specify ip range to use for this network. (Default is `10.0.2.0/24`). - - **enable_ipv6=true|false**: Enable IPv6. Default is true. (Required for `outbound_addr6`). - - **outbound_addr=INTERFACE**: Specify the outbound interface slirp binds to (ipv4 traffic only). - - **outbound_addr=IPv4**: Specify the outbound ipv4 address slirp binds to. - - **outbound_addr6=INTERFACE**: Specify the outbound interface slirp binds to (ipv6 traffic only). - - **outbound_addr6=IPv6**: Specify the outbound ipv6 address slirp binds to. -- **pasta[:OPTIONS,...]**: use **pasta**(1) to create a user-mode networking - stack. \ - This is only supported in rootless mode. \ - By default, IPv4 and IPv6 addresses and routes, as well as the pod interface - name, are copied from the host. If port forwarding isn't configured, ports - are forwarded dynamically as services are bound on either side (init - namespace or container namespace). Port forwarding preserves the original - source IP address. Options described in pasta(1) can be specified as - comma-separated arguments. \ - In terms of pasta(1) options, **--config-net** is given by default, in - order to configure networking when the container is started, and - **--no-map-gw** is also assumed by default, to avoid direct access from - container to host using the gateway address. The latter can be overridden - by passing **--map-gw** in the pasta-specific options (despite not being an - actual pasta(1) option). \ - Also, **-t none** and **-u none** are passed to disable - automatic port forwarding based on bound ports. Similarly, **-T none** and - **-U none** are given to disable the same functionality from container to - host. \ - Some examples: - - **pasta:--map-gw**: Allow the container to directly reach the host using the - gateway address. - - **pasta:--mtu,1500**: Specify a 1500 bytes MTU for the _tap_ interface in - the container. - - **pasta:--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,-m,1500,--no-ndp,--no-dhcpv6,--no-dhcp**, - equivalent to default slirp4netns(1) options: disable IPv6, assign - `10.0.2.0/24` to the `tap0` interface in the container, with gateway - `10.0.2.3`, enable DNS forwarder reachable at `10.0.2.3`, set MTU to 1500 - bytes, disable NDP, DHCPv6 and DHCP support. - - **pasta:-I,tap0,--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,--no-ndp,--no-dhcpv6,--no-dhcp**, - equivalent to default slirp4netns(1) options with Podman overrides: same as - above, but leave the MTU to 65520 bytes - - **pasta:-t,auto,-u,auto,-T,auto,-U,auto**: enable automatic port forwarding - based on observed bound ports from both host and container sides - - **pasta:-T,5201**: enable forwarding of TCP port 5201 from container to - host, using the loopback interface instead of the tap interface for improved - performance - -#### **--no-cache** - -Do not use existing cached images for the container build. Build from the start -with a new set of cached layers. - - -#### **--no-hostname** - -Do not create the _/etc/hostname_ file in the container for RUN instructions. - -By default, Buildah manages the _/etc/hostname_ file, adding the container's own hostname. When the **--no-hostname** option is set, the image's _/etc/hostname_ will be preserved unmodified if it exists. +@@option no-hostname @@option no-hosts This option conflicts with **--add-host**. -#### **--omit-history** +@@option omit-history -Omit build history information in the built image. (default false). +@@option os -This option is useful for the cases where end users explicitly -want to set `--omit-history` to omit the optional `History` from -built images or when working with images built using build tools that -do not include `History` information in their images. +@@option os-feature -#### **--os**=*string* - -Set the OS of the image to be built, and that of the base image to be pulled, -if the build uses one, instead of using the current operating system of the -build host. Unless overridden, subsequent lookups of the same image in the -local storage matches this OS, regardless of the host. - -#### **--os-feature**=*feature* - -Set the name of a required operating system *feature* for the image which is built. By default, if the image is not based on *scratch*, the base image's -required OS feature list is kept, if the base image specified any. This option -is typically only meaningful when the image's OS is Windows. - -If *feature* has a trailing `-`, then the *feature* is removed from the set of -required features which is listed in the image. - -#### **--os-version**=*version* - -Set the exact required operating system *version* for the image which is -built. By default, if the image is not based on *scratch*, the base image's -required OS version is kept, if the base image specified one. This option is -typically only meaningful when the image's OS is Windows, and is typically set in -Windows base images, so using this option is usually unnecessary. +@@option os-version.image #### **--output**, **-o**=*output-opts* @@ -623,14 +282,7 @@ Valid _type_ values are: If no type is specified, the value defaults to **local**. Alternatively, instead of a comma-separated sequence, the value of **--output** can be just a destination (in the **dest** format) (e.g. `--output some-path`, `--output -`) where `--output some-path` is treated as if **type=local** and `--output -` is treated as if **type=tar**. -#### **--pid**=*pid* - -Sets the configuration for PID namespaces when handling `RUN` instructions. -The configured value can be "" (the empty string) or "container" to indicate -that a new PID namespace is created, or it can be "host" to indicate -that the PID namespace in which `podman` itself is being run is reused, -or it can be the path to a PID namespace which is already in use by another -process. +@@option pid.image #### **--platform**=*os/arch[/variant][,...]* @@ -658,78 +310,25 @@ While `podman build` is happy to use base images and build images for any platform that exists, `RUN` instructions are able to succeed without the help of emulation provided by packages like `qemu-user-static`. -#### **--pull**=*policy* +@@option pull.image Pull image policy. The default is **missing**. -- **always**, **true**: Always pull the image and throw an error if the pull fails. -- **missing**: Only pull the image when it does not exist in the local containers storage. Throw an error if no image is found and the pull fails. -- **never**, **false**: Never pull the image but use the one from the local containers storage. Throw an error when no image is found. -- **newer**: Pull if the image on the registry is newer than the one in the local containers storage. An image is considered to be newer when the digests are different. Comparing the time stamps is prone to errors. Pull errors are suppressed if a local image was found. +@@option quiet -#### **--quiet**, **-q** +@@option retry -Suppress output messages which indicate which instruction is being processed, -and of progress when pulling images from a registry, and when writing the -output image. +@@option retry-delay -#### **--retry**=*attempts* +@@option rm -Number of times to retry in case of failure when performing pull of -images from registry. Default is **3**. +@@option runtime -#### **--retry-delay**=*duration* +@@option runtime-flag -Duration of delay between retry attempts in case of failure when performing -pull of images from registry. Default is **2s**. +@@option secret.image -#### **--rm** - -Remove intermediate containers after a successful build (default true). - -#### **--runtime**=*path* - -The *path* to an alternate OCI-compatible runtime, which is used to run -commands specified by the **RUN** instruction. - -Note: You can also override the default runtime by setting the BUILDAH\_RUNTIME -environment variable. `export BUILDAH_RUNTIME=/usr/local/bin/runc` - -#### **--runtime-flag**=*flag* - -Adds global flags for the container rutime. To list the supported flags, please consult the manpages of the selected container runtime. - -Note: Do not pass the leading -- to the flag. To pass the runc flag --log-format json to buildah build, the option given is --runtime-flag log-format=json. - -#### **--secret**=**id=id,src=path** - -Pass secret information used in the Containerfile for building images -in a safe way that are not stored in the final image, or be seen in other stages. -The secret is mounted in the container at the default location of `/run/secrets/id`. - -To later use the secret, use the --mount option in a `RUN` instruction within a `Containerfile`: - -`RUN --mount=type=secret,id=mysecret cat /run/secrets/mysecret` - -#### **--security-opt**=*option* - -Security Options - -- `apparmor=unconfined` : Turn off apparmor confinement for the container -- `apparmor=alternate-profile` : Set the apparmor confinement profile for the -container - -- `label=user:USER` : Set the label user for the container processes -- `label=role:ROLE` : Set the label role for the container processes -- `label=type:TYPE` : Set the label process type for the container processes -- `label=level:LEVEL` : Set the label level for the container processes -- `label=filetype:TYPE` : Set the label file type for the container files -- `label=disable` : Turn off label separation for the container -- `no-new-privileges` : Not supported - -- `seccomp=unconfined` : Turn off seccomp confinement for the container -- `seccomp=profile.json` : White listed syscalls seccomp Json file to be used -as a seccomp filter +@@option security-opt.image @@option shm-size @@ -737,28 +336,13 @@ as a seccomp filter Sign the image using a GPG key with the specified FINGERPRINT. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines,) -#### **--skip-unused-stages** +@@option skip-unused-stages -Skip stages in multi-stage builds which don't affect the target stage. (Default: **true**). +@@option squash -#### **--squash** +@@option squash-all -Squash all of the image's new layers into a single new layer; any preexisting -layers are not squashed. - -#### **--squash-all** - -Squash all of the new image's layers (including those inherited from a base -image) into a single new layer. - -#### **--ssh**=*default* | *id[=socket>* - -SSH agent socket or keys to expose to the build. -The socket path can be left empty to use the value of `default=$SSH_AUTH_SOCK` - -To later use the ssh agent, use the --mount option in a `RUN` instruction within a `Containerfile`: - -`RUN --mount=type=ssh,id=id mycmd` +@@option ssh #### **--stdin** @@ -766,152 +350,31 @@ Pass stdin into the RUN containers. Sometime commands being RUN within a Contain want to request information from the user. For example apt asking for a confirmation for install. Use --stdin to be able to interact from the terminal during the build. -#### **--tag**, **-t**=*imageName* +@@option tag -Specifies the name which is assigned to the resulting image if the build -process completes successfully. -If _imageName_ does not include a registry name, the registry name *localhost* -is prepended to the image name. Can be used multiple times. +@@option target -#### **--target**=*stageName* - -Set the target build stage to build. When building a Containerfile with -multiple build stages, --target can be used to specify an intermediate build -stage by name as the final stage for the resulting image. Commands after the target stage is skipped. - -#### **--timestamp**=*seconds* - -Set the create timestamp to seconds since epoch to allow for deterministic -builds (defaults to current time). By default, the created timestamp is changed -and written into the image manifest with every commit, causing the image's -sha256 hash to be different even if the sources are exactly the same otherwise. -When --timestamp is set, the created timestamp is always set to the time -specified and therefore not changed, allowing the image's sha256 hash to remain the -same. All files committed to the layers of the image is created with the -timestamp. - -If the only instruction in a Containerfile is `FROM`, this flag has no effect. +@@option timestamp @@option tls-verify -#### **--ulimit**=*type=soft-limit[:hard-limit]* +@@option ulimit.image -Specifies resource limits to apply to processes launched when processing `RUN` -instructions. This option can be specified multiple times. Recognized resource -types include: - "core": maximum core dump size (ulimit -c) - "cpu": maximum CPU time (ulimit -t) - "data": maximum size of a process's data segment (ulimit -d) - "fsize": maximum size of new files (ulimit -f) - "locks": maximum number of file locks (ulimit -x) - "memlock": maximum amount of locked memory (ulimit -l) - "msgqueue": maximum amount of data in message queues (ulimit -q) - "nice": niceness adjustment (nice -n, ulimit -e) - "nofile": maximum number of open files (ulimit -n) - "nproc": maximum number of processes (ulimit -u) - "rss": maximum size of a process's (ulimit -m) - "rtprio": maximum real-time scheduling priority (ulimit -r) - "rttime": maximum amount of real-time execution between blocking syscalls - "sigpending": maximum number of pending signals (ulimit -i) - "stack": maximum stack size (ulimit -s) +@@option unsetenv.image -#### **--unsetenv**=*env* +@@option unsetlabel -Unset environment variables from the final image. +@@option userns.image -#### **--unsetlabel**=*label* +@@option userns-gid-map -Unset the image label, causing the label not to be inherited from the base image. +@@option userns-gid-map-group -#### **--userns**=*how* +@@option userns-uid-map -Sets the configuration for user namespaces when handling `RUN` instructions. -The configured value can be "" (the empty string) or "container" to indicate -that a new user namespace is created, it can be "host" to indicate that -the user namespace in which `podman` itself is being run is reused, or -it can be the path to a user namespace which is already in use by another -process. +@@option userns-uid-map-user -#### **--userns-gid-map**=*mapping* - -Directly specifies a GID mapping to be used to set ownership, at the -filesystem level, on the working container's contents. -Commands run when handling `RUN` instructions defaults to being run in -their own user namespaces, configured using the UID and GID maps. - -Entries in this map take the form of one or more triples of a starting -in-container GID, a corresponding starting host-level GID, and the number of -consecutive IDs which the map entry represents. - -This option overrides the *remap-gids* setting in the *options* section of -/etc/containers/storage.conf. - -If this option is not specified, but a global --userns-gid-map setting is -supplied, settings from the global option is used. - -If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-gid-map -are specified, but --userns-uid-map is specified, the GID map is set to -use the same numeric values as the UID map. - -#### **--userns-gid-map-group**=*group* - -Specifies that a GID mapping to be used to set ownership, at the -filesystem level, on the working container's contents, can be found in entries -in the `/etc/subgid` file which correspond to the specified group. -Commands run when handling `RUN` instructions defaults to being run in -their own user namespaces, configured using the UID and GID maps. -If --userns-uid-map-user is specified, but --userns-gid-map-group is not -specified, `podman` assumes that the specified user name is also a -suitable group name to use as the default setting for this option. - -**NOTE:** When this option is specified by a rootless user, the specified -mappings are relative to the rootless user namespace in the container, rather -than being relative to the host as it is when run rootful. - -#### **--userns-uid-map**=*mapping* - -Directly specifies a UID mapping to be used to set ownership, at the -filesystem level, on the working container's contents. -Commands run when handling `RUN` instructions default to being run in -their own user namespaces, configured using the UID and GID maps. - -Entries in this map take the form of one or more triples of a starting -in-container UID, a corresponding starting host-level UID, and the number of -consecutive IDs which the map entry represents. - -This option overrides the *remap-uids* setting in the *options* section of -/etc/containers/storage.conf. - -If this option is not specified, but a global --userns-uid-map setting is -supplied, settings from the global option is used. - -If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-uid-map -are specified, but --userns-gid-map is specified, the UID map is set to -use the same numeric values as the GID map. - -#### **--userns-uid-map-user**=*user* - -Specifies that a UID mapping to be used to set ownership, at the -filesystem level, on the working container's contents, can be found in entries -in the `/etc/subuid` file which correspond to the specified user. -Commands run when handling `RUN` instructions defaults to being run in -their own user namespaces, configured using the UID and GID maps. -If --userns-gid-map-group is specified, but --userns-uid-map-user is not -specified, `podman` assumes that the specified group name is also a -suitable user name to use as the default setting for this option. - -**NOTE:** When this option is specified by a rootless user, the specified -mappings are relative to the rootless user namespace in the container, rather -than being relative to the host as it is when run rootful. - -#### **--uts**=*how* - -Sets the configuration for UTS namespaces when handling `RUN` instructions. -The configured value can be "" (the empty string) or "container" to indicate -that a new UTS namespace to be created, or it can be "host" to indicate -that the UTS namespace in which `podman` itself is being run is reused, -or it can be the path to a UTS namespace which is already in use by another -process. +@@option uts #### **--variant**=*variant* @@ -919,126 +382,7 @@ Set the architecture variant of the image to be built, and that of the base image to be pulled, if the build uses one, to the provided value instead of using the architecture variant of the build host. -#### **--volume**, **-v**=*[HOST-DIR:CONTAINER-DIR[:OPTIONS]]* - -Create a bind mount. Specifying the `-v /HOST-DIR:/CONTAINER-DIR` option, Podman -bind mounts `/HOST-DIR` from the host to `/CONTAINER-DIR` in the Podman -container. - -The `OPTIONS` are a comma-separated list and can be: [[1]](#Footnote1) - - * [rw|ro] - * [z|Z|O] - * [U] - * [`[r]shared`|`[r]slave`|`[r]private`] - -The `CONTAINER-DIR` must be an absolute path such as `/src/docs`. The `HOST-DIR` -must be an absolute path as well. Podman bind-mounts the `HOST-DIR` to the -specified path. For example, when specifying the host path `/foo`, -Podman copies the contents of `/foo` to the container filesystem on the host -and bind mounts that into the container. - -You can specify multiple **-v** options to mount one or more mounts to a -container. - -You can add the `:ro` or `:rw` suffix to a volume to mount it read-only or -read-write mode, respectively. By default, the volumes are mounted read-write. -See examples. - - `Chowning Volume Mounts` - -By default, Podman does not change the owner and group of source volume -directories mounted. When running using user namespaces, the UID and GID inside -the namespace may correspond to another UID and GID on the host. - -The `:U` suffix tells Podman to use the correct host UID and GID based on the -UID and GID within the namespace, to change recursively the owner and group of -the source volume. - -**Warning** use with caution since this modifies the host filesystem. - - `Labeling Volume Mounts` - -Labeling systems like SELinux require that proper labels are placed on volume -content mounted into a container. Without a label, the security system might -prevent the processes running inside the container from using the content. By -default, Podman does not change the labels set by the OS. - -To change a label in the container context, add one of these two suffixes -`:z` or `:Z` to the volume mount. These suffixes tell Podman to relabel file -objects on the shared volumes. The `z` option tells Podman that two containers -share the volume content. As a result, Podman labels the content with a shared -content label. Shared volume labels allow all containers to read/write content. -The `Z` option tells Podman to label the content with a private unshared label. -Only the current container can use a private volume. - -Note: Do not relabel system files and directories. Relabeling system content -might cause other confined services on the host machine to fail. For these types -of containers, disabling SELinux separation is recommended. The option -`--security-opt label=disable` disables SELinux separation for the container. -For example, if a user wanted to volume mount their entire home directory into the build containers, they need to disable SELinux separation. - - $ podman build --security-opt label=disable -v $HOME:/home/user . - - `Overlay Volume Mounts` - - The `:O` flag tells Podman to mount the directory from the host as a -temporary storage using the Overlay file system. The `RUN` command containers -are allowed to modify contents within the mountpoint and are stored in the -container storage in a separate directory. In Overlay FS terms the source -directory is the lower, and the container storage directory is the -upper. Modifications to the mount point are destroyed when the `RUN` command -finishes executing, similar to a tmpfs mount point. - - Any subsequent execution of `RUN` commands sees the original source directory -content, any changes from previous RUN commands no longer exists. - - One use case of the `overlay` mount is sharing the package cache from the -host into the container to allow speeding up builds. - - Note: - - - Overlay mounts are not currently supported in rootless mode. - - The `O` flag is not allowed to be specified with the `Z` or `z` flags. -Content mounted into the container is labeled with the private label. - On SELinux systems, labels in the source directory needs to be readable -by the container label. If not, SELinux container separation must be disabled -for the container to work. - - Modification of the directory volume mounted into the container with an -overlay mount can cause unexpected failures. Do not modify the directory until -the container finishes running. - -By default bind mounted volumes are `private`. That means any mounts done -inside containers are not be visible on the host and vice versa. This behavior -can be changed by specifying a volume mount propagation property. - -When the mount propagation policy is set to `shared`, any mounts completed -inside the container on that volume is visible to both the host and -container. When the mount propagation policy is set to `slave`, one way mount -propagation is enabled and any mounts completed on the host for that volume is -visible only inside of the container. To control the mount propagation -property of volume use the `:[r]shared`, `:[r]slave` or `:[r]private` -propagation flag. For mount propagation to work on the source mount point (mount -point where source dir is mounted on) has to have the right propagation properties. -For shared volumes, the source mount point has to be shared. And for slave volumes, -the source mount has to be either shared or slave. [[1]](#Footnote1) - -Use `df ` to determine the source mount and then use -`findmnt -o TARGET,PROPAGATION ` to determine propagation -properties of source mount, if `findmnt` utility is not available, the source -mount point can be determined by looking at the mount entry in -`/proc/self/mountinfo`. Look at `optional fields` and see if any propagation -properties are specified. -`shared:X` means the mount is `shared`, `master:X` means the mount is `slave` -and if nothing is there that means the mount is `private`. [[1]](#Footnote1) - -To change propagation properties of a mount point use the `mount` command. For -example, to bind mount the source directory `/foo` do -`mount --bind /foo /foo` and `mount --make-private --make-shared /foo`. This -converts /foo into a `shared` mount point. The propagation properties of -the source mount can be changed directly. For instance if `/` is the source -mount for `/foo`, then use `mount --make-shared /` to convert `/` into a -`shared` mount. +@@option volume.image ## EXAMPLES diff --git a/docs/source/markdown/podman-farm-build.1.md.in b/docs/source/markdown/podman-farm-build.1.md.in new file mode 100644 index 0000000000..28464ca7cb --- /dev/null +++ b/docs/source/markdown/podman-farm-build.1.md.in @@ -0,0 +1,249 @@ +% podman-farm-build 1 + +## NAME +podman\-farm\-build - Build images on farm nodes, then bundle them into a manifest list + +## SYNOPSIS +**podman farm build** [*options*] [*context*] + +## DESCRIPTION +**podman farm build** Builds an image on all nodes in a farm and bundles them up into a manifest list. +It executes the `podman build` command on the nodes in the farm with the given Containerfile. Once the +images are built on all the farm nodes, the images will be pushed to the registry given via the **--tag** +flag. Once all the images have been pushed, a manifest list will be created locally and pushed to the registry +as well. + +The manifest list will contain an image per native architecture type that is present in the farm. + +The primary function of this command is to create multi-architecture builds that will be faster than doing it +via emulation using `podman build --arch --platform`. + +If no farm is specified, the build will be sent out to all the nodes that `podman system connection` knows of. + +Note: Since the images built are directly pushed to a registry, the user must pass in a full image name using the +**--tag** option in the format _registry_**/**_repository_**/**_imageName_[**:**_tag_]`. + +## OPTIONS + +@@option add-host + +@@option annotation.image + +@@option authfile + +@@option build-arg + +@@option build-arg-file + +@@option build-context + +@@option cache-from + +@@option cache-to + +@@option cache-ttl + +@@option cap-add.image + +@@option cap-drop.image + +@@option cert-dir + +@@option cgroup-parent + +@@option cgroupns.image + +#### **--cleanup** + +Remove built images from farm nodes on success (Default: false). + +@@option cpp-flag + +@@option cpu-period + +@@option cpu-quota + +@@option cpu-shares + +@@option cpuset-cpus + +@@option cpuset-mems + +@@option creds + +@@option decryption-key + +@@option device + +Note: if the user only has access rights via a group, accessing the device +from inside a rootless container fails. The **[crun(1)](https://github.com/containers/crun/tree/main/crun.1.md)** runtime offers a +workaround for this by adding the option +**--annotation run.oci.keep_original_groups=1**. + +@@option disable-compression + +@@option dns + +This option cannot be combined with **--network** that is set to **none**. + +Note: this option takes effect only during *RUN* instructions in the build. +It does not affect _/etc/resolv.conf_ in the final image. + +@@option dns-option.image + +@@option dns-search.image + +@@option env.image + +@@option farm + +This option specifies the name of the farm to be used in the build process. + +@@option file + +@@option force-rm + +@@option format + +@@option from + +@@option group-add + +@@option help + +@@option hooks-dir + +@@option http-proxy + +@@option identity-label + +@@option ignorefile + +@@option iidfile + +@@option ipc.image + +@@option isolation + +@@option jobs + +@@option label.image + +@@option layer-label + +@@option layers + +#### **--local**, **-l** + +Build image on local machine as well as on farm nodes. + +@@option logfile + +@@option memory + +@@option memory-swap + +@@option network.image + +@@option no-cache + +@@option no-hostname + +@@option no-hosts + +This option conflicts with **--add-host**. + +@@option omit-history + +@@option os-feature + +@@option os-version.image + +@@option pid.image + +#### **--platforms**=*p1,p2,p3...* + +Build only on farm nodes that match the given platforms. + +@@option pull.image + +@@option quiet + +@@option retry + +@@option retry-delay + +@@option rm + +@@option runtime + +@@option runtime-flag + +@@option secret.image + +@@option security-opt.image + +@@option shm-size + +@@option skip-unused-stages + +@@option squash + +@@option squash-all + +@@option ssh + +@@option tag + +@@option target + +@@option timestamp + +@@option tls-verify + +@@option ulimit.image + +@@option unsetenv.image + +@@option unsetlabel + +@@option userns.image + +@@option userns-gid-map + +@@option userns-gid-map-group + +@@option userns-uid-map + +@@option userns-uid-map-user + +@@option uts + +@@option volume.image + +## EXAMPLES + +``` +$ podman farm build --local -t name -f /path/to/containerfile . + +$ podman farm build --farm myfarm -t name . + +$ podman farm build --farm myfarm --cleanup -t name . + +$ podman farm build --platforms arm64,amd64 --cleanup -t name . +``` + +## SEE ALSO +**[podman(1)](podman.1.md)**, **[podman-farm(1)](podman-farm.1.md)**, **[buildah(1)](https://github.com/containers/buildah/blob/main/docs/buildah.1.md)**, **[containers-certs.d(5)](https://github.com/containers/image/blob/main/docs/containers-certs.d.5.md)**, **[containers-registries.conf(5)](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md)**, **[crun(1)](https://github.com/containers/crun/blob/main/crun.1.md)**, **[runc(8)](https://github.com/opencontainers/runc/blob/main/man/runc.8.md)**, **[useradd(8)](https://www.unix.com/man-page/redhat/8/useradd)**, **[Containerfile(5)](https://github.com/containers/common/blob/main/docs/Containerfile.5.md)**, **[containerignore(5)](https://github.com/containers/common/blob/main/docs/containerignore.5.md)** + +## HISTORY + +September 2023, Originally compiled by Urvashi Mohnani `` + +## FOOTNOTES +1: The Podman project is committed to inclusivity, a +core value of open source. The `master` and `slave` mount propagation +terminology used here is problematic and divisive, and needs to be changed. +However, these terms are currently used within the Linux kernel and must be +used as-is at this time. When the kernel maintainers rectify this usage, +Podman will follow suit immediately. diff --git a/docs/source/markdown/podman-farm-create.1.md b/docs/source/markdown/podman-farm-create.1.md index 19a26bf7b1..a4b7e156b8 100644 --- a/docs/source/markdown/podman-farm-create.1.md +++ b/docs/source/markdown/podman-farm-create.1.md @@ -4,7 +4,7 @@ podman\-farm\-create - Create a new farm ## SYNOPSIS -**podman farm create** [*options*] *name* [*connections*] +**podman farm create** *name* [*connections*] ## DESCRIPTION Create a new farm with connections that Podman knows about which were added via the @@ -13,8 +13,6 @@ Create a new farm with connections that Podman knows about which were added via An empty farm can be created without adding any connections to it. Add or remove connections from a farm via the *podman farm update* command. -## OPTIONS - ## EXAMPLE ``` diff --git a/docs/source/markdown/podman-farm-list.1.md b/docs/source/markdown/podman-farm-list.1.md index c30a9ec545..e643bdc1a4 100644 --- a/docs/source/markdown/podman-farm-list.1.md +++ b/docs/source/markdown/podman-farm-list.1.md @@ -13,7 +13,7 @@ List all the existing farms. ## OPTIONS -#### **--format**, **-f**=*format* +#### **--format**=*format* Change the default output format. This can be of a supported type like 'json' or a Go template. Valid placeholders for the Go template listed below: diff --git a/docs/source/markdown/podman-farm.1.md b/docs/source/markdown/podman-farm.1.md index 7c08dc4ca5..242b174f85 100644 --- a/docs/source/markdown/podman-farm.1.md +++ b/docs/source/markdown/podman-farm.1.md @@ -13,12 +13,13 @@ Manage farms by creating, updating, and removing them. ## COMMANDS -| Command | Man Page | Description | -| -------- | ------------------------------------------------------------- | ------------------------ | -| create | [podman-farm\-create(1)](podman-farm-create.1.md) | Create a new farm | -| list | [podman-farm\-list(1)](podman-farm-list.1.md) | List the existing farms | -| remove | [podman-farm\-remove(1)](podman-farm-remove.1.md) | Delete one or more farms | -| update | [podman-farm\-update(1)](podman-farm-update.1.md) | Update an existing farm | +| Command | Man Page | Description | +| -------- | ----------------------------------------------------| ----------------------------------------------------------------- | +| build | [podman-farm\-build(1)](podman-farm-build.1.md) | Build images on farm nodes, then bundle them into a manifest list | +| create | [podman-farm\-create(1)](podman-farm-create.1.md) | Create a new farm | +| list | [podman-farm\-list(1)](podman-farm-list.1.md) | List the existing farms | +| remove | [podman-farm\-remove(1)](podman-farm-remove.1.md) | Delete one or more farms | +| update | [podman-farm\-update(1)](podman-farm-update.1.md) | Update an existing farm | ## SEE ALSO **[podman(1)](podman.1.md)** diff --git a/go.mod b/go.mod index 74a0f154bf..9d232db167 100644 --- a/go.mod +++ b/go.mod @@ -14,14 +14,14 @@ require ( github.com/containers/buildah v1.33.3 github.com/containers/common v0.57.2 github.com/containers/conmon v2.0.20+incompatible - github.com/containers/gvisor-tap-vsock v0.7.1 + github.com/containers/gvisor-tap-vsock v0.7.2 github.com/containers/image/v5 v5.29.1 github.com/containers/libhvee v0.5.0 github.com/containers/ocicrypt v1.1.9 github.com/containers/psgo v1.8.0 github.com/containers/storage v1.51.0 github.com/coreos/go-systemd/v22 v22.5.1-0.20231103132048-7d375ecc2b09 - github.com/coreos/stream-metadata-go v0.4.3 + github.com/coreos/stream-metadata-go v0.4.4 github.com/crc-org/vfkit v0.1.2-0.20231030102423-f3c783d34420 github.com/cyphar/filepath-securejoin v0.2.4 github.com/digitalocean/go-qemu v0.0.0-20230711162256-2e3d0186973e @@ -68,9 +68,9 @@ require ( go.etcd.io/bbolt v1.3.8 golang.org/x/exp v0.0.0-20231006140011-7918f672742d golang.org/x/net v0.18.0 - golang.org/x/sync v0.5.0 - golang.org/x/sys v0.15.0 - golang.org/x/term v0.15.0 + golang.org/x/sync v0.6.0 + golang.org/x/sys v0.16.0 + golang.org/x/term v0.16.0 golang.org/x/text v0.14.0 google.golang.org/protobuf v1.31.0 gopkg.in/inf.v0 v0.9.1 @@ -204,7 +204,7 @@ require ( go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect golang.org/x/arch v0.5.0 // indirect - golang.org/x/crypto v0.17.0 // indirect + golang.org/x/crypto v0.18.0 // indirect golang.org/x/mod v0.13.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/tools v0.14.0 // indirect diff --git a/go.sum b/go.sum index da17ada877..4175413db0 100644 --- a/go.sum +++ b/go.sum @@ -260,8 +260,8 @@ github.com/containers/common v0.57.2 h1:50Zp9VuXt2u5uNTKEc4aU2+PfWzFNAulD9JX43Vi github.com/containers/common v0.57.2/go.mod h1:ZG9ab1bEssX98ZBclWFIyzx4+MyUN8dXj1oSEugp7N0= github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg= github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I= -github.com/containers/gvisor-tap-vsock v0.7.1 h1:+Rc+sOPplrkQb/BUXeN0ug8TxjgyrIqo/9P/eNS2A4c= -github.com/containers/gvisor-tap-vsock v0.7.1/go.mod h1:WSSsjcuYZkvP8i0J+Ht3LF8yvysn3krD5zxQ74wz7y0= +github.com/containers/gvisor-tap-vsock v0.7.2 h1:6CyU5D85C0/DciRRd7W0bPljK4FAS+DPrrHEQMHfZKY= +github.com/containers/gvisor-tap-vsock v0.7.2/go.mod h1:6NiTxh2GCVxZQLPzfuEB78/Osp2Usd9uf6nLdd6PiUY= github.com/containers/image/v5 v5.29.1 h1:9COTXQpl3FgrW/jw/roLAWlW4TN9ly7/bCAKY76wYl8= github.com/containers/image/v5 v5.29.1/go.mod h1:kQ7qcDsps424ZAz24thD+x7+dJw1vgur3A9tTDsj97E= github.com/containers/libhvee v0.5.0 h1:rDhfG2NI8Q+VgeXht2dXezanxEdpj9pHqYX3vWfOGUw= @@ -302,8 +302,8 @@ github.com/coreos/go-systemd/v22 v22.5.1-0.20231103132048-7d375ecc2b09 h1:OoRAFl github.com/coreos/go-systemd/v22 v22.5.1-0.20231103132048-7d375ecc2b09/go.mod h1:m2r/smMKsKwgMSAoFKHaa68ImdCSNuKE1MxvQ64xuCQ= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/stream-metadata-go v0.4.3 h1:5GykJ8dtZSx1rdlzEAiDVzA73cwmUF3ceTuIP293L6E= -github.com/coreos/stream-metadata-go v0.4.3/go.mod h1:fMObQqQm8Ku91G04btKzEH3AsdP1mrAb986z9aaK0tE= +github.com/coreos/stream-metadata-go v0.4.4 h1:PM/6iNhofKGydsatiY1zdnMMHBT34skb5P7nfEFR4GU= +github.com/coreos/stream-metadata-go v0.4.4/go.mod h1:fMObQqQm8Ku91G04btKzEH3AsdP1mrAb986z9aaK0tE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -1175,8 +1175,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1287,8 +1287,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1381,16 +1381,16 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/hack/xref-helpmsgs-manpages b/hack/xref-helpmsgs-manpages index d8d32847ce..4b925737ea 100755 --- a/hack/xref-helpmsgs-manpages +++ b/hack/xref-helpmsgs-manpages @@ -85,7 +85,7 @@ for my $line (split "\n", $Format_Exceptions) { # added, with a --format option that does not autocomplete '{{.', # let's make sure it gets extra eyeballs. my %Format_Option_Is_Special = map { $_ => 1 } ( - 'build', 'image build', # oci | docker + 'build', 'farm build', 'image build', # oci | docker 'commit', 'container commit', # " " " " 'diff', 'container diff', 'image diff', # only supports "json" 'generate systemd', # " " " " diff --git a/pkg/api/handlers/libpod/images_push.go b/pkg/api/handlers/libpod/images_push.go index 2e587e650c..43d28f6620 100644 --- a/pkg/api/handlers/libpod/images_push.go +++ b/pkg/api/handlers/libpod/images_push.go @@ -81,7 +81,7 @@ func PushImage(w http.ResponseWriter, r *http.Request) { ForceCompressionFormat: query.ForceCompressionFormat, Format: query.Format, Password: password, - Quiet: true, + Quiet: query.Quiet, RemoveSignatures: query.RemoveSignatures, Username: username, } @@ -150,9 +150,9 @@ func PushImage(w http.ResponseWriter, r *http.Request) { } if pushError != nil { stream.Error = pushError.Error() - if err := enc.Encode(stream); err != nil { - logrus.Warnf("Failed to encode json: %v", err) - } + } + if err := enc.Encode(stream); err != nil { + logrus.Warnf("Failed to encode json: %v", err) } flush() return diff --git a/pkg/domain/entities/engine_image.go b/pkg/domain/entities/engine_image.go index 6702c3d1ab..fee4656fb0 100644 --- a/pkg/domain/entities/engine_image.go +++ b/pkg/domain/entities/engine_image.go @@ -45,6 +45,4 @@ type ImageEngine interface { //nolint:interfacebloat FarmNodeName(ctx context.Context) string FarmNodeDriver(ctx context.Context) string FarmNodeInspect(ctx context.Context) (*FarmInspectReport, error) - PullToFile(ctx context.Context, options PullToFileOptions) (string, error) - PullToLocal(ctx context.Context, options PullToLocalOptions) (string, error) } diff --git a/pkg/domain/entities/images.go b/pkg/domain/entities/images.go index b0bd43a5c3..45cebb55fb 100644 --- a/pkg/domain/entities/images.go +++ b/pkg/domain/entities/images.go @@ -492,19 +492,3 @@ type FarmInspectReport struct { Arch string Variant string } - -// PullToFileOptions are the options for pulling the images from farm -// nodes into a dir -type PullToFileOptions struct { - ImageID string - SaveFormat string - SaveFile string -} - -// PullToLocalOptions are the options for pulling the images from farm -// nodes into containers-storage -type PullToLocalOptions struct { - ImageID string - SaveFormat string - Destination ImageEngine -} diff --git a/pkg/domain/entities/types.go b/pkg/domain/entities/types.go index 5de661c155..6cf354a831 100644 --- a/pkg/domain/entities/types.go +++ b/pkg/domain/entities/types.go @@ -131,6 +131,10 @@ type BuildReport struct { type FarmBuildOptions struct { // Cleanup removes built images from farm nodes on success Cleanup bool + // Authfile is the path to the file holding registry credentials + Authfile string + // SkipTLSVerify skips tls verification when set to true + SkipTLSVerify bool } type IDOrNameResponse struct { diff --git a/pkg/domain/infra/abi/farm.go b/pkg/domain/infra/abi/farm.go index c7e103bbea..b4b47dd30b 100644 --- a/pkg/domain/infra/abi/farm.go +++ b/pkg/domain/infra/abi/farm.go @@ -6,12 +6,10 @@ package abi import ( "context" "fmt" - "os" "strings" "github.com/containers/buildah/pkg/parse" lplatform "github.com/containers/common/libimage/platform" - istorage "github.com/containers/image/v5/storage" "github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/emulation" ) @@ -57,64 +55,3 @@ func (ir *ImageEngine) FarmNodeInspect(ctx context.Context) (*entities.FarmInspe Arch: ir.arch, Variant: ir.variant}, ir.platformsErr } - -// PullToFile pulls the image from the remote engine and saves it to a file, -// returning a string-format reference which can be parsed by containers/image. -func (ir *ImageEngine) PullToFile(ctx context.Context, options entities.PullToFileOptions) (reference string, err error) { - saveOptions := entities.ImageSaveOptions{ - Format: options.SaveFormat, - Output: options.SaveFile, - } - if err := ir.Save(ctx, options.ImageID, nil, saveOptions); err != nil { - return "", fmt.Errorf("saving image %q: %w", options.ImageID, err) - } - return options.SaveFormat + ":" + options.SaveFile, nil -} - -// PullToFile pulls the image from the remote engine and saves it to the local -// engine passed in via options, returning a string-format reference which can -// be parsed by containers/image. -func (ir *ImageEngine) PullToLocal(ctx context.Context, options entities.PullToLocalOptions) (reference string, err error) { - destination := options.Destination - if destination == nil { - return "", fmt.Errorf("destination not given, cannot pull image %q", options.ImageID) - } - - // Check if the image is already present at destination - var br *entities.BoolReport - br, err = destination.Exists(ctx, options.ImageID) - if err != nil { - return "", err - } - if br.Value { - return istorage.Transport.Name() + ":" + options.ImageID, nil - } - - tempFile, err := os.CreateTemp("", "") - if err != nil { - return "", err - } - defer os.Remove(tempFile.Name()) - defer tempFile.Close() - - saveOptions := entities.ImageSaveOptions{ - Format: options.SaveFormat, - Output: tempFile.Name(), - } - // Save image built on builder in a temp file - if err := ir.Save(ctx, options.ImageID, nil, saveOptions); err != nil { - return "", fmt.Errorf("saving image %q: %w", options.ImageID, err) - } - - // Load the image saved in tempFile into the local engine - loadOptions := entities.ImageLoadOptions{ - Input: tempFile.Name(), - } - - _, err = destination.Load(ctx, loadOptions) - if err != nil { - return "", err - } - - return istorage.Transport.Name() + ":" + options.ImageID, nil -} diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index 16b2f92c11..6c06d68afe 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -39,6 +39,8 @@ import ( "github.com/sirupsen/logrus" ) +const UnknownDigestSuffix = docker.UnknownDigestSuffix + func (ir *ImageEngine) Exists(_ context.Context, nameOrID string) (*entities.BoolReport, error) { exists, err := ir.Libpod.LibimageRuntime().Exists(nameOrID) if err != nil { diff --git a/pkg/domain/infra/tunnel/farm.go b/pkg/domain/infra/tunnel/farm.go index 811c5e43eb..1dbde31789 100644 --- a/pkg/domain/infra/tunnel/farm.go +++ b/pkg/domain/infra/tunnel/farm.go @@ -2,11 +2,8 @@ package tunnel import ( "context" - "errors" "fmt" - "os" - istorage "github.com/containers/image/v5/storage" "github.com/containers/podman/v4/pkg/bindings/system" "github.com/containers/podman/v4/pkg/domain/entities" ) @@ -47,47 +44,3 @@ func (ir *ImageEngine) FarmNodeInspect(ctx context.Context) (*entities.FarmInspe Arch: ir.arch, Variant: ir.variant}, ir.platformsErr } - -// PullToFile pulls the image from the remote engine and saves it to a file, -// returning a string-format reference which can be parsed by containers/image. -func (ir *ImageEngine) PullToFile(ctx context.Context, options entities.PullToFileOptions) (reference string, err error) { - saveOptions := entities.ImageSaveOptions{ - Format: options.SaveFormat, - Output: options.SaveFile, - } - if err := ir.Save(ctx, options.ImageID, nil, saveOptions); err != nil { - return "", fmt.Errorf("saving image %q: %w", options.ImageID, err) - } - return options.SaveFormat + ":" + options.SaveFile, nil -} - -// PullToLocal pulls the image from the remote engine and saves it to the local -// engine passed in via options, returning a string-format reference which can -// be parsed by containers/image. -func (ir *ImageEngine) PullToLocal(ctx context.Context, options entities.PullToLocalOptions) (reference string, err error) { - tempFile, err := os.CreateTemp("", "") - if err != nil { - return "", err - } - defer os.Remove(tempFile.Name()) - defer tempFile.Close() - saveOptions := entities.ImageSaveOptions{ - Format: options.SaveFormat, - Output: tempFile.Name(), - } - if err := ir.Save(ctx, options.ImageID, nil, saveOptions); err != nil { - return "", fmt.Errorf("saving image %q to temporary file: %w", options.ImageID, err) - } - loadOptions := entities.ImageLoadOptions{ - Input: tempFile.Name(), - } - if options.Destination == nil { - return "", errors.New("internal error: options.Destination not set") - } else { - if _, err = options.Destination.Load(ctx, loadOptions); err != nil { - return "", fmt.Errorf("loading image %q: %w", options.ImageID, err) - } - } - name := fmt.Sprintf("%s:%s", istorage.Transport.Name(), options.ImageID) - return name, err -} diff --git a/pkg/farm/farm.go b/pkg/farm/farm.go index 174e52c8f3..d6224d6f3b 100644 --- a/pkg/farm/farm.go +++ b/pkg/farm/farm.go @@ -32,7 +32,7 @@ type Schedule struct { platformBuilders map[string]string // target->connection } -func newFarmWithBuilders(_ context.Context, name string, destinations *map[string]config.Destination, localEngine entities.ImageEngine) (*Farm, error) { +func newFarmWithBuilders(_ context.Context, name string, destinations *map[string]config.Destination, localEngine entities.ImageEngine, buildLocal bool) (*Farm, error) { farm := &Farm{ builders: make(map[string]entities.ImageEngine), localEngine: localEngine, @@ -66,7 +66,7 @@ func newFarmWithBuilders(_ context.Context, name string, destinations *map[strin }) } // If local=true then use the local machine for builds as well - if localEngine != nil { + if buildLocal { builderGroup.Go(func() error { fmt.Println("Setting up local builder") defer fmt.Println("Local builder ready") @@ -88,14 +88,14 @@ func newFarmWithBuilders(_ context.Context, name string, destinations *map[strin return nil, errors.New("no builders configured") } -func NewFarm(ctx context.Context, name string, localEngine entities.ImageEngine) (*Farm, error) { +func NewFarm(ctx context.Context, name string, localEngine entities.ImageEngine, buildLocal bool) (*Farm, error) { // Get the destinations of the connections specified in the farm destinations, err := getFarmDestinations(name) if err != nil { return nil, err } - return newFarmWithBuilders(ctx, name, &destinations, localEngine) + return newFarmWithBuilders(ctx, name, &destinations, localEngine, buildLocal) } // Done performs any necessary end-of-process cleanup for the farm's members. @@ -315,7 +315,7 @@ func (f *Farm) Schedule(ctx context.Context, platforms []string) (Schedule, erro // Build runs a build using the specified targetplatform:service map. If all // builds succeed, it copies the resulting images from the remote hosts to the // local service and builds a manifest list with the specified reference name. -func (f *Farm) Build(ctx context.Context, schedule Schedule, options entities.BuildOptions, reference string) error { +func (f *Farm) Build(ctx context.Context, schedule Schedule, options entities.BuildOptions, reference string, localEngine entities.ImageEngine) error { switch options.OutputFormat { default: return fmt.Errorf("unknown output format %q requested", options.OutputFormat) @@ -359,24 +359,13 @@ func (f *Farm) Build(ctx context.Context, schedule Schedule, options entities.Bu }) } - // Decide where the final result will be stored. - var ( - manifestListBuilder listBuilder - err error - ) listBuilderOptions := listBuilderOptions{ - cleanup: options.Cleanup, - iidFile: options.IIDFile, - } - if strings.HasPrefix(reference, "dir:") || f.localEngine == nil { - location := strings.TrimPrefix(reference, "dir:") - manifestListBuilder, err = newFileManifestListBuilder(location, listBuilderOptions) - if err != nil { - return fmt.Errorf("preparing to build list: %w", err) - } - } else { - manifestListBuilder = newLocalManifestListBuilder(reference, f.localEngine, listBuilderOptions) + cleanup: options.Cleanup, + iidFile: options.IIDFile, + authfile: options.Authfile, + skipTLSVerify: options.SkipTLSVerify, } + manifestListBuilder := newManifestListBuilder(reference, f.localEngine, listBuilderOptions) // Start builds in parallel and wait for them all to finish. var ( diff --git a/pkg/farm/list_builder.go b/pkg/farm/list_builder.go index 93bba29e8e..338c1606cd 100644 --- a/pkg/farm/list_builder.go +++ b/pkg/farm/list_builder.go @@ -3,31 +3,21 @@ package farm import ( "context" "fmt" - "io/fs" "os" - "path/filepath" "sync" - lmanifests "github.com/containers/common/libimage/manifests" - "github.com/containers/common/pkg/supplemented" - cp "github.com/containers/image/v5/copy" - "github.com/containers/image/v5/manifest" - "github.com/containers/image/v5/signature" - "github.com/containers/image/v5/transports/alltransports" + "github.com/containers/image/v5/docker" "github.com/containers/image/v5/types" "github.com/containers/podman/v4/pkg/domain/entities" "github.com/hashicorp/go-multierror" - v1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" ) -type listBuilder interface { - build(ctx context.Context, images map[entities.BuildReport]entities.ImageEngine) (string, error) -} - type listBuilderOptions struct { - cleanup bool - iidFile string + cleanup bool + iidFile string + authfile string + skipTLSVerify bool } type listLocal struct { @@ -38,7 +28,7 @@ type listLocal struct { // newLocalManifestListBuilder returns a manifest list builder which saves a // manifest list and images to local storage. -func newLocalManifestListBuilder(listName string, localEngine entities.ImageEngine, options listBuilderOptions) listBuilder { +func newManifestListBuilder(listName string, localEngine entities.ImageEngine, options listBuilderOptions) *listLocal { return &listLocal{ listName: listName, options: options, @@ -49,47 +39,42 @@ func newLocalManifestListBuilder(listName string, localEngine entities.ImageEngi // Build retrieves images from the build reports and assembles them into a // manifest list in local container storage. func (l *listLocal) build(ctx context.Context, images map[entities.BuildReport]entities.ImageEngine) (string, error) { - manifest := l.listName exists, err := l.localEngine.ManifestExists(ctx, l.listName) if err != nil { return "", err } // Create list if it doesn't exist if !exists.Value { - manifest, err = l.localEngine.ManifestCreate(ctx, l.listName, []string{}, entities.ManifestCreateOptions{}) + _, err = l.localEngine.ManifestCreate(ctx, l.listName, []string{}, entities.ManifestCreateOptions{SkipTLSVerify: types.NewOptionalBool(l.options.skipTLSVerify)}) if err != nil { return "", fmt.Errorf("creating manifest list %q: %w", l.listName, err) } } - // Pull the images into local storage + // Push the images to the registry given by the user var ( - pullGroup multierror.Group + pushGroup multierror.Group refsMutex sync.Mutex ) refs := []string{} for image, engine := range images { image, engine := image, engine - pullOptions := entities.PullToLocalOptions{ - ImageID: image.ID, - SaveFormat: image.SaveFormat, - Destination: l.localEngine, - } - pullGroup.Go(func() error { - logrus.Infof("copying image %s", image.ID) - defer logrus.Infof("copied image %s", image.ID) - ref, err := engine.PullToLocal(ctx, pullOptions) + pushGroup.Go(func() error { + logrus.Infof("pushing image %s", image.ID) + defer logrus.Infof("pushed image %s", image.ID) + // Push the image to the registry + report, err := engine.Push(ctx, image.ID, l.listName+docker.UnknownDigestSuffix, entities.ImagePushOptions{Authfile: l.options.authfile, Quiet: false, SkipTLSVerify: types.NewOptionalBool(l.options.skipTLSVerify)}) if err != nil { - return fmt.Errorf("pulling image %q to local storage: %w", image, err) + return fmt.Errorf("pushing image %q to registry: %w", image, err) } refsMutex.Lock() defer refsMutex.Unlock() - refs = append(refs, ref) + refs = append(refs, "docker://"+l.listName+"@"+report.ManifestDigest) return nil }) } - pullErrors := pullGroup.Wait() - err = pullErrors.ErrorOrNil() + pushErrors := pushGroup.Wait() + err = pushErrors.ErrorOrNil() if err != nil { return "", fmt.Errorf("building: %w", err) } @@ -119,17 +104,21 @@ func (l *listLocal) build(ctx context.Context, images map[entities.BuildReport]e // Clear the list in the event it already existed if exists.Value { - _, err = l.localEngine.ManifestListClear(ctx, manifest) + _, err = l.localEngine.ManifestListClear(ctx, l.listName) if err != nil { - return "", fmt.Errorf("error clearing list %q", manifest) + return "", fmt.Errorf("error clearing list %q", l.listName) } } // Add the images to the list - listID, err := l.localEngine.ManifestAdd(ctx, manifest, refs, entities.ManifestAddOptions{}) + listID, err := l.localEngine.ManifestAdd(ctx, l.listName, refs, entities.ManifestAddOptions{Authfile: l.options.authfile, SkipTLSVerify: types.NewOptionalBool(l.options.skipTLSVerify)}) if err != nil { return "", fmt.Errorf("adding images %q to list: %w", refs, err) } + _, err = l.localEngine.ManifestPush(ctx, l.listName, l.listName, entities.ImagePushOptions{Authfile: l.options.authfile, SkipTLSVerify: types.NewOptionalBool(l.options.skipTLSVerify)}) + if err != nil { + return "", err + } // Write the manifest list's ID file if we're expected to if l.options.iidFile != "" { @@ -140,158 +129,3 @@ func (l *listLocal) build(ctx context.Context, images map[entities.BuildReport]e return l.listName, nil } - -type listFiles struct { - directory string - options listBuilderOptions -} - -// newFileManifestListBuilder returns a manifest list builder which saves a manifest -// list and images to a specified directory in the non-standard dir: format. -func newFileManifestListBuilder(directory string, options listBuilderOptions) (listBuilder, error) { - if options.iidFile != "" { - return nil, fmt.Errorf("saving to dir: format doesn't use image IDs, --iidfile not supported") - } - return &listFiles{directory: directory, options: options}, nil -} - -// Build retrieves images from the build reports and assembles them into a -// manifest list in the configured directory. -func (m *listFiles) build(ctx context.Context, images map[entities.BuildReport]entities.ImageEngine) (string, error) { - listFormat := v1.MediaTypeImageIndex - imageFormat := v1.MediaTypeImageManifest - - tempDir, err := os.MkdirTemp("", "") - if err != nil { - return "", err - } - defer os.RemoveAll(tempDir) - - name := fmt.Sprintf("dir:%s", tempDir) - tempRef, err := alltransports.ParseImageName(name) - if err != nil { - return "", fmt.Errorf("parsing temporary image ref %q: %w", name, err) - } - if err := os.MkdirAll(m.directory, 0o755); err != nil { - return "", err - } - output, err := alltransports.ParseImageName("dir:" + m.directory) - if err != nil { - return "", fmt.Errorf("parsing output directory ref %q: %w", "dir:"+m.directory, err) - } - - // Pull the images into the temporary directory - var ( - pullGroup multierror.Group - pullErrors *multierror.Error - refsMutex sync.Mutex - ) - refs := make(map[entities.BuildReport]types.ImageReference) - for image, engine := range images { - image, engine := image, engine - tempFile, err := os.CreateTemp(tempDir, "archive-*.tar") - if err != nil { - defer func() { - pullErrors = pullGroup.Wait() - }() - perr := pullErrors.ErrorOrNil() - if perr != nil { - return "", perr - } - return "", err - } - defer tempFile.Close() - - pullGroup.Go(func() error { - logrus.Infof("copying image %s", image.ID) - defer logrus.Infof("copied image %s", image.ID) - pullOptions := entities.PullToFileOptions{ - ImageID: image.ID, - SaveFormat: image.SaveFormat, - SaveFile: tempFile.Name(), - } - if image.SaveFormat == manifest.DockerV2Schema2MediaType { - listFormat = manifest.DockerV2ListMediaType - imageFormat = manifest.DockerV2Schema2MediaType - } - reference, err := engine.PullToFile(ctx, pullOptions) - if err != nil { - return fmt.Errorf("pulling image %q to temporary directory: %w", image, err) - } - ref, err := alltransports.ParseImageName(reference) - if err != nil { - return fmt.Errorf("pulling image %q to temporary directory: %w", image, err) - } - refsMutex.Lock() - defer refsMutex.Unlock() - refs[image] = ref - return nil - }) - } - pullErrors = pullGroup.Wait() - err = pullErrors.ErrorOrNil() - if err != nil { - return "", fmt.Errorf("building: %w", err) - } - - if m.options.cleanup { - var rmGroup multierror.Group - for image, engine := range images { - image, engine := image, engine - rmGroup.Go(func() error { - _, err := engine.Remove(ctx, []string{image.ID}, entities.ImageRemoveOptions{}) - if len(err) > 0 { - return err[0] - } - return nil - }) - } - rmErrors := rmGroup.Wait() - if rmErrors != nil { - if err = rmErrors.ErrorOrNil(); err != nil { - return "", fmt.Errorf("removing intermediate images: %w", err) - } - } - } - - supplemental := []types.ImageReference{} - var sys types.SystemContext - // Create a manifest list - list := lmanifests.Create() - // Add the images to the list - for image, ref := range refs { - if _, err = list.Add(ctx, &sys, ref, true); err != nil { - return "", fmt.Errorf("adding image %q to list: %w", image.ID, err) - } - supplemental = append(supplemental, ref) - } - // Save the list to the temporary directory to be the main manifest - listBytes, err := list.Serialize(listFormat) - if err != nil { - return "", fmt.Errorf("serializing manifest list: %w", err) - } - if err = os.WriteFile(filepath.Join(tempDir, "manifest.json"), listBytes, fs.FileMode(0o600)); err != nil { - return "", fmt.Errorf("writing temporary manifest list: %w", err) - } - - // Now copy everything to the final dir: location - defaultPolicy, err := signature.DefaultPolicy(&sys) - if err != nil { - return "", err - } - policyContext, err := signature.NewPolicyContext(defaultPolicy) - if err != nil { - return "", err - } - input := supplemented.Reference(tempRef, supplemental, cp.CopyAllImages, nil) - copyOptions := cp.Options{ - ForceManifestMIMEType: imageFormat, - ImageListSelection: cp.CopyAllImages, - } - _, err = cp.Image(ctx, policyContext, output, input, ©Options) - if err != nil { - return "", fmt.Errorf("copying images to dir:%q: %w", m.directory, err) - } - - return "dir:" + m.directory, nil -} diff --git a/test/apiv2/12-imagesMore.at b/test/apiv2/12-imagesMore.at index 3534349e7c..584d7c3958 100644 --- a/test/apiv2/12-imagesMore.at +++ b/test/apiv2/12-imagesMore.at @@ -43,8 +43,23 @@ s1=$(jq -r .status <<<"${lines[1]}") like "$s1" "mytag: digest: sha256:[0-9a-f]\{64\} size: [0-9]\+" \ "Push to local registry: second status line" +# Push to local registry using the libpod endpoint with quiet=false... +# First create a new tag for the image to push +t POST "libpod/images/$IMAGE/tag?repo=localhost:$REGISTRY_PORT/myrepo&tag=quiet-false" 201 + +t POST "libpod/images/localhost:$REGISTRY_PORT/myrepo:quiet-false/push?tlsVerify=false&quiet=false" 200 + +# ...and check output. We can't use our built-in checks because this output +# is a sequence of JSON objects, i.e., individual ones, not in a JSON array. +# The lines themselves are valid JSON, but taken together they are not. +readarray lines <<<"$output" +s0=$(jq -r .manifestdigest <<<"${lines[-1]}") +like "$s0" "sha256:[0-9a-f]\{64\}" \ + "Push to local registry: last line in push report" + # Untag the image t POST "libpod/images/$iid/untag?repo=localhost:$REGISTRY_PORT/myrepo&tag=mytag" 201 +t POST "libpod/images/$iid/untag?repo=localhost:$REGISTRY_PORT/myrepo&tag=quiet-false" 201 # Try to push non-existing image t POST "images/localhost:$REGISTRY_PORT/idonotexist/push?tlsVerify=false" 404 diff --git a/test/farm/001-farm.bats b/test/farm/001-farm.bats index afddbd09ef..5eac972ab8 100644 --- a/test/farm/001-farm.bats +++ b/test/farm/001-farm.bats @@ -5,7 +5,6 @@ load helpers.bash - @test "farm - check farm has been created" { run_podman farm ls assert "$output" =~ $FARMNAME @@ -17,18 +16,20 @@ load helpers.bash empty_farm="empty-farm" # create an empty farm run_podman farm create $empty_farm - run_podman farm --farm $empty_farm build -t $iname $PODMAN_TMPDIR + run_podman farm build --farm $empty_farm --authfile $AUTHFILE --tls-verify=false -t $REGISTRY/$iname $FARM_TMPDIR assert "$output" =~ "Local builder ready" # get the system architecture run_podman info --format '{{.Host.Arch}}' ARCH=$output # inspect manifest list built and saved in local containers-storage - # FIXME: use --format? run_podman manifest inspect $iname assert "$output" =~ $ARCH - run_podman images -a + echo "# skopeo inspect ..." + run skopeo inspect "$@" --tls-verify=false --authfile $AUTHFILE docker://$REGISTRY/$iname + echo "$output" + is "$status" "0" "skopeo inspect - exit status" # FIXME-someday: why do we need the prune? run_podman manifest rm $iname @@ -37,18 +38,19 @@ load helpers.bash @test "farm - build on farm node only with --cleanup" { iname="test-image-2" - run_podman farm build --cleanup --local=false -t $iname $PODMAN_TMPDIR + run_podman farm build --cleanup --local=false --authfile $AUTHFILE --tls-verify=false -t $REGISTRY/$iname $FARM_TMPDIR assert "$output" =~ "Farm \"$FARMNAME\" ready" # get the system architecture run_podman info --format '{{.Host.Arch}}' ARCH=$output - # inspect manifest list built and saved in dir - # FIXME FIXME FIXME! #20505: do not write anything under cwd - ls -l $iname + # inspect manifest list built and saved in local containers-storage + run_podman manifest inspect $iname + assert "$output" =~ $ARCH - # FIXME FIXME FIXME FIXME! NEVER WRITE INTO PWD! - manifestarch=$(jq -r '.manifests[].platform.architecture' <$iname/manifest.json) - assert "$manifestarch" = "$ARCH" "arch from $iname/manifest.json" + echo "# skopeo inspect ..." + run skopeo inspect "$@" --tls-verify=false --authfile $AUTHFILE docker://$REGISTRY/$iname + echo "$output" + is "$status" "0" "skopeo inspect - exit status" # see if we can ssh into node to check the image was cleaned up run ssh $ROOTLESS_USER@localhost podman images --filter dangling=true --noheading @@ -58,21 +60,27 @@ load helpers.bash run_podman images --filter dangling=true --noheading assert "$output" = "" "podman images on local host" + run_podman manifest rm $iname run_podman image prune -f } @test "farm - build on farm node and local" { iname="test-image-3" - run_podman farm build -t $iname $PODMAN_TMPDIR + run_podman farm build --authfile $AUTHFILE --tls-verify=false -t $REGISTRY/$iname $FARM_TMPDIR assert "$output" =~ "Farm \"$FARMNAME\" ready" # get the system architecture run_podman info --format '{{.Host.Arch}}' ARCH=$output - # inspect manifest list built and saved in dir + # inspect manifest list built and saved run_podman manifest inspect $iname assert "$output" =~ $ARCH + echo "# skopeo inspect ..." + run skopeo inspect "$@" --tls-verify=false --authfile $AUTHFILE docker://$REGISTRY/$iname + echo "$output" + is "$status" "0" "skopeo inspect - exit status" + run_podman manifest rm $iname run_podman image prune -f } @@ -81,15 +89,21 @@ load helpers.bash @test "farm - build on farm node only (podman-remote)" { iname="test-image-4" - run_podman --remote farm build -t $iname $PODMAN_TMPDIR + run_podman --remote farm build --authfile $AUTHFILE --tls-verify=false -t $REGISTRY/$iname $FARM_TMPDIR assert "$output" =~ "Farm \"$FARMNAME\" ready" # get the system architecture run_podman --remote info --format '{{.Host.Arch}}' ARCH=$output - # inspect manifest list built and saved in dir - manifestarch=$(jq -r '.manifests[].platform.architecture' <$iname/manifest.json) - assert "$manifestarch" = "$ARCH" "arch from $iname/manifest.json" + # inspect manifest list built and saved + run_podman manifest inspect $iname + assert "$output" =~ $ARCH + echo "# skopeo inspect ..." + run skopeo inspect "$@" --tls-verify=false --authfile $AUTHFILE docker://$REGISTRY/$iname + echo "$output" + is "$status" "0" "skopeo inspect - exit status" + + run_podman manifest rm $iname run_podman image prune -f } diff --git a/test/farm/helpers.bash b/test/farm/helpers.bash index 6d99b023ea..47c458e536 100644 --- a/test/farm/helpers.bash +++ b/test/farm/helpers.bash @@ -2,11 +2,13 @@ load ../system/helpers.bash +export FARM_TMPDIR=$(mktemp -d --tmpdir=${BATS_TMPDIR:-/tmp} podman_bats.XXXXXX) + function setup(){ basic_setup # Always create the same containerfile - cat >$PODMAN_TMPDIR/Containerfile <$FARM_TMPDIR/Containerfile <> 63 - return -} - -func bitsSub64(x, y, borrow uint64) (diff, borrowOut uint64) { - diff = x - y - borrow - borrowOut = ((^x & y) | (^(x ^ y) & diff)) >> 63 - return -} - -func bitsMul64(x, y uint64) (hi, lo uint64) { - const mask32 = 1<<32 - 1 - x0 := x & mask32 - x1 := x >> 32 - y0 := y & mask32 - y1 := y >> 32 - w0 := x0 * y0 - t := x1*y0 + w0>>32 - w1 := t & mask32 - w2 := t >> 32 - w1 += x0 * y1 - hi = x1*y1 + w2 + w1>>32 - lo = x * y - return -} diff --git a/vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go b/vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go deleted file mode 100644 index 495c1fa697..0000000000 --- a/vendor/golang.org/x/crypto/internal/poly1305/bits_go1.13.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.13 - -package poly1305 - -import "math/bits" - -func bitsAdd64(x, y, carry uint64) (sum, carryOut uint64) { - return bits.Add64(x, y, carry) -} - -func bitsSub64(x, y, borrow uint64) (diff, borrowOut uint64) { - return bits.Sub64(x, y, borrow) -} - -func bitsMul64(x, y uint64) (hi, lo uint64) { - return bits.Mul64(x, y) -} diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go index e041da5ea3..ec2202bd7d 100644 --- a/vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go @@ -7,7 +7,10 @@ package poly1305 -import "encoding/binary" +import ( + "encoding/binary" + "math/bits" +) // Poly1305 [RFC 7539] is a relatively simple algorithm: the authentication tag // for a 64 bytes message is approximately @@ -114,13 +117,13 @@ type uint128 struct { } func mul64(a, b uint64) uint128 { - hi, lo := bitsMul64(a, b) + hi, lo := bits.Mul64(a, b) return uint128{lo, hi} } func add128(a, b uint128) uint128 { - lo, c := bitsAdd64(a.lo, b.lo, 0) - hi, c := bitsAdd64(a.hi, b.hi, c) + lo, c := bits.Add64(a.lo, b.lo, 0) + hi, c := bits.Add64(a.hi, b.hi, c) if c != 0 { panic("poly1305: unexpected overflow") } @@ -155,8 +158,8 @@ func updateGeneric(state *macState, msg []byte) { // hide leading zeroes. For full chunks, that's 1 << 128, so we can just // add 1 to the most significant (2¹²⁸) limb, h2. if len(msg) >= TagSize { - h0, c = bitsAdd64(h0, binary.LittleEndian.Uint64(msg[0:8]), 0) - h1, c = bitsAdd64(h1, binary.LittleEndian.Uint64(msg[8:16]), c) + h0, c = bits.Add64(h0, binary.LittleEndian.Uint64(msg[0:8]), 0) + h1, c = bits.Add64(h1, binary.LittleEndian.Uint64(msg[8:16]), c) h2 += c + 1 msg = msg[TagSize:] @@ -165,8 +168,8 @@ func updateGeneric(state *macState, msg []byte) { copy(buf[:], msg) buf[len(msg)] = 1 - h0, c = bitsAdd64(h0, binary.LittleEndian.Uint64(buf[0:8]), 0) - h1, c = bitsAdd64(h1, binary.LittleEndian.Uint64(buf[8:16]), c) + h0, c = bits.Add64(h0, binary.LittleEndian.Uint64(buf[0:8]), 0) + h1, c = bits.Add64(h1, binary.LittleEndian.Uint64(buf[8:16]), c) h2 += c msg = nil @@ -219,9 +222,9 @@ func updateGeneric(state *macState, msg []byte) { m3 := h2r1 t0 := m0.lo - t1, c := bitsAdd64(m1.lo, m0.hi, 0) - t2, c := bitsAdd64(m2.lo, m1.hi, c) - t3, _ := bitsAdd64(m3.lo, m2.hi, c) + t1, c := bits.Add64(m1.lo, m0.hi, 0) + t2, c := bits.Add64(m2.lo, m1.hi, c) + t3, _ := bits.Add64(m3.lo, m2.hi, c) // Now we have the result as 4 64-bit limbs, and we need to reduce it // modulo 2¹³⁰ - 5. The special shape of this Crandall prime lets us do @@ -243,14 +246,14 @@ func updateGeneric(state *macState, msg []byte) { // To add c * 5 to h, we first add cc = c * 4, and then add (cc >> 2) = c. - h0, c = bitsAdd64(h0, cc.lo, 0) - h1, c = bitsAdd64(h1, cc.hi, c) + h0, c = bits.Add64(h0, cc.lo, 0) + h1, c = bits.Add64(h1, cc.hi, c) h2 += c cc = shiftRightBy2(cc) - h0, c = bitsAdd64(h0, cc.lo, 0) - h1, c = bitsAdd64(h1, cc.hi, c) + h0, c = bits.Add64(h0, cc.lo, 0) + h1, c = bits.Add64(h1, cc.hi, c) h2 += c // h2 is at most 3 + 1 + 1 = 5, making the whole of h at most @@ -287,9 +290,9 @@ func finalize(out *[TagSize]byte, h *[3]uint64, s *[2]uint64) { // in constant time, we compute t = h - (2¹³⁰ - 5), and select h as the // result if the subtraction underflows, and t otherwise. - hMinusP0, b := bitsSub64(h0, p0, 0) - hMinusP1, b := bitsSub64(h1, p1, b) - _, b = bitsSub64(h2, p2, b) + hMinusP0, b := bits.Sub64(h0, p0, 0) + hMinusP1, b := bits.Sub64(h1, p1, b) + _, b = bits.Sub64(h2, p2, b) // h = h if h < p else h - p h0 = select64(b, h0, hMinusP0) @@ -301,8 +304,8 @@ func finalize(out *[TagSize]byte, h *[3]uint64, s *[2]uint64) { // // by just doing a wide addition with the 128 low bits of h and discarding // the overflow. - h0, c := bitsAdd64(h0, s[0], 0) - h1, _ = bitsAdd64(h1, s[1], c) + h0, c := bits.Add64(h0, s[0], 0) + h1, _ = bits.Add64(h1, s[1], c) binary.LittleEndian.PutUint64(out[0:8], h0) binary.LittleEndian.PutUint64(out[8:16], h1) diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index b18efb743f..948a3ee63d 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -4,6 +4,9 @@ // Package errgroup provides synchronization, error propagation, and Context // cancelation for groups of goroutines working on subtasks of a common task. +// +// [errgroup.Group] is related to [sync.WaitGroup] but adds handling of tasks +// returning errors. package errgroup import ( diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 6202638bae..c6492020ec 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -248,6 +248,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -283,10 +284,6 @@ struct ltchars { #include #endif -#ifndef MSG_FASTOPEN -#define MSG_FASTOPEN 0x20000000 -#endif - #ifndef PTRACE_GETREGS #define PTRACE_GETREGS 0xc #endif @@ -295,14 +292,6 @@ struct ltchars { #define PTRACE_SETREGS 0xd #endif -#ifndef SOL_NETLINK -#define SOL_NETLINK 270 -#endif - -#ifndef SOL_SMC -#define SOL_SMC 286 -#endif - #ifdef SOL_BLUETOOTH // SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h // but it is already in bluetooth_linux.go @@ -319,10 +308,23 @@ struct ltchars { #undef TIPC_WAIT_FOREVER #define TIPC_WAIT_FOREVER 0xffffffff -// Copied from linux/l2tp.h -// Including linux/l2tp.h here causes conflicts between linux/in.h -// and netinet/in.h included via net/route.h above. -#define IPPROTO_L2TP 115 +// Copied from linux/netfilter/nf_nat.h +// Including linux/netfilter/nf_nat.h here causes conflicts between linux/in.h +// and netinet/in.h. +#define NF_NAT_RANGE_MAP_IPS (1 << 0) +#define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1) +#define NF_NAT_RANGE_PROTO_RANDOM (1 << 2) +#define NF_NAT_RANGE_PERSISTENT (1 << 3) +#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4) +#define NF_NAT_RANGE_PROTO_OFFSET (1 << 5) +#define NF_NAT_RANGE_NETMAP (1 << 6) +#define NF_NAT_RANGE_PROTO_RANDOM_ALL \ + (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY) +#define NF_NAT_RANGE_MASK \ + (NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED | \ + NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PERSISTENT | \ + NF_NAT_RANGE_PROTO_RANDOM_FULLY | NF_NAT_RANGE_PROTO_OFFSET | \ + NF_NAT_RANGE_NETMAP) // Copied from linux/hid.h. // Keep in sync with the size of the referenced fields. @@ -603,6 +605,9 @@ ccflags="$@" $2 ~ /^FSOPT_/ || $2 ~ /^WDIO[CFS]_/ || $2 ~ /^NFN/ || + $2 !~ /^NFT_META_IIFTYPE/ && + $2 ~ /^NFT_/ || + $2 ~ /^NF_NAT_/ || $2 ~ /^XDP_/ || $2 ~ /^RWF_/ || $2 ~ /^(HDIO|WIN|SMART)_/ || diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index c73cfe2f10..a5d3ff8df9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -2127,6 +2127,60 @@ const ( NFNL_SUBSYS_QUEUE = 0x3 NFNL_SUBSYS_ULOG = 0x4 NFS_SUPER_MAGIC = 0x6969 + NFT_CHAIN_FLAGS = 0x7 + NFT_CHAIN_MAXNAMELEN = 0x100 + NFT_CT_MAX = 0x17 + NFT_DATA_RESERVED_MASK = 0xffffff00 + NFT_DATA_VALUE_MAXLEN = 0x40 + NFT_EXTHDR_OP_MAX = 0x4 + NFT_FIB_RESULT_MAX = 0x3 + NFT_INNER_MASK = 0xf + NFT_LOGLEVEL_MAX = 0x8 + NFT_NAME_MAXLEN = 0x100 + NFT_NG_MAX = 0x1 + NFT_OBJECT_CONNLIMIT = 0x5 + NFT_OBJECT_COUNTER = 0x1 + NFT_OBJECT_CT_EXPECT = 0x9 + NFT_OBJECT_CT_HELPER = 0x3 + NFT_OBJECT_CT_TIMEOUT = 0x7 + NFT_OBJECT_LIMIT = 0x4 + NFT_OBJECT_MAX = 0xa + NFT_OBJECT_QUOTA = 0x2 + NFT_OBJECT_SECMARK = 0x8 + NFT_OBJECT_SYNPROXY = 0xa + NFT_OBJECT_TUNNEL = 0x6 + NFT_OBJECT_UNSPEC = 0x0 + NFT_OBJ_MAXNAMELEN = 0x100 + NFT_OSF_MAXGENRELEN = 0x10 + NFT_QUEUE_FLAG_BYPASS = 0x1 + NFT_QUEUE_FLAG_CPU_FANOUT = 0x2 + NFT_QUEUE_FLAG_MASK = 0x3 + NFT_REG32_COUNT = 0x10 + NFT_REG32_SIZE = 0x4 + NFT_REG_MAX = 0x4 + NFT_REG_SIZE = 0x10 + NFT_REJECT_ICMPX_MAX = 0x3 + NFT_RT_MAX = 0x4 + NFT_SECMARK_CTX_MAXLEN = 0x100 + NFT_SET_MAXNAMELEN = 0x100 + NFT_SOCKET_MAX = 0x3 + NFT_TABLE_F_MASK = 0x3 + NFT_TABLE_MAXNAMELEN = 0x100 + NFT_TRACETYPE_MAX = 0x3 + NFT_TUNNEL_F_MASK = 0x7 + NFT_TUNNEL_MAX = 0x1 + NFT_TUNNEL_MODE_MAX = 0x2 + NFT_USERDATA_MAXLEN = 0x100 + NFT_XFRM_KEY_MAX = 0x6 + NF_NAT_RANGE_MAP_IPS = 0x1 + NF_NAT_RANGE_MASK = 0x7f + NF_NAT_RANGE_NETMAP = 0x40 + NF_NAT_RANGE_PERSISTENT = 0x8 + NF_NAT_RANGE_PROTO_OFFSET = 0x20 + NF_NAT_RANGE_PROTO_RANDOM = 0x4 + NF_NAT_RANGE_PROTO_RANDOM_ALL = 0x14 + NF_NAT_RANGE_PROTO_RANDOM_FULLY = 0x10 + NF_NAT_RANGE_PROTO_SPECIFIED = 0x2 NILFS_SUPER_MAGIC = 0x3434 NL0 = 0x0 NL1 = 0x100 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index a1d061597c..9dc42410b7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 5b2a740977..0d3a0751cd 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index f6eda1344a..c39f7776db 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 55df20ae9d..57571d072f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 8c1155cbc0..e62963e67e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 7cc80c58d9..00831354c8 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 0688737f49..79029ed584 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -2297,5 +2297,3 @@ func unveil(path *byte, flags *byte) (err error) { var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" - - diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 47dc579676..ffb8708ccf 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -194,6 +194,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys GetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW //sys GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) = GetComputerNameExW //sys SetEndOfFile(handle Handle) (err error) +//sys SetFileValidData(handle Handle, validDataLength int64) (err error) //sys GetSystemTimeAsFileTime(time *Filetime) //sys GetSystemTimePreciseAsFileTime(time *Filetime) //sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff] diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 146a1f0196..e8791c82c3 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -342,6 +342,7 @@ var ( procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories") procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW") procSetEndOfFile = modkernel32.NewProc("SetEndOfFile") + procSetFileValidData = modkernel32.NewProc("SetFileValidData") procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW") procSetErrorMode = modkernel32.NewProc("SetErrorMode") procSetEvent = modkernel32.NewProc("SetEvent") @@ -2988,6 +2989,14 @@ func SetEndOfFile(handle Handle) (err error) { return } +func SetFileValidData(handle Handle, validDataLength int64) (err error) { + r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0) if r1 == 0 { diff --git a/vendor/modules.txt b/vendor/modules.txt index 60fa5a17c6..90a7ae80ec 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -231,7 +231,7 @@ github.com/containers/common/version # github.com/containers/conmon v2.0.20+incompatible ## explicit github.com/containers/conmon/runner/config -# github.com/containers/gvisor-tap-vsock v0.7.1 +# github.com/containers/gvisor-tap-vsock v0.7.2 ## explicit; go 1.20 github.com/containers/gvisor-tap-vsock/pkg/types # github.com/containers/image/v5 v5.29.1 @@ -407,7 +407,7 @@ github.com/coreos/go-systemd/v22/dbus github.com/coreos/go-systemd/v22/internal/dlopen github.com/coreos/go-systemd/v22/journal github.com/coreos/go-systemd/v22/sdjournal -# github.com/coreos/stream-metadata-go v0.4.3 +# github.com/coreos/stream-metadata-go v0.4.4 ## explicit; go 1.18 github.com/coreos/stream-metadata-go/fedoracoreos github.com/coreos/stream-metadata-go/fedoracoreos/internals @@ -1116,7 +1116,7 @@ go.opentelemetry.io/otel/trace # golang.org/x/arch v0.5.0 ## explicit; go 1.17 golang.org/x/arch/x86/x86asm -# golang.org/x/crypto v0.17.0 +# golang.org/x/crypto v0.18.0 ## explicit; go 1.18 golang.org/x/crypto/argon2 golang.org/x/crypto/blake2b @@ -1176,11 +1176,11 @@ golang.org/x/net/trace ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sync v0.5.0 +# golang.org/x/sync v0.6.0 ## explicit; go 1.18 golang.org/x/sync/errgroup golang.org/x/sync/semaphore -# golang.org/x/sys v0.15.0 +# golang.org/x/sys v0.16.0 ## explicit; go 1.18 golang.org/x/sys/cpu golang.org/x/sys/execabs @@ -1189,7 +1189,7 @@ golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry golang.org/x/sys/windows/svc/eventlog -# golang.org/x/term v0.15.0 +# golang.org/x/term v0.16.0 ## explicit; go 1.18 golang.org/x/term # golang.org/x/text v0.14.0 diff --git a/winmake.ps1 b/winmake.ps1 index e3e12b7ff1..d00c15be48 100644 --- a/winmake.ps1 +++ b/winmake.ps1 @@ -37,7 +37,7 @@ function Win-SSHProxy { New-Item -ItemType Directory -Force -Path "./bin/windows" if (-Not $Version) { - $Version = "v0.7.1" + $Version = "v0.7.2" } curl.exe -sSL -o "./bin/windows/gvproxy.exe" --retry 5 "https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/gvproxy-windowsgui.exe" curl.exe -sSL -o "./bin/windows/win-sshproxy.exe" --retry 5 "https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/win-sshproxy.exe"