Commit Graph

131 Commits

Author SHA1 Message Date
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
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
Niall Crowe ccad158a8b containers.conf: add events_logfile_max_size
Add a new option to the `[engine]` table in containers.conf
for specifying the maximum size of `events_logfile_path`.
Once exceeded, Podman will rotate the logfile and delete
the old one.

Also add tests to make sure we're not regressing in the future.

Signed-off-by: Niall Crowe <nicrowe@redhat.com>
2022-03-16 14:32:59 +00:00
Rover van der Noort 87dcc5729f Add ExitCommandDelay as configuration in EngineConfig with default of 5 minutes in seconds.
Signed-off-by: Rover van der Noort <s.r.vandernoort@student.tudelft.nl>
2022-02-24 15:51:05 +01:00
OpenShift Merge Robot e9861715cb Merge pull request #905 from Foxboron/morten/move-manpages
docs: Reintroduce Containerfile and containerignore
2022-02-22 13:52:51 -05:00
OpenShift Merge Robot 28e1ee0625 Merge pull request #931 from Luap99/subnets
add default_subnet_pools to containers.conf
2022-02-15 11:19:40 -05:00
Paul Holzinger b76062811b pkg/config: add new default_subnet_pools field
Add a new field to set the default subnet pools. They can be used to
change the subnet which is automatically allocated by podman network
create.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-02-15 15:29:19 +01:00
Valentin Rothberg c1ee93d3a8 docs: move `volumes` under containers table
`volumes` were mistakenly listed under the network table.

Fixes: containers/common#928
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-02-15 09:41:07 +01:00
Erik Sjölund bc5ea7c89e Fix typos and improve language
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-01-30 17:15:02 +01:00
Daniel J Walsh e24561828a Change infra_image default to ""
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-27 16:42:18 -05:00
Morten Linderud c792481854 docs: Reintroduce Containerfile and containerignore
These where moved to buildah but because they are useful for podman and
the other tooling they are moved back into the common project.

Reverts 6b57bd6c7c

Signed-off-by: Morten Linderud <morten@linderud.pw>
2022-01-25 22:42:59 +01:00
Paul Holzinger 4eb265ce95 remove rootless_networking field from containers.conf
This field was only needed for machine to force cni, however you can set
netns="bridge" in the config to have the same effect. This is already
done in the machine setup.

The field was more of a hack and just creates confusion for users so we
remove it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-20 16:23:12 +01:00
OpenShift Merge Robot 98fa4baa5c Merge pull request #889 from Luap99/netavark-root
netavark: use globally shared network config dir
2022-01-17 15:57:19 +01:00
Paul Holzinger abb7b535b6 add network documentation for netavark
* change cni networks to just networks since they also refer to netavark
  networks
* add documentation about the network_backend key and what the empty
  value means

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-17 15:36:34 +01:00