Commit Graph

120 Commits

Author SHA1 Message Date
Doug Rabson faf3c75d8f Add runj which is an experimental OCI runtime based on FreeBSD jails
Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-05-09 14:07:58 +01: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
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 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
OpenShift Merge Robot 6c2cd2f357 Merge pull request #997 from kolyshkin/golangci-lint
golangci-lint spring cleaning and bump
2022-04-14 07:14:51 -04: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 b951b72412 Gofumpt the code
gofumpt is a stricter version of gofmt, basically making the code more
readable, and fixing the gocritic's octalLiterar warnings like this one:

	pkg/util/util_supported.go:26:17: octalLiteral: use new octal literal style, 0o722 (gocritic)
		return (perm & 0722) == 0700
			       ^

Generated by gofumpt -w .

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-09 16:50:11 -07: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
Paul Holzinger a2ee133248 Fix ImageCopyTmpDir for windows
We cannot use /var/tmp on windows, instead use the temp var which is
defined on windows, of fall back to appdata.

Fixes containers/podman#13434

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-08 19:40:10 +01:00
Ashley Cui 74dd6d6f1b Add additionalHelperBinariesDir
Different packaging for different distributions have their own prefix for where helper binaries should live. additionalHelperBinariesDir is a variable that can be set during link-time so that a packager can change the location without having to carry patches for their default location.

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-02-25 16:23:38 -05: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
Sascha Grunert 446e323e80 Fix bug in `probeConmon` and add unit tests
This patch adds unit tests for the function `probeConmon` as well as
fixes a bug where a `nil` error got wrapped always to `nil`.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-02-16 11:03:55 +01: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
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
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
Paul Holzinger 995cdaae8f netavark: use globally shared network config dir
Since the network namespace is shared for all rootful libpod instances
we also need to make sure to use the same network config dir and run dir
to ensure that we do not use the same subnet or ip for more than one
container.

Also update the documentation about the network_config_dir field.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-17 15:36:03 +01:00
Paul Holzinger 25af87fbcc libnetwork: add function to get the default network backend
When the network backend is unset in the config we have to to figure out
if we need CNI or netavark. New installs should use netavark while
existing installs should continue to use CNI to prevent breaking
systems.

We use the following conditions to determine what backend to use:
1. read ${graphroot}/defaultNetworkBackend
2. find netavark binary (if not installed use CNI)
3. check containers, images and CNI networks and if there are some
   we have an existing install and should continue to use CNI

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-04 15:46:12 +01:00
Paul Holzinger a8f3e67f91 add netns package from podman
We need the netns package in c/common for the new network code.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-16 18:51:21 +01:00
Jason T. Greene d813c5e6fb Add platform driven image and user defaults for podman machine
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2021-12-09 14:37:54 -06:00
OpenShift Merge Robot a17d7ed71f Merge pull request #833 from vrothberg/compat-registry
containers.conf: add option to enforce docker.io for compat API
2021-11-22 21:40:31 +01:00
OpenShift Merge Robot aeadc7f2af Merge pull request #830 from rhatdan/network
Set netns to default to private like other namespaces
2021-11-19 17:34:16 +01:00
Valentin Rothberg c9748ff5ad containers.conf: add option to enforce docker.io for compat API
Add an option to containers.conf as a knob to enforce short-name
resolution to Docker Hub in Podman's compatibility REST API.

By popular request, turn it on by default.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-19 16:44:56 +01:00
Valentin Rothberg 1d98659f5a increase default machine vm size to 100GiB
Context: containers/podman/issues/11712
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-19 07:49:53 +01:00
Daniel J Walsh 4249000f56 Set netns to default to private like other namespaces
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-18 10:42:47 -05:00
Matthew Heon 8b1b879924 Add network_backend field for switching to netavark
This field determines whether CNI or netavark will be used to
create container networks. Default presently set to "cni".

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-11-09 13:45:56 -05:00
Ashley Cui bb2b17e7da Add machine table to containers.conf
Add machine teable to configure podman machine options. Move machine_image to the machine table, and add cups, disk size, and memory to the machine table.

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-09-23 17:03:12 -04:00
Daniel J Walsh 8795468580 UserNS should default to '' rather then host
If you use this field in rootless mode, it will blow up,
since rootless mode can not use the host user namespace.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-18 07:00:40 -04:00
Daniel J Walsh 34010ec073 Merge branch 'main' of github.com:containers/common into ipv6 2021-09-17 07:15:03 -04:00
Daniel J Walsh b45ac6d515 Make podman system service timeout configurable in containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-15 06:15:42 -04:00
Frederic Crozat abfd6e3fdd ensure same path is used in all location for krun 2021-09-14 16:59:26 +02:00
Frederic Crozat c2965e479c Add support for the krun (runc running in KVM) OCI Runtime
Signed-off-by: Frederic Crozat <fcrozat@suse.com>
2021-09-14 15:57:26 +02:00
Daniel J Walsh fd50dccd46 Enable ipv6 for rootless users by default
Fixes containers/podman#10889

Inspired by @rugk

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-12 06:31:56 -04:00
Daniel J Walsh a5bac2096a Add support for image_copy_tmp_dir
Allow users to set the default location for the temporary files used
during image pulls and pushes.

Defaults to /var/tmp;

Overridden via "TMPDIR" environment variable.

Allow special flag "storage" to indicate the the storage should use
the tmp directory in containers/storage/tmp.

Needed to fix: https://github.com/containers/podman/issues/11107

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-11 04:51:27 -04:00
Paul Holzinger 25622da26e Add HelperBinariesDir field to engine config
This field contains a list of directories which should be used to store
some helper binaries, e.g. gvproxy.

Also add a FindHelperBinary method to the config struct to get the full
path to a helper binary.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-10 13:38:19 +02:00
Matthew Heon 92ebb4a858 Switch default Rootless Networking to "CNI" for OSX
This should better support rootless CNI usescases.

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

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-09-01 15:57:00 -04:00
unknowndevQwQ 43bd1ced8a add some cni plugin paths
add some possible paths for the cni plugin to be stored

Replaces: containers/common#728

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-31 06:23:16 -04:00
openshift-ci[bot] e2d30a3914 Merge pull request #716 from ashley-cui/machineconfs
Add machine_image to containers.conf
2021-08-10 14:56:30 +00:00
Ashley Cui 927da0ce99 Add machine_image to containers.conf
Signed-off-by: Ashley Cui <acui@redhat.com>
2021-08-09 15:37:06 -04:00
Daniel J Walsh 4c61660bf5 Switch default logdriver and eventslogger to journald, if root
This will fix hte eventslog and log files from growing huge,
Lets journald handling rolling logs.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-09 11:54:46 -04:00
Matej Vasek 61d2ae986d add config option for ChownCopiedFiles
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-07-13 18:17:12 +02:00
Tino Rusch 5ec160696b add 'secret' section to the containers.conf struct. 2021-06-10 14:04:32 +02:00
Paul Holzinger 90eca585d4 Leave default seccomp path empty
The default path should be empty in order for podman to distinguish
between a path the was explicitly or to use the default (in memory)
profile.

Fixes: containers/podman#10556

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-04 13:05:35 +02:00
Paul Holzinger 79bec2ae80 Do not set the default netns
The default netns must be empty. Podman should decide what the default
option is. While podman also defaults to slirp4netns as rootless and
bridge as root, there are also other defaults for `podman run --pod ...`
and `podman pod create --infra=false` where it defaults to the pods
netns. This config field was always ignored by podman and trying to
make it work requires this patch since the default values are incorrect
for podman.

Buildah does not seem to use it either.

Also move the rootless_networking field in the default config file to
the correct containers stanza.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-05-28 16:33:03 +02:00
Daniel J Walsh 4c654f7ac2 Don't use systemd defaults if /proc/1/comm != systemd
Currently we have users failing to run containers within containers
or on systems without systemd support.  This change will give us
better defaults on these systems.

Fixes: https://github.com/containers/common/issues/580

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-05-26 15:08:14 -04:00
Matthew Heon eb83275e21 Use Private as default for rootless when we want CNI
We were hardcoding Slirp4netns as the only valid option for
rootless when "private" networking was selected. We shouldn't be
doing that - the default networking selection in Podman itself is
smart enough to figure out what to do, c/common should not decide
for us.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-05-21 13:12:03 -04:00
Brent Baude cf1c43959f rootless networking
Set type of rootless networking with:

rootless_networking = "slirp4netns | cni"

slirp is the default

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-05-20 15:34:44 -05:00
Valentin Rothberg 460874be71 Revert "Do not emit warnings about OCI runtime paths"
This reverts commit 352073be9e as it's
causing a regression as it overwrites any custom OCI runtime with either
rucc, crun or kata.  See the Podman CI failure below:

```
[+0383s] not ok 95 podman build - set runtime
[+0383s] # (from function `die' in file test/system/helpers.bash, line 412,
[+0383s] #  from function `run_podman' in file test/system/helpers.bash, line 220,
[+0383s] #  in test file test/system/070-build.bats, line 70)
```

I currently do not have the time for a proper fix but the next commit
attempting to address the warnings must include tests.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-19 13:12:13 +02:00
OpenShift Merge Robot af06050478 Merge pull request #546 from vrothberg/log-driver
adjust log-driver defaults
2021-05-12 15:09:47 -04:00