Commit Graph

143 Commits

Author SHA1 Message Date
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
Valentin Rothberg 91ba27095f Revert "Rework default list of capabilities to minimal"
This reverts commit 962dbc3281.
As shown in containers/podman/pull/16610 the changes require a number of
changes in Podman's CI.  While many issues have been fixed in that PR,
there are some potentially controversial changes such as dropping
NET_RAW.

Let's revert the commit to unblock ongoing work.  For the next
iteration, Podman CI must be green before merging.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-25 09:37:41 +01:00
OpenShift Merge Robot 5034979776 Merge pull request #1240 from rhatdan/caps
Rework default list of capabilities to minimal
2022-11-23 03:39:04 -05:00
Daniel J Walsh 962dbc3281 Rework default list of capabilities to minimal
For a couple of years now we have been shipping containers.conf settings
to use only 10 capabities. Docker uses 14, with the difference being
CAP_AUDIT_ALLOW, CAP_NET_RAW, CAP_MKNOD, CAP_CHROOT.

This allows us to run with a tighter security then Docker.

This PR makes the change to default config, so that if no
containers.conf overrides are present, we will run with the tighter
security. Currently most distros that ship the containers.conf already
run with this setting, but this makes it formal, and changes the man
page to match the defaults.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-22 12:55:25 -05:00
Daniel J Walsh 3a429400c3 Deprecate UserNSSize, since we don't use it
Podman and Buildah do not use this field, and I
know of no users of it, remove it from docs and
the default conf file, so users will not expect
it to do anything.

Leaving implementation in the slight chance someone
has used it in a non containers project.

Fixes: https://github.com/containers/podman/issues/16562

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-21 13:06:10 -05:00
Aditya R 1ea30aa853 config: add support for platform_to_oci_runtime and default entries for wasm
Containers.conf now supports `platform_to_oci_runtime` which allows end
users to map variant of OCI runtime for a particular platform.

Most ideal use-case of this feature is switching to crun's variant when
platform string is `wasm32/wasi`.

Example
```toml
[engine.platform_to_oci_runtime]
"wasi/wasm" = "crun-wasm"
"wasm/wasm32" = "crun-wasm"
"wasm/wasm64" = "crun-wasm"
```

Signed-off-by: Aditya R <arajan@redhat.com>
2022-11-11 20:44:59 +05:30
unknowndevQwQ 5db50a2cb8 feat: add support for the youki OCI Runtime 2022-10-22 10:35:23 +08:00
Valentin Rothberg 7a3b5b8504 docs: containers.conf: list all log drivers
Fixes: containers/common#996
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-08-26 13:24:17 +02:00
Daniel J Walsh 3196de901c Add support for returning image path with ARCH and OS Substitutions
Allow distributions to specify the location of the podman image VM
images in the form of URIs with $ARCH and $OS specified.  This would
allow a distribution to pull the image based on the current OS and Arch.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-08-22 07:17:58 -04:00
Dominique Martinet 2e8943d3f7 add network dns_bind_port setting and set NETAVARK_DNS_PORT from it
This commit allows using aardvark with an alternate port as per
implementation in containers/netavark#323

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
2022-07-08 09:45:15 +09:00
Daniel J Walsh 58f58410a6 Support setting image_volume_mode in containers.conf
Begins to fix https://github.com/containers/podman/issues/14230

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-18 10:10:06 -04:00
OpenShift Merge Robot 5480a30a08 Merge pull request #1011 from TomSweeneyRedHat/dev/tsweeney/changelogger
Define default loggers in man page
2022-05-10 16:08:05 -04:00
tomsweeneyredhat 6732e7ffa0 Define default loggers in man page
We have received two Bugzilla's about the upstream
documentation being incorrect about the default value of the
events_logger field in containers.conf.  The are:

https://bugzilla.redhat.com/show_bug.cgi?id=2076664
https://bugzilla.redhat.com/show_bug.cgi?id=2076665

From what I can see, we use `file` in RHEL and the podman machine,
in all other distributions were' using journald.  I've
attempted to change the man page to reflect that.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-05-10 14:57:57 -04:00
Valentin Rothberg 1cb045b421 containers.conf: add pod_exit_policy
Add a new `pod_exit_policy` field to the containers.conf's engine table.
A pod's exit policy determines the behaviour when the last container of
a pod exits.

Required-in: containers/podman/pull/13859
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-04-29 12:17:16 +02:00
Daniel J Walsh af1f3558c7 Change rootfull->rootful
[NO NEW TESTS NEEDED] Just a docs change.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-25 13:50:12 -04:00
Jason T. Greene 77d8f70039 Deprecate MachineEnabled and replace with API
machine.IsPodmanMachine replaces MachineEnabled
machine.MachineHostType informs the type unknown, qemu, wsl, etc
machine.IsGvProxyBased used to make specific determinations re gvproxy

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-04-23 12:32:54 -05:00
OpenShift Merge Robot 14485d3f32 Merge pull request #1006 from Luap99/ipv6-slirp
pkg/config: fix docs for network_cmd_options
2022-04-21 07:11:03 -04:00
Paul Holzinger ce62c07f22 add host_containers_internal_ip to containers.conf
Set the ip for the host.containers.internal entry in the containers /etc/hosts
file. This can be set to "none" to disable adding this entry. By default it
will automatically choose the host ip.

Also add a function to get the correct host.containers.internal ip. This
should be used by podman and buildah and then passed to the New()
function.

Ref https://github.com/containers/podman/issues/13224

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-21 11:48:36 +02:00
Paul Holzinger a3b0ae033e add base_hosts_file field to containers.conf
base_hosts_file can be used to overwrite the default base host file
/etc/hosts which is used to copy hosts entries from this file into the
containers /etc/hosts file. As special value "image" can be used to copy
the entries from the image hosts file or "none" to not use a base file
at all. IF the value is empty we should use /etc/hosts as default.

Ref https://github.com/containers/podman/issues/13277
Ref https://github.com/containers/podman/issues/13748

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-21 11:39:56 +02:00
Paul Holzinger d154daf361 pkg/config: fix docs for network_cmd_options
Slirp4netns options were changed to always default to ipv6 so it does
not need the extra setting. Update the documentation to reflect this.

see https://github.com/containers/podman/pull/13929

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-20 14:56:31 +02:00
Niall Crowe a894dd11a3 pkg/config: new value for events_logfile_max_size
Changing the value for events_logfile_max_size from 0 to 1048576. This allows
up to 10,000 events to be written to the events log file before rotation occurs.
Also adding new values to default.go

Signed-off-by: Niall Crowe <nicrowe@redhat.com>
2022-04-20 10:23:50 +01:00
Daniel J Walsh a3e25551d0 Add machine volumes to containers.conf
This will allow users to specify which volumes they want podman machine
to automatically mount into the machine. These volumes can later be used
to volume mount into containers.

Environment variables like $HOME can be used and are translated at the
time of machine start.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-13 07:33:17 -04:00
Kir Kolyshkin a263ddda2d Fix typos found by codespell
Brought to you by

	make codespell

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-03-30 11:13:44 -07:00
Daniel J Walsh efb7ac046b Add .containerignore.5 link file so users can find man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-03-22 16:34:59 -04:00
Daniel J Walsh 54be5eba7e IPCMode default mode should be sharable not private
Docker defined --ipc=private to mean that the container's IPC Namespace
can NOT be shared with another container.  While --ipc=shareable can,
which is our current default.  Docker also defines "none" which means
the container runs in a IPC namespace but does NOT mount a /dev/shm.
"Host" means the container runs in the host namespace, and
container:UUID means run new container in other containers namespace.
ns:PATH means run in the namepsace designated in PATH.2

This Patch, fixes containers/common to reflect the correct default.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-03-22 07:25:59 -04:00