Commit Graph

201 Commits

Author SHA1 Message Date
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
Valentin Rothberg 2d3c57daa0 adjust log-driver defaults
Commit ebfe786429 changed the default logging driver k8s-file to
journald.  The only consumer of the log-driver is Podman which I think
still needs some more time to stabilize.  Vendoring containers/common
into Podman has revealed quite some warts (see
containers/podman/pull/10222) which reduced my confidence level.

To resolve the chicken-egg-problem of maturing the journald driver, I
want to only partially revert commit ebfe786429.  The built-in default
remains k8s-file while the containers.conf sets it to journald.  The
intention behind is to make sure that running systems are not impacted
but we can change Fedora to journald to increase coverage.

Once the confidence level is back to normal, we can change the default
to journald.  Latest before RHEL9.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-12 14:13:04 +02:00
Vasyl Gello 352073be9e Do not emit warnings about OCI runtime paths
... before all user configuration files are merged.

This fixes #9389.

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
2021-05-10 21:39:17 +03:00
OpenShift Merge Robot ba743c0fdb Merge pull request #518 from rhatdan/journald
Swap default logging to journald
2021-05-05 11:18:10 -04:00
Matthew Heon 85df6670fb Add ability to specify a subnet for the default network
This lays the foundation for c/common to be able to create the
default CNI configuration file itself.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-05-04 11:40:22 -04:00
Daniel J Walsh ebfe786429 Swap default logging to journald
This eliminates the concern of log files growing infinitely and also
records all containers for posterity rather then allowing the removal
of a container to destroy the record.

Partially fixes: https://github.com/containers/podman/issues/9158

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-29 13:32:50 -04:00
OpenShift Merge Robot 9724f1b55e Merge pull request #510 from rhatdan/parallel
Add support for the runsc OCI Runtime
2021-04-26 15:45:14 -04:00
Daniel J Walsh 671db86c0d Add support for the runsc OCI Runtime
Based on https://github.com/containers/common/pull/507 PR.

Thanks to unknowndev233 unknowndevQwQ@protonmail.com whoever they are.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-24 06:11:10 -04:00
Ashley Cui 24f4991dc1 Add support for machine_enabled in containers.conf
machine_enabled is a bool that indicates if Podman is running in a
podman-machine VM

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-04-23 14:37:18 -04:00
Daniel J Walsh 417d17cba5 [NO TESTS NEEDED] Remove some stuttering on return errors
golang builtin OS functions, include the path to the object being used,
no reason for us to wrap these errors with an object for a second time.

This just causes stuttering, and looks bad at the CLI level.

Existing tests should catch any errors.

Also stop adding "error" to something that is obviusly an error when it
shows up to the user.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-29 10:33:18 -04:00
Sascha Grunert 4cfca98e2b Update pause image to 3.5
This patch updates the pause container image to the latest release.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-03-16 15:08:16 +01:00
Daniel J Walsh ee0eadd226 Vendor in containers/common and start using types subdir.
This will shrink the vendoring size of containers/common/pkg/config
by a huge amount.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-27 06:43:12 -05:00
pacoxu 6e9f831375 update pause image to 3.4.1 2021-02-08 14:25:28 +08:00
Valentin Rothberg 592498d52b Revert "Change default log driver to journald"
This reverts commit 451f5fb68b.

Journald is not yet passing Podman CI.  We need to temporarily revert
the commit to unblock secrets work.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-05 21:28:22 +01:00
Daniel J Walsh 451f5fb68b Change default log driver to journald
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-30 07:57:07 -05:00
baude c0b1b9a368 Add accessor for log-driver
For podman, we need to be able to get the log driver from common config.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-19 15:08:34 -06:00
Daniel J Walsh 58231b6407 http_proxy is supposed to default to true.
In the containers.conf we default to true, but in code and man page
it is defaulted to false. Since Podman wants it defaulted to true
we need to change default and man page to match.

Also fixed the testing for SELinux, which would never succeed on an SELinux box.

Helps fix: https://github.com/containers/podman/pull/8844

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-29 08:04:52 -05:00
Daniel J Walsh ec4a98a333 Switch references of /var/run -> /run
Systemd is now complaining or mentioning /var/run as a legacy directory.
It has been many years where /var/run is a symlink to /run on all
most distributions, make the change to the default.

Partial fix for https://github.com/containers/podman/issues/8369

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-18 06:27:41 -05:00
Daniel J Walsh 44e14b12b9 Find ociruntime instead of hard coding default
Users could have any one of the OCI runtimes installed,
code will search for default.  This way they do not need
to modify defaults if they have "crun" installed.

Search order will be crun, runc, kata

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-15 05:43:45 -05:00
Daniel J Walsh 8618895ac3 Switch default runtime from runc to crun
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-04 08:06:11 -05:00
Daniel J Walsh 69ee79b12c Add support for enabling/disabling kernel keyring in engines
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-20 13:39:24 -05:00
Matthew Heon bb5e97fdbb We should not be setting a default infra command.
We should be sourcing from the image CMD/ENTRYPOINT by default.
Having a default prevents us from doing that - we should only be
using this for user-configured values that do not come from the
image.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-11-19 15:43:36 -05:00
Daniel J Walsh 766019ca66 Set storage path correctly
Fix handling of storage.conf path, so that we can use it when testing podman.
Currently the Environment variable is not handled correctly.

There is a matching patches in containers/storage and eventually
containers/podman to allow the user of alternative storage.conf files in testing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-24 05:01:41 -04:00
Daniel J Walsh d2c4ee7ce3 Allow users to specify the default format for image builds
Some users want to stick to "docker" format escecially since some older
container registries don't properly support OCI images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-21 16:13:48 -04:00
Daniel J Walsh 1ef1790040 Add TERM=xterm to default setting for env
We want to make sure that the TERM envionment variable is always
set.  TERM defaulted to ansi might be better, but we want to match
Docker defaults, so we will stick at xterm.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-18 11:37:15 -04:00
Daniel J Walsh 20e45b9542 Fix CONTAINER_STORAGE_CONF->CONTAINERS_STORAGE_CONF
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-17 15:06:30 -04:00
Daniel J Walsh 964d22fabd Add CONTAINERS_STORAGE_CONF Environment hanlding for testing
Currently it is difficult to modify the path to the storage.conf
file for setting up testing. It is hard coded to use /etc/containers/storage.conf.

Adding this envionment variable, will allow us to write tests on storage.conf
that do not override the system defaults.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-17 14:27:04 -04:00
David Scherer 7b48d849b7 Use homedir.GetConfigHome()
Signed-off-by: David Scherer <david.scherer@antithesis.com>
2020-08-09 10:31:14 -04:00
David Scherer 3ce09ba75f Respect XDG_CONFIG_HOME for policy.json and cni
Use XDG_CONFIG_HOME if it is defined.

XDG_CONFIG_HOME is already respected for configuration files such as containers.conf, storage.conf, and registry.conf but here `~/.config` was hardcoded.

Signed-off-by: David Scherer <david.scherer@antithesis.com>
2020-08-08 13:53:58 -04:00
Valentin Rothberg 988b089a30 Merge pull request #221 from giuseppe/permit-rootless-cni
rootless: permit custom configuration for cni
2020-07-21 11:46:04 +02:00
Ashley Cui 93a6847b2d Add support for Umask
Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-15 13:59:29 -04:00
Giuseppe Scrivano d6300be2bb rootless: permit custom configuration for cni
I am experimenting with supporting CNI in rootless Podman.  There is
no harm in preparing common to support such case and allow a custom
per-user configuration.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-14 15:43:59 +02:00
Daniel J Walsh 17371297f1 PidsLimit should return 0 if rootless and cgroupfs manager
Only return the Pids Limit for container engines running as root or
with cgroupv2 and Systemd as a cgroup manager.

Trying to do this will rootless containers on cgroup V1 is not allowed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-02 14:17:09 -04:00
Ashley Cui bf1b8b15b6 Add support for timezone
Signed-off-by: Ashley Cui <acui@redhat.com>
2020-06-30 15:07:49 -04:00
Daniel J Walsh a3a0a08b50 Add support for Remote flags in containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-28 15:47:01 -04:00
Daniel J Walsh 7b97b08724 Do not validate paths on remote platforms
Modify validate functions to work on a remote clients.
Any of the path checks will not work on remote machines or make
sense on remote clients. Therefore they should not be checked.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-28 13:29:37 -04:00
Daniel J Walsh 9d3c59e7ad return Containers.PidsLimit iff rootless and cgroupmanager==systemd
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-11 14:01:20 -04:00
Daniel J Walsh c21671b7ca Don't set pids limit on rootless cgroupv1 systems
Pids-limit is not supported on rootless cgroup V1 systems.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-07 13:58:59 -04:00
Daniel J Walsh 92bf3877e9 Specify default paths to policy.json file
Currently if a rootless user runs podman in his homedir, and does
not have /etc/containers/policy.json on the system and does not
have ~/config/policy.json in his homedir, the command fails with
an error.

$ podman pull fedora
Error: error pulling image "fedora": unable to pull fedora: open /etc/containers/policy.json: no such file or directory

If the user has no root rights on the system, he can not create the file.
However the system would work fine if he created the file in his homedir.

With this change, we will force the default to be the file in his homedir if
BOTH files do not exist.  Now the error message for a rootless container would
be.

$ podman pull fedora
Error: unable to pull fedora: open /home/dwalsh/.config/containers/policy.json: no such file or directory

And the user has an idea how to fix this situation.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-05 10:01:09 -04:00
Giuseppe Scrivano 1f92b8cdcb config: default to cgroupns="host" on cgroup v1
cgroupns="private" should be used only on cgroup v2.

On cgroup v1 it would be a breaking change, and also we'd need to
check whether the kernel supports cgroup namespaces.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-23 15:49:37 +02:00
Giuseppe Scrivano dfde2a6744 config: change default for userns to host
by default do not create a user namespace.  A user namespace also
requires mappings to be specified and that is not possible with a
static setting.  We cannot default to "auto" as it requires additional
configuration for the root user.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-22 10:11:02 +02:00
Daniel J Walsh c58a215838 Add support for cgroups configuration
We need to be able to disable cgroups when running container engines inside of containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-13 13:56:16 -04:00
Daniel J Walsh c719975a94 Add RuntimeSupportsKVM to config.Engine
We need to identify the list of containers that support KVM separation, these
containers can run with a different SELinux label, and we might be able to
make different decisions in the container engines about how to launch these
containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-07 10:11:59 -04:00
Daniel J Walsh ed25ff4eb6 Add more utils for returning defaults
Move pkg/sysinfo and pkg/apparmor out of libpod into containers/common.

This will allow other packages to use these libraries without requiring all of libpod.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-01 08:39:44 -04:00
Daniel J Walsh caf7fd95ca Only default to systemd if built with the systemd buildtag
For packages that don't ship with systemd, this changes the default for those distros.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-31 12:57:32 -04:00
Daniel J Walsh a21cf229ee Move pkg/unshare to containers/storage/pkg/unshare
This removes a circular dependancy

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-31 08:42:12 -04:00
Valentin Rothberg ebd70f1b13 use `pause:3.2` image for infra containers
The `pause:3.1` has wrong configs for non-amd64 images as they all claim
to be for amd64.  The issue has now been fixed in the latest
`pause:3.2`.

[1] https://github.com/kubernetes/kubernetes/issues/87325

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-27 13:45:23 +01:00
Daniel J Walsh 4bb3c87228 Add kata containers support
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-27 06:54:25 -04:00
Daniel J Walsh f935da11c9 Move SignaturePolicyPath to Engine instead of Containers
Signatures are an engine struct rather then something
per/container.  Moving to proper location.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-17 16:52:32 -04:00
Daniel J Walsh 50135a792d Change references to libpod to engine
containers/common pkg/config is for more engines then just libpod.

We want to use the 'libpod' section to configure parts of buildah.  Renaming this
section to engine, makes it more obvious to users that these fields can effect other
container engines.

Certain fields are still libpod specific, so we do not change those fields.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-11 14:56:32 -04:00
Daniel J Walsh cf37573798 Drop StorageConfig from containers config structures
Callers should use containers/storage directly.

Also remove MergeDBConfig, this is no longer used by any callers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-11 05:39:35 -04:00
Qi Wang bec93b6703 Add pull_policy to LibpodConfig
pull_policy is the same as podman run --pull option to determin whether to pull a new image when running a container.
Accepted "always", "missing", and "never". Default value is "missing".

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-03-03 11:13:38 -05:00
Daniel J Walsh 00b0aae703 Add StopTimeout for podman
Allow users to modify the default ammount of time to wait to send SIGKILL
after you tell a container to stop with a SIGINT.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-21 11:32:16 -05:00
Daniel J Walsh 3d6b785749 CgroupManager should belong to libpod not containers
CgroupManager is defined for managing containers, it is not defined
per container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-20 10:27:47 -05:00
Daniel J Walsh 8bd736f5cc Merge pull request #69 from giuseppe/add-setfcap
config: add CAP_SETFCAP to the default capabilities
2020-02-20 09:39:18 -05:00
Giuseppe Scrivano b1841747ed config: add CAP_SETFCAP to the default capabilities
it is needed by Buildah to set file capabilities.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-20 09:49:01 +01:00
Daniel J Walsh ad4b16c9d2 Remove additional_ adjective from containers.conf
Additional is implied, so should not be stated.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-19 09:48:11 -05:00
Carlos Eduardo Arango Gutierrez a93c9e5022 fix typo on var declaration
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-02-18 07:19:27 -05:00
Carlos Eduardo Arango Gutierrez 3e885a69c4 Add annotations into containers.conf file
Closes #62

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-02-17 19:42:11 -05:00
Carlos Eduardo Arango Gutierrez 0d15312d27 Fix lint on default.go
Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2020-02-17 18:18:14 -05:00
Daniel J Walsh a0f632a9d3 Use slirp4netns for default network when in rootless mode
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-12 21:11:56 -05:00
Daniel J Walsh 8241546743 Setup default ulimits to nproc & nofile of current process
In root running containers we want to approach the MAX  Number of processes and
open files, so that services running Podman will work when they have lots of open
files or processes.  In rootless containers this number can not be changed.  This
patch will only increase the numbers if the process is allowed.

Docker set the limit to 2**20 (1048576), it looks like this was the max for RHEL5 OS.
So we fall back to attempt to set this limit if the MAC_PROC limit is not allowed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-03 13:50:28 -05:00
Daniel J Walsh aa32712804 Fix a couple of defaults
The default alternative path for seccomp.json should be /etc/containers/seccomp.json

The DefaultNetwork in network config should be bridge

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-27 04:05:25 +01:00
Daniel J Walsh b3d6ec550e Fix definitions for cross compilers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-16 16:58:38 -05:00
Giuseppe Scrivano 990e0fc7c3 pkg/cgroups: delete it
at the moment the cgroups package is used only by Podman and by CRI-O
(that is already vendoring libpod).  So let's simplify and not have a
duplicate here.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-09 08:45:00 +01:00
Daniel J Walsh 5760a49664 HooksDir should be in LibpodConfig
This field is owned by libpod and is not part of containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-07 17:53:02 -05:00
Daniel J Walsh 74d7f91c66 Update/Fix man page and fix several bugs in definition.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-03 13:57:01 -05:00
Daniel J Walsh b406a112e1 Add new fields to containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-12-28 07:22:07 -05:00
Daniel J Walsh 67213c41a3 Remove merge code and optional handling
Fix handling of toml files

No longer need merge, since we can specify a default conf for each toml file.
The toml code will retain the previous defaults and only use the newly specified
values.

This greatly simplifies the code.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-12-11 08:26:52 -05:00
Daniel J Walsh 547b101e3e Change optional bools to be private options
We want to hide Optional Bools from the default configuration.  Callers should only have to deal with boolean
fields and not deal with optionals.

Add accessor functions for all optional bools, easier.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-12-09 12:01:43 -05:00
Qi Wang 894913abdf add libpod.conf to containers.conf
Add configurations from libpod.conf to containers.conf.Use merge code from libpod to read and merge configurations from file.

Add unshare_linux for build linux: HomeDir should buildah not only for linux. so add unshare_linux for linux and unshare.go for other

convert bool to optinalbool:Use OptionalBool for on-disk configurations so we can distinguish field is undefined  vs. user set to false.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-12-06 15:55:47 -05:00