From 0657d238833c126714d3f88295a0219a4e03da4c Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Fri, 4 Feb 2022 13:57:03 +0100 Subject: [PATCH] containers-common-1-18.el9 - sync vendored components - Related: #2000051 Signed-off-by: Jindrich Novy --- containers-auth.json.5.md | 2 +- containers-common.spec | 12 +++-- containers-storage.conf.5.md | 27 +++++++++++- containers.conf | 71 +++++++++++++++++++++++------- containers.conf.5.md | 85 ++++++++++++++++++++++++++++-------- seccomp.json | 34 ++++++++++----- storage.conf | 17 +++++++- 7 files changed, 197 insertions(+), 51 deletions(-) diff --git a/containers-auth.json.5.md b/containers-auth.json.5.md index 892cb70..4030a06 100644 --- a/containers-auth.json.5.md +++ b/containers-auth.json.5.md @@ -11,7 +11,7 @@ on Windows and macOS, at `$HOME/.config/containers/auth.json`. When searching for the credential for a registry, the following files will be read in sequence until the valid credential is found: first reading the primary (read/write) file, or the explicit override using an option of the calling application. -If credentials are not present, search in `${XDG\_CONFIG\_HOME}/containers/auth.json`, `$HOME/.docker/config.json`, `$HOME/.dockercfg`. +If credentials are not present, search in `${XDG_CONFIG_HOME}/containers/auth.json` (usually `~/.config/containers/auth.json`), `$HOME/.docker/config.json`, `$HOME/.dockercfg`. Except the primary (read/write) file, other files are read-only, unless the user use an option of the calling application explicitly points at it as an override. diff --git a/containers-common.spec b/containers-common.spec index 13d384d..7e4116e 100644 --- a/containers-common.spec +++ b/containers-common.spec @@ -4,15 +4,15 @@ # pick the oldest version on c/image, c/common, c/storage vendored in # podman/skopeo/podman. %global skopeo_branch main -%global image_branch v5.17.0 -%global common_branch v0.44.4 -%global storage_branch v1.37.0 +%global image_branch v5.19.0 +%global common_branch v0.47.1 +%global storage_branch v1.38.1 %global shortnames_branch main Epoch: 2 Name: containers-common Version: 1 -Release: 17%{?dist} +Release: 18%{?dist} Summary: Common configuration and documentation for containers License: ASL 2.0 BuildArch: noarch @@ -160,6 +160,10 @@ EOF %{_datadir}/rhel/secrets/* %changelog +* Fri Feb 04 2022 Jindrich Novy - 2:1-18 +- sync vendored components +- Related: #2000051 + * Mon Jan 17 2022 Jindrich Novy - 2:1-17 - sync shortname aliases via Pyxis - Related: #2000051 diff --git a/containers-storage.conf.5.md b/containers-storage.conf.5.md index d06ca09..8a82bdc 100644 --- a/containers-storage.conf.5.md +++ b/containers-storage.conf.5.md @@ -38,7 +38,21 @@ The `storage` table supports the following options: container storage graph dir (default: "/var/lib/containers/storage") Default directory to store all writable content created by container storage programs. The rootless graphroot path supports environment variable substitutions (ie. `$HOME/containers/storage`) + When changing the graphroot location on an SELINUX system, ensure + the labeling matches the default locations labels with the + following commands: + +``` +# semanage fcontext -a -e /var/lib/containers/storage /NEWSTORAGEPATH +# restorecon -R -v /NEWSTORAGEPATH +``` + In Rootless Mode you would set + +``` +# semanage fcontext -a -e $HOME/.local/share/containers NEWSTORAGEPATH +$ restorecon -R -v /NEWSTORAGEPATH +``` **rootless_storage_path**="$HOME/.local/share/containers/storage" Storage path for rootless users. By default the graphroot for rootless users is set to `$XDG_DATA_HOME/containers/storage`, if XDG_DATA_HOME is set. @@ -259,6 +273,13 @@ semanage fcontext -a -e /var/lib/containers NEWSTORAGEPATH restorecon -R -v NEWSTORAGEPATH ``` +In rootless mode, you would set + +``` +semanage fcontext -a -e $HOME/.local/share/containers NEWSTORAGEPATH +restorecon -R -v NEWSTORAGEPATH +``` + The semanage command above tells SELinux to setup the default labeling of `NEWSTORAGEPATH` to match `/var/lib/containers`. The `restorecon` command tells SELinux to apply the labels to the actual content. Now all new content created in these directories will automatically be created with the correct label. @@ -294,7 +315,11 @@ This is a way to prevent xfs_quota management from conflicting with containers/s ## FILES -Distributions often provide a `/usr/share/containers/storage.conf` file to define default storage configuration. Administrators can override this file by creating `/etc/containers/storage.conf` to specify their own configuration. The storage.conf file for rootless users is stored in the `$XDG_CONFIG_HOME/containers/storage.conf` file. If `$XDG_CONFIG_HOME` is not set then the file `$HOME/.config/containers/storage.conf` is used. +Distributions often provide a `/usr/share/containers/storage.conf` file to define default storage configuration. Administrators can override this file by creating `/etc/containers/storage.conf` to specify their own configuration. Likewise rootless users can create a storage.conf file to override the system storage.conf files. Files should be stored in the `$XDG_CONFIG_HOME/containers/storage.conf` file. If `$XDG_CONFIG_HOME` is not set then the file `$HOME/.config/containers/storage.conf` is used. + +Note: The storage.conf file overrides all other strorage.conf files. Container +engines run by users with a storage.conf file in their home directory do not +use options in the system storage.conf files. /etc/projects - XFS persistent project root definition /etc/projid - XFS project name mapping file diff --git a/containers.conf b/containers.conf index 3617777..4232629 100644 --- a/containers.conf +++ b/containers.conf @@ -198,10 +198,6 @@ default_sysctls = [ # #prepare_volume_on_create = false -# Indicates the networking to be used for rootless containers -# -#rootless_networking = "slirp4netns" - # Path to the seccomp.json profile which is used as the default seccomp profile # for the runtime. # @@ -250,9 +246,6 @@ default_sysctls = [ # #volumes = [] -# The network table contains settings pertaining to the management of -# CNI plugins. - [secrets] #driver = "file" @@ -261,6 +254,16 @@ default_sysctls = [ [network] +# Network backend determines what network driver will be used to set up and tear down container networks. +# Valid values are "cni" and "netavark". +# The default value is empty which means that it will automatically choose CNI or netavark. If there are +# already containers/images or CNI networks preset it will choose CNI. +# +# Before changing this value all containers must be stopped otherwise it is likely that +# iptables rules and network interfaces might leak on the host. A reboot will fix this. +# +#network_backend = "" + # Path to directory where CNI plugin binaries are located. # #cni_plugin_dirs = [ @@ -271,18 +274,22 @@ default_sysctls = [ # "/opt/cni/bin", #] -# The network name of the default CNI network to attach pods to. +# The network name of the default network to attach pods to. # #default_network = "podman" -# The default subnet for the default CNI network given in default_network. +# The default subnet for the default network given in default_network. # If a network with that name does not exist, a new network using that name and # this subnet will be created. # Must be a valid IPv4 CIDR prefix. # #default_subnet = "10.88.0.0/16" -# Path to the directory where CNI configuration files are located. +# Path to the directory where network configuration files are located. +# For the CNI backend the default is "/etc/cni/net.d" as root +# and "$HOME/.config/cni/net.d" as rootless. +# For the netavark backend "/etc/containers/networks" is used as root +# and "$graphroot/networks" as rootless. # #network_config_dir = "/etc/cni/net.d/" @@ -291,6 +298,12 @@ default_sysctls = [ # #active_service = production +# The compression format to use when pushing an image. +# Valid options are: `gzip`, `zstd` and `zstd:chunked`. +# +#compression_format = "gzip" + + # Cgroup management implementation used for the runtime. # Valid options "systemd" or "cgroupfs" # @@ -314,6 +327,11 @@ default_sysctls = [ # "/usr/local/sbin/conmon" #] +# Enforces using docker.io for completing short names in Podman's compatibility +# REST API. Note that this will ignore unqualified-search-registries and +# short-name aliases defined in containers-registries.conf(5). +#compat_api_enforce_docker_hub = true + # Specify the keys sequence used to detach a container. # Format is a single character [a-Z] or a comma separated sequence of # `ctrl-`, where `` is one of: @@ -337,6 +355,9 @@ default_sysctls = [ # #env = [] +# Define where event logs will be stored, when events_logger is "file". +#events_logfile_path="" + # Selects which logging mechanism to use for container engine events. # Valid values are `journald`, `file` and `none`. # @@ -420,7 +441,7 @@ infra_image = "registry.access.redhat.com/ubi8/pause" # Default options to pass to the slirp4netns binary. # For example "allow_host_loopback=true" # -#network_cmd_options = [] +#network_cmd_options = ["enable_ipv6=true",] # Whether to use chroot instead of pivot_root in the runtime # @@ -450,15 +471,25 @@ runtime = "crun" # List of the OCI runtimes that support --format=json. When json is supported # engine will use it for reporting nicer errors. # -#runtime_supports_json = ["crun", "runc", "kata", "runsc"] +#runtime_supports_json = ["crun", "runc", "kata", "runsc", "krun"] # List of the OCI runtimes that supports running containers with KVM Separation. # -#runtime_supports_kvm = ["kata"] +#runtime_supports_kvm = ["kata", "krun"] # List of the OCI runtimes that supports running containers without cgroups. # -#runtime_supports_nocgroups = ["crun"] +#runtime_supports_nocgroups = ["crun", "krun"] + +# Default location for storing temporary container image content. Can be overridden with the TMPDIR environment +# variable. If you specify "storage", then the location of the +# container/storage tmp directory will be used. +# image_copy_tmp_dir="/var/tmp" + +# Number of seconds to wait without a connection +# before the `podman system service` times out and exits +# +#service_timeout = 5 # Directory for persistent engine files (database, etc) # By default, this will be configured relative to where the containers/storage @@ -497,7 +528,7 @@ runtime = "crun" # #volume_path = "/var/lib/containers/storage/volumes" -# Paths to look for a valid OCI runtime (crun, runc, kata, runsc, etc) +# Paths to look for a valid OCI runtime (crun, runc, kata, runsc, krun, etc) [engine.runtimes] #crun = [ # "/usr/bin/crun", @@ -540,6 +571,11 @@ runtime = "crun" # "/run/current-system/sw/bin/runsc", #] +#krun = [ +# "/usr/bin/krun", +# "/usr/local/bin/krun", +#] + [engine.volume_plugins] #testplugin = "/run/podman/plugins/test.sock" @@ -560,6 +596,11 @@ runtime = "crun" # #memory=2048 +# The username to use and create on the podman machine OS for rootless +# container access. +# +#user = "core" + # The [machine] table MUST be the last entry in this file. # (Unless another table is added) # TOML does not provide a way to end a table other than a further table being diff --git a/containers.conf.5.md b/containers.conf.5.md index e58a099..7855ce0 100644 --- a/containers.conf.5.md +++ b/containers.conf.5.md @@ -47,8 +47,7 @@ TOML can be simplified to: option = value ## CONTAINERS TABLE -The containers table contains settings pertaining to the OCI runtime that can -configure and manage the OCI runtime. +The containers table contains settings to configure and manage the OCI runtime. **annotations** = [] List of annotations. Specified as "key=value" pairs to be added to all containers. @@ -223,11 +222,6 @@ is imposed. Copy the content from the underlying image into the newly created volume when the container is created instead of when it is started. If `false`, the container engine will not copy the content until the container is started. Setting it to `true` may have negative performance implications. -**rootless_networking**="slirp4netns" - -Set type of networking rootless containers should use. Valid options are `slirp4netns` -or `cni`. - **seccomp_profile**="/usr/share/containers/seccomp.json" Path to the seccomp.json profile which is used as the default seccomp profile @@ -279,6 +273,16 @@ Options are: The `network` table contains settings pertaining to the management of CNI plugins. +**network_backend**="" + +Network backend determines what network driver will be used to set up and tear down container networks. +Valid values are "cni" and "netavark". +The default value is empty which means that it will automatically choose CNI or netavark. If there are +already containers/images or CNI networks preset it will choose CNI. + +Before changing this value all containers must be stopped otherwise it is likely that +iptables rules and network interfaces might leak on the host. A reboot will fix this. + **cni_plugin_dirs**=[] List of paths to directories where CNI plugin binaries are located. @@ -296,16 +300,20 @@ cni_plugin_dirs = [ **default_network**="podman" -The network name of the default CNI network to attach pods to. +The network name of the default network to attach pods to. **default_subnet**="10.88.0.0/16" -The subnet to use for the default CNI network (named above in **default_network**). +The subnet to use for the default network (named above in **default_network**). If the default network does not exist, it will be automatically created the first time a tool is run using this subnet. **network_config_dir**="/etc/cni/net.d/" -Path to the directory where CNI configuration files are located. +Path to the directory where network configuration files are located. +For the CNI backend the default is "/etc/cni/net.d" as root +and "$HOME/.config/cni/net.d" as rootless. +For the netavark backend "/etc/containers/networks" is used as root +and "$graphroot/networks" as rootless. **volumes**=[] @@ -373,6 +381,10 @@ Environment variables to be used when running the container engine (e.g., Podman Note these environment variables will not be used within the container. Set the env section under [containers] table, if you want to set environment variables for the container. +**events_logfile_path**="" + +Define where event logs will be stored, when events_logger is "file". + **events_logger**="journald" Default method to use when logging events. @@ -462,11 +474,23 @@ and pods are visible. Path to the slirp4netns binary. -**network_cmd_options**=[] +**network_cmd_options**=["enable_ipv6=true",] Default options to pass to the slirp4netns binary. -Example "allow_host_loopback=true" +Valid options values are: + + - **allow_host_loopback=true|false**: Allow the slirp4netns to reach the host loopback IP (`10.0.2.2`, which is added to `/etc/hosts` as `host.containers.internal` for your convenience). 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 false. (Required for `outbound_addr6`). + - **outbound_addr=INTERFACE**: Specify the outbound interface slirp should bind to (ipv4 traffic only). + - **outbound_addr=IPv4**: Specify the outbound ipv4 address slirp should bind to. + - **outbound_addr6=INTERFACE**: Specify the outbound interface slirp should bind to (ipv6 traffic only). + - **outbound_addr6=IPv6**: Specify the outbound ipv6 address slirp should bind to. + - **port_handler=rootlesskit**: Use rootlesskit for port forwarding. Default. + Note: Rootlesskit changes the source IP address of incoming packets to a IP address in the container network namespace, usually `10.0.2.100`. If your application requires the real source IP address, e.g. web server logs, use the slirp4netns port handler. The rootlesskit port handler is also used for rootless containers when connected to user-defined networks. + - **port_handler=slirp4netns**: Use the slirp4netns port forwarding, it is slower than rootlesskit but preserves the correct source IP address. This port handler cannot be used for user-defined networks. **no_pivot_root**=false @@ -497,18 +521,31 @@ Default OCI specific runtime in runtimes that will be used by default. Must refer to a member of the runtimes table. Default runtime will be searched for on the system using the priority: "crun", "runc", "kata". -**runtime_supports_json**=["crun", "runc", "kata", "runsc"] +**runtime_supports_json**=["crun", "runc", "kata", "runsc", "krun"] The list of the OCI runtimes that support `--format=json`. -**runtime_supports_kvm**=["kata"] +**runtime_supports_kvm**=["kata", "krun"] The list of OCI runtimes that support running containers with KVM separation. -**runtime_supports_nocgroups**=["crun"] +**runtime_supports_nocgroups**=["crun", "krun"] The list of OCI runtimes that support running containers without CGroups. +**image_copy_tmp_dir**="/var/tmp" + +Default location for storing temporary container image content. Can be +overridden with the TMPDIR environment variable. If you specify "storage", then +the location of the container/storage tmp directory will be used. If set then it +is the users responsibility to cleanup storage. Configure tmpfiles.d(5) to +cleanup storage. + +**service_timeout**=**5** + +Number of seconds to wait without a connection before the +`podman system service` times out and exits + **static_dir**="/var/lib/containers/storage/libpod" Directory for persistent libpod files (database, etc). @@ -537,6 +574,10 @@ not be by other drivers. Determines whether file copied into a container will have changed ownership to the primary uid/gid of the container. +**compression_format**="" + +Specifies the compression format to use when pushing an image. Supported values are: `gzip`, `zstd` and `zstd:chunked`. + ## SERVICE DESTINATION TABLE The `service_destinations` table contains configuration options used to set up remote connections to the podman service for the podman API. @@ -587,15 +628,23 @@ Number of CPU's a machine is created with. The size of the disk in GB created when init-ing a podman-machine VM -**image**="testing" +**image**="" Default image used when creating a new VM using `podman machine init`. -Options: `testing`, `stable`, `next`, or a custom path or download URL to an image +Options: On Linux/Mac, `testing`, `stable`, `next`. On Windows, the major +version of the OS (e.g `35`). For all platforms you can alternatively specify +a custom path or download URL to an image. The default is `testing` on +Linux/Mac, and `35` on Windows. **memory**=2048 Memory in MB a machine is created with. +**user**="" + +Username to use and create on the podman machine OS for rootless container +access. The default value is `user`. On Linux/Mac the default is`core`. + # FILES **containers.conf** @@ -623,6 +672,6 @@ is used for the storage.conf file rather than the default. This is primarily used for testing. # SEE ALSO -containers-storage.conf(5), containers-policy.json(5), containers-registries.conf(5) +containers-storage.conf(5), containers-policy.json(5), containers-registries.conf(5), tmpfiles.d(5) [toml]: https://github.com/toml-lang/toml diff --git a/seccomp.json b/seccomp.json index 7f79d25..4d66196 100644 --- a/seccomp.json +++ b/seccomp.json @@ -1,6 +1,7 @@ { "defaultAction": "SCMP_ACT_ERRNO", "defaultErrnoRet": 38, + "defaultErrno": "ENOSYS", "archMap": [ { "architecture": "SCMP_ARCH_X86_64", @@ -87,7 +88,8 @@ "comment": "", "includes": {}, "excludes": {}, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -651,7 +653,8 @@ "CAP_DAC_READ_SEARCH" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -694,7 +697,8 @@ "CAP_SYS_ADMIN" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -723,7 +727,8 @@ "CAP_SYS_CHROOT" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -758,7 +763,8 @@ "CAP_SYS_MODULE" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -787,7 +793,8 @@ "CAP_SYS_PACCT" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -824,7 +831,8 @@ "CAP_SYS_PTRACE" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -855,7 +863,8 @@ "CAP_SYS_RAWIO" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -890,7 +899,8 @@ "CAP_SYS_TIME" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -919,7 +929,8 @@ "CAP_SYS_TTY_CONFIG" ] }, - "errnoRet": 1 + "errnoRet": 1, + "errno": "EPERM" }, { "names": [ @@ -947,7 +958,8 @@ "CAP_AUDIT_WRITE" ] }, - "errnoRet": 22 + "errnoRet": 22, + "errno": "EINVAL" }, { "names": [ diff --git a/storage.conf b/storage.conf index 9cc45a1..4b44c38 100644 --- a/storage.conf +++ b/storage.conf @@ -1,5 +1,14 @@ # This file is is the configuration file for all tools -# that use the containers/storage library. +# that use the containers/storage library. The storage.conf file +# overrides all other storage.conf files. Container engines using the +# container/storage library do not inherit fields from other storage.conf +# files. +# +# Note: The storage.conf file overrides other storage.conf files based on this precedence: +# /usr/containers/storage.conf +# /etc/containers/storage.conf +# $HOME/.config/containers/storage.conf +# $XDG_CONFIG_HOME/containers/storage.conf (If XDG_CONFIG_HOME is set) # See man 5 containers-storage.conf for more information # The "container storage" table contains all of the server options. [storage] @@ -11,8 +20,14 @@ driver = "overlay" runroot = "/run/containers/storage" # Primary Read/Write location of container storage +# When changing the graphroot location on an SELINUX system, you must +# ensure the labeling matches the default locations labels with the +# following commands: +# semanage fcontext -a -e /var/lib/containers/storage /NEWSTORAGEPATH +# restorecon -R -v /NEWSTORAGEPATH graphroot = "/var/lib/containers/storage" + # Storage path for rootless users # # rootless_storage_path = "$HOME/.local/share/containers/storage"