Commit Graph

167 Commits

Author SHA1 Message Date
Vikas Goel 9b0147a1ae New global option interface_name in containers.conf
Add a new containers.conf attribute to define how to set interface name inside containers.

Relates to: containers/podman#21313

Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
2024-01-25 07:11:33 -08:00
Lokesh Mandvekar af01fda323 containers.conf: add crun-vm as a runtime
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-01-19 18:15:33 +05:30
Oleksandr Redko 3cc2a76ae9 Fix typos across repo; extend codespell config
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-03 23:38:47 +02:00
Chetan Giradkar 41f0492c7f Add configurability to Netavark firewall driver
closes #1338

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-11-28 12:51:21 +00:00
Valentin Rothberg c5e536c25b containers.conf: append to string arrays
Document how the overriding behavior during the loading sequence can be
changed to appending.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-30 12:51:41 +01:00
Paul Holzinger 27b072610b pkg/config: lookup InitPath in HelperBinariesDir
Forcing a single upstream default for the init path is bad as some
distro use different install locations for various reasons.

To fix this use the existing helper_binaries_dir field to lookup in all
directories. To keep backwards compatibility we keep using the old
default and both Containers.InitPath and Engine.InitPath. Yes that is
right, somehow we ended up with the same config field under the
containers and engine section and they are both used in podman!
Thus we need to keep supporting both, only the field under the container
section was documented and now recommends the use of helper_binaries_dir.

To make the docs more clear also document what binaries are currently
looked up in helper_binaries_dir.

Note this needs further integration in podman.

Fixes #1110

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-18 12:55:29 +02:00
Paul Holzinger 6a79383d51 pkg/config: use empty default for db_backend
Podman should default to sqlite for new installs, however to not break
upgrades we should detect if a boltdb database exists and use that in
such case. Now in order to distinguish between an explicitly set
"sqlite" and "boltdb" and nothing set we use an empty default.

With that podman can know if we really should use the default or if it
was configured for a db explicitly. The actual detection logic must be
implemented in podman as we only know the file locations there.

This commit also drops the unused StateType as this was not used at all.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-10 15:57:52 +02:00
Valentin Rothberg ac851d5930 containers.conf: add `privileged` field to containers table
As requested in containers/podman/issues/20000, add a `privileged` field
to the containers table in containers.conf.  I was hesitant to add such
a field at first (for security reasons) but I understand that such a
field can come in handy when using modules - certain workloads require a
privileged container.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-05 13:22:35 +02:00
Valentin Rothberg 6923f768c2 URGENT: heal CI: fix codespell
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-03 11:15:37 +02:00
Daniel J Walsh 744d68db46 Fix specification of unix:///run
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-09-17 07:40:14 -04:00
Aditya R 359ff162d0 containers.conf: add field for AddCompression to Engine table
Allows users to set default value of `AddCompression` to Engine table so
users can use https://github.com/containers/buildah/pull/4912 by
default.

Closes: https://github.com/containers/buildah/pull/4912#issuecomment-1661105029

Signed-off-by: Aditya R <arajan@redhat.com>
2023-08-24 17:10:06 +05:30
Valentin Rothberg 6847ea48a2 containers.conf: implement modules
Add a new concept to containers.conf called "modules".  A "module" is
a containers.conf file located at a specific directory.  More than one
module can be loaded in the specified order, following existing
override semantics.

There are three directories to load modules from:
 - $CONFIG_HOME/containers/containers.conf.modules
 - /etc/containers/containers.conf.modules
 - /usr/share/containers/containers.conf.modules

With CONFIG_HOME pointing to $HOME/.config or, if set, $XDG_CONFIG_HOME.
Absolute paths will be loaded as is, relative paths will be resolved
relative to the three directories above allowing for admin configs
(/etc/) to override system configs (/usr/share/) and user configs
($CONFIG_HOME) to override admin configs.

Also move some functions from config.go for locality.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-08-14 09:40:27 +02:00
OpenShift Merge Robot 8694484524 Merge pull request #1586 from umohnani8/farms
Add Farms to config
2023-08-05 04:34:23 +02:00
Urvashi Mohnani 42a36d1ba1 Add Farms TOML table
Add two new fields Farms and DefaultFarm to the Config
to be used by the new podman buildfarm command.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-08-03 09:53:48 -04:00
Daniel J Walsh cdb801ec18 We don't want TERM environment turned on by default
This should only be done in container-engines that are using a
terminal.

Reverts: https://github.com/containers/common/pull/267

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-31 11:33:28 -04:00
Daniel J Walsh 19a6a187a9 Allow mounts to be specified in containers.conf
We want to allow HPC Customers and others to specify mounts
inside of containers.conf, so that they can have a default
list of mounts into all of thier containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-25 15:06:08 -04:00
Valentin Rothberg 0ce0a1367c containers.conf: add new `compose_providers` option
Specify one or more external providers for the compose command.  The
first found provider is used for execution. Can be an absolute path or a
(file) name. Relative names are invalid.  File names are evaluated via
$PATH look ups.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-24 15:53:17 +02:00
Valentin Rothberg dc08c0598b containers.conf: add new `compose_warnings_logs` option
Emit logs on each invocation of the compose command indicating that an
external compose provider is being executed.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-24 10:06:41 +02:00
Valentin Rothberg aa35cb9756 containers.conf: document compat_api_enforce_docker_hub
Mention it in the man page.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-24 10:06:41 +02:00
Lokesh Mandvekar 4bb9e26054 containers.conf: Add `podmansh_timeout`
Ref: https://github.com/containers/podman/pull/19140#discussion_r1254435823

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-07-14 15:19:11 -04:00
Martin Skøtt c40eb18238 Document --chown and --chmod
Signed-off-by: Martin Skøtt <mskoett@redhat.com>
2023-07-07 15:39:02 +02:00
Martin Skøtt b09bccaba9 Add FROM ... AS and COPY --from
Signed-off-by: Martin Skøtt <mskoett@redhat.com>
2023-07-07 14:44:47 +02:00
Giuseppe Scrivano 518758c4c7 config: add CompressionLevel to containers.conf
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-21 12:05:52 +02:00
Toshiki Sonoda 8cc8aafc07 Fix some containers.conf comments and docs
- Fix the type of the options.
- service_destinations should be engine.service_destinations

Related: https://github.com/containers/podman/issues/15615

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-06-16 14:05:43 +09:00
Daniel J Walsh 093643a7a4 Document disabling detach-keys
https://github.com/containers/podman/issues/18708 points out that user
did not understand how to disable detach-keys in containers.conf.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-05 14:37:04 -04:00
Daniel J Walsh a370cfad72 Add some fixes for CompressionFormat
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-30 17:32:27 -04:00
Paul Holzinger c0a7616486 pkg/config: add default_rootless_network_cmd field
Add a new field to the network section to allow users to set the default
network program which is used when running rootless containers.
This should be used when you run something like --network private or
--network default as rootless user.

The current default is slirp4netns so we keep that for now. Once I
integrate pasta in the rootless netns then we can consider switching the
default to pasta.

This setting will also be useful then for distros who may not ship pasta
so that they could set it back to slirp if needed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-23 13:40:23 +02:00
Paul Holzinger 2b8784dad0 pkg/config: add pasta_options field
Users way wish to configure a set of default options that should be used
when running pasta. Options that are given on the cli will be appended,
however the implementation of this needs to happen in podman.

For slirp4netns we already support the network_cmd_options field.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-23 13:40:22 +02:00
Valentin Rothberg e4b4d65199 docs: containers.conf: CHROOT
Correct a sentence stating that Podman would not run with CHROOT.
It only did for a short period of time but CHROOT had to be added
back since many uses (e.g., in-container builds) depend on it.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-09 10:04:59 +02:00
Daniel J Walsh b18f3bf225 Update docs/containers.conf.5.md
Co-authored-by: Ashley Cui <ashleycui16@gmail.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-03 16:21:58 -04:00
Daniel J Walsh ed8be0d003 Add support for confined SELinux users
The original SELinux support in Docker and Podman does not follow the
default SELinux rules for how label transitions are supposed to be
handled. Containers always switch their user and role to
system_u:system_r, rather then maintain the collers user and role.
For example
unconfined_u:unconfined_r:container_t:s0:c1,c2

Advanced SELinux administrators want to confine users but still allow
them to create containers from their role, but not allow them to launch
a privileged container like spc_t.

This means if a user running as
container_user_u:container_user_r:container_user_t:s0

Ran a container they would get

container_user_u:container_user_r:container_t:s0:c1,c2

If they run a privileged container they would run it with:

container_user_u:container_user_r:container_user_t:s0

If they want to force the label they would get an error

podman run --security-opt label=type:spc_t ...

Should fail. Because the container_user_r can not run with the spc_t.

SELinux rules would also prevent the user from forcing system_u user and
the sytem_r role.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-03 15:00:26 -04:00
Valentin Rothberg cb2b9fb52b [CI:DOCS] containers.conf: database_backend
Document the `database_backend` option which has been added earlier but
intentionally left undocumented to avoid the impression sqlite would be
ready for prime-time.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-19 10:12:05 +02:00
Paul Holzinger 7966ad46e4 pkg/config: add netavark_plugin_dirs fields
Add config field to specify the location for the netavark plugins.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-04 18:20:12 +02:00
Urvashi Mohnani bd4cc572c6 Add kube_generate_type to set default for kube generate
The kube_generate_type field can be used to set what kind
of k8s object, i.e pod or deployment, that the podman kube
generate command should generate by default.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-04-03 13:19:23 -04:00
OpenShift Merge Robot f5ecc91831 Merge pull request #1391 from rhatdan/man
[CI:DOCS] Cleanup man page display
2023-04-03 12:12:22 -04:00
Daniel J Walsh c53546dead Cleanup man page display
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-02 18:00:44 -04:00
Erik Sjölund 1d3eb27001 Fix typos and other minor language issues
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-04-02 14:17:28 +02:00
Valentin Rothberg 20e578d5b9 pkg/config: add CONTAINERS_CONF_OVERRIDE
Add yet another environment variable for loading containers.conf.
When CONTAINERS_CONF_OVERRIDE is set, the specified config file
will be loaded last - even when CONTAINERS_CONF is set.

This mechanism is needed to preserve system settings and other
environment variables.  Setting CONTAINERS_CONF will load only
the specified config file and ignore all system and user paths.
That makes testing hard as many Podman tests use CONTAINERS_CONF
for testing.

The intended use of CONTAINERS_CONF_OVERRIDE is to set it during tests
and point it to a specific configuration of Podman (e.g., netavark with
sqlite backend).

Similar needs have popped up talking to users in the automotive and
high-performance computing space.  In a way, such a setting allows for
specifying a specific "flavor" of Podman while preserving all existing
settings on the system.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-23 13:48:39 +01:00
Daniel J Walsh 00eae8d87d Back by popular demand CAP_SYS_CHROOT
We are getting a lot of issues on our removal of CAP_SYS_CHROOT
from the default list of capabilities used by Podman, so adding
it back until we do a major release.

This capabilty is also needed to successfully run the
quay.io/buildah/stable image with Podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-21 10:25:29 -04:00
Daniel J Walsh 8ff9776671 Add oom_score_adj to set default oom score adj
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-15 17:28:59 -04:00
Aditya R 9927426736 docs/containerfile: add RUN --network
Document RUN --network added in https://github.com/containers/buildah/pull/4566

[NO NEW TESTS NEEDED]
[CI:DOCS]

Signed-off-by: Aditya R <arajan@redhat.com>
2023-03-15 13:48:42 +05:30
Daniel J Walsh 99fbba5ca3 Allow cgroup-conf settings to be stored in containers.conf
This will allows users to set all containers to automatically
set certain cgroup fields globally for all of their containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-14 16:35:54 -04:00
Arthur Sengileyev 2a658cadb2 Add Provider to MachineConfig
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2023-01-22 00:08:37 +02:00
Ashley Cui c92b4705d1 Add to default machine volumes for MacOS
On MacOS, mount /Users, /private/, /var/folders by default for better docker compat. The homedir on MacOS is /Users/<username>, so that will be mounted automatically anyway with this change.

Docker also mounts /Volumes and /tmp, /Volumes fails with a Too many levels of symbolic links, as Volumes on Mac is just a symlink to / which seems like a bad idea to mount anyway.
/tmp fails because the Podman machine uses the tmp directory inside the machine and writes content to it on boot, causing the mount to fail. However, on Mac, /tmp is symlinked to /private/tmp anyway, so those files are accessible from there.

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-12-09 15:36:20 -05:00
OpenShift Merge Robot a4cd996652 Merge pull request #1252 from rhatdan/caps
Rework default list of capabilities to minimal
2022-12-06 09:17:16 -05:00
Daniel J Walsh e2fb8c5133 Add ReadOnly flag to run containers in readonly mode
This is needed for Automotive.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-05 06:05:56 -05:00
Daniel J Walsh c552ab433d Revert "Revert "Rework default list of capabilities to minimal""
This reverts commit 91ba27095f.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-04 16:12:04 -05:00
OpenShift Merge Robot 23636dda9a Merge pull request #1243 from vrothberg/RUN-1702
containers.conf: add events_container_create_inspect_data
2022-11-28 07:44:29 -05:00
Valentin Rothberg 821a0657ca containers.conf: add events_container_create_inspect_data
Add an option to create a more verbose container-create event which
includes a JSON payload with detailed information about the container.

Jira: https://issues.redhat.com/browse/RUN-1702
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-28 13:01:46 +01:00
Aditya R 1e9863c4b0 docs,containerfile: RUN --mount mention rw option
Mention `readwrite, rw` option for `RUN --mount` instruction and mention
correct default for `ro, readonly`.

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Closes: https://github.com/containers/common/issues/1246

Signed-off-by: Aditya R <arajan@redhat.com>
2022-11-28 15:40:53 +05:30