212 Commits

Author SHA1 Message Date
249474a84e drop support for "pasta" as a network name
The pasta network mode has been added in podman v4.4 and this causes a
conflict with named networks that could also be called "pasta". To not
break anything we had special logic to prefer the named network over the
network mode. Now with 5.0 we can break this and remove this awkward
special handling from the code.

Containers created with 4.X that use a named network pasta will also
continue to work fine, this chnage will only effect the creation of new
containers with a named network pasta and instead always used the
network mode pasta. We now also block the creation of networks with the
name "pasta".

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-05 13:57:24 +01:00
2818abf849 Update to runc main, removing pin to an older version
We were pinned to a specific commit to ensure that tests kept
passing. Hopefully they pass now, as we need to grab latest runc
for CVE fixes.

Also grab Buildah main to fix a build issue on FreeBSD. After a
botched manual vendor, I used Ed's treadmill script and squashed
it into this commit to make Git happy. Thanks bunches Ed.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-02 08:11:17 -05:00
c41c30bedd Merge pull request #21180 from rhatdan/nvidia
Make --gpus work with nvidia gpus
2024-01-30 14:59:02 +00:00
3a46fe858f Merge pull request #21069 from umohnani8/new-farmbuild-2
farm build: push built images to registry
2024-01-15 18:41:29 +00:00
d95710a89c farm build: push built images to registry
Update farm build to directly push images to a registry
after all the builds are complete on all the nodes.
A manifest list is then created locally and pushed to
the registry as well.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-01-15 11:31:17 -05:00
46cfc9858f Make --gpus work with nvidia gpus
Somewhat documented here:
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/cdi-support.html
https://stackoverflow.com/questions/25185405/using-gpu-from-a-docker-container

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

Don't have access to nvidia GPUS, relying on contributor testing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-11 21:13:25 -05:00
560455cbd6 docs: fix typos
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-04 12:10:11 +02:00
e4ecd7cca3 doc cleanup
Began as a review of #20983, a community PR from @krumelmonster
for moving divisive-language footnotes closer to the point
where they're used. In the process, I noticed a lot of poor
markdown, mostly bad use of whitespace. Cleaned it up, added
some italic/bold/tty markdown to options, and cleaned up
some language I found confusing.

Thanks to @krumelmonster for initial PR.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-14 05:17:43 -07:00
611ba2ff31 Merge pull request #20827 from kaivol/userns-auto-intermediate-id-lookup
Support lookup of intermediate ID for uidmapping and gidmapping in `--userns=auto`
2023-12-11 10:19:14 +00:00
67aae8e62e Merge pull request #20866 from giuseppe/add-preserve-fds-list
podman: new option --preserve-fd
2023-12-06 13:34:34 +00:00
01d397a658 podman: new option --preserve-fd
add a new option --preserve-fd that allows to specify a list of FDs to
pass down to the container.

It is similar to --preserve-fds but it allows to specify a list of FDs
instead of the maximum FD number to preserve.

--preserve-fd and --preserve-fds are mutually exclusive.

It requires crun since runc would complain if any fd below
--preserve-fds is not preserved.

Closes: https://github.com/containers/podman/issues/20844

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-12-05 10:16:41 +01:00
b1eccedf5e [CI:DOCS] Update health-start-periods docs
Update the health-start-period docs to clarify what exactly
the health-start-period flag does based on whether the health
check command succeeds or fails.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-12-04 05:29:53 -05:00
bc124dd13f Merge pull request #20819 from cgiradkar/20752_farm_flag_move
Move the --farm flag to farm build command
2023-12-01 21:12:38 +00:00
31df9c237e Move the --farm flag to farm build command
The option `farm` which is used to specify the farm to be used, is moved to farm build command from farm command.

closes #20752

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-11-30 14:27:06 +00:00
fa0aa91132 @@option volume.image: be specific that -v only affects RUN
Be specific that the `-v` flag only affects RUN instructions.  The
previous wording left it ambiguous, and people might have concluded that
it applied to ADD and COPY as well.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-30 09:05:33 -05:00
d5cf46e807 support lookup of intermediate IDs in gidmapping/uidmapping options in userns=auto
Closes #20699

Signed-off-by: kaivol <github@kavol.de>
2023-11-29 19:03:27 +01:00
248cbc6f69 docs: drop default for tmpfs-mode
The default is OCI runtime specific, there is no way for Podman to
know it.

[CI:DOCS]

Closes: https://github.com/containers/podman/issues/20754

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-11-28 13:51:28 +01:00
f6b2a13781 Clean up farm-build miscommit
Followup to #20051, which I didn't review in time.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-27 06:15:43 -07:00
414642efdb [CI:DOCS] Add podman farm build doc
Move the options for the podman build doc to a common md
that can be used by both podman build and podman farm build.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-11-22 11:00:13 -05:00
e40d70cecc new 'no-dereference' mount option
Add a new `no-dereference` mount option supported by crun 1.11+ to
re-create/copy a symlink if it's the source of a mount.  By default the
kernel will resolve the symlink on the host and mount the target.
As reported in #20098, there are use cases where the symlink structure
must be preserved by all means.

Fixes: #20098
Fixes: issues.redhat.com/browse/RUN-1935
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-11-21 13:17:58 +01:00
49b152f498 docs: fix relabeling command
Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
2023-11-13 17:15:26 +01:00
7d107b9892 Merge pull request #19879 from rhatdan/ulimits
Support passing of Ulimits as -1 to mean max
2023-11-10 10:47:43 +00:00
b8d59030cf Document --userns=auto behaviour for rootless users
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-08 17:03:35 -06:00
18d6bb40d5 Support passing of Ulimits as -1 to mean max
Docker allows the passing of -1 to indicate the maximum limit
allowed for the current process.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-01 08:46:55 -04:00
e9dd411832 docs: clarify systemd cgroup mount
Closes: https://github.com/containers/podman/issues/20521

[CI:DOCS] clarify systemd cgroup mount

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-30 10:55:35 +01:00
c6d410cc36 Do not add powercap mask if no paths are masked
This solves `--security-opt unmask=ALL` still masking the path.

[NO NEW TESTS NEEDED] Can't easily test this as we do not have
access to it in CI.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-10-27 09:55:12 -04:00
ca9efb0cda network: document ports and macvlan interaction
The network backend will ignore ports for macvlan and ipvlan networks so
they do not do anything. No warning or error is shown because containers
may be later connected to a bridge network in which case they would be
useful.

Fixes #17927

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-19 17:04:29 +02:00
c8604081e8 Fix handling of --read-only-tmpfs flag
Fixes: https://github.com/containers/podman/issues/20225

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-16 14:18:55 -04:00
e9d6ffa8f0 Merge pull request #20252 from vrothberg/privileged
containers.conf: add `privileged` field to containers table
2023-10-07 11:34:45 +00:00
362eca6691 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 20:14:18 +02:00
5f340487ee Revert "docs(env-file): improve document description"
This reverts commit c67ef7c1a12bb46e846c1b3dbda6acda1c6a5d30.

see https://github.com/containers/podman/issues/19565

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-04 17:06:21 +02:00
455d165492 Update docs/source/markdown/options/rdt-class.md
Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: wpross <wolfgang.pross@intel.com>
2023-09-27 16:44:13 +00:00
77336de8f7 Add documentation for Intel RDT support
Signed-off-by: Wolfgang Pross <wolfgang.pross@intel.com>
2023-09-27 16:44:13 +00:00
6a4df3af3f Merge pull request #20037 from mheon/fix_sigproxy_docs
[CI:DOCS] Docs on sig-proxy are wrong, we support TTY
2023-09-19 21:51:11 +02:00
8afffa1aa7 Docs on sig-proxy are wrong, we support TTY
Also, we don't proxy SIGURG (Golang uses it internally for waking
threads, so Go processes get it constantly (see [1] for more
details).

[1] https://github.com/golang/go/issues/37942

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-09-19 13:25:50 -04:00
3984b45b42 Merge pull request #19976 from plettich/patch-1
[CI:DOCS] Fix some spelling and formatting  in volume options
2023-09-14 17:49:43 +02:00
c689fb4a5b Fix some spelling and formatting
Signed-off-by: Paul Lettich <paul.lettich@netknights.it>
2023-09-14 14:46:50 +02:00
522e0f43f4 Add support for Ulimit in quadlet
QM needs to be able to specify the maximum number of open files within the QM
environment to ensure FFI.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-09-14 06:17:43 -04:00
bf86ed72c2 [CI:DOCS] restart.md: migrate to container unit
Fixes: https://github.com/containers/podman/issues/19968

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-09-14 06:51:35 +02:00
8b4a79a744 linux, rootless: clamp oom_score_adj if it is too low
when running rootless, if the specified oom_score_adj for the
container process is lower than the current value, clamp it to the
current value and print a warning.

Closes: https://github.com/containers/podman/issues/19829

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-04 14:44:14 +02:00
18d35b6122 Fix gidmap command in example
Since we do not want the mapping to be applied to uids,
we should use the `g` flag in the mapping in the example
as well.

Follow up of #18173

Signed-off-by: Sergio Oller <sergioller@gmail.com>
2023-08-30 13:47:23 +02:00
91b8bc7f13 uid/gid mapping flags
Motivation
===========

This feature aims to make --uidmap and --gidmap easier to use, especially in rootless podman setups.

(I will focus here on the --gidmap option, although the same applies for --uidmap.)

In rootless podman, the user namespace mapping happens in two steps, through an intermediate mapping.

See https://docs.podman.io/en/latest/markdown/podman-run.1.html#uidmap-container-uid-from-uid-amount
for further detail, here is a summary:

First the user GID is mapped to 0 (root), and all subordinate GIDs (defined at /etc/subgid, and
usually >100000) are mapped starting at 1.

One way to customize the mapping is through the `--gidmap` option, that maps that intermediate mapping
to the final mapping that will be seen by the container.

As an example, let's say we have as main GID the group 1000, and we also belong to the additional GID 2000,
that we want to make accessible inside the container.

We first ask the sysadmin to subordinate the group to us, by adding "$user:2000:1" to /etc/subgid.

Then we need to use --gidmap to specify that we want to map GID 2000 into some GID inside the container.

And here is the first trouble:

Since the --gidmap option operates on the intermediate mapping, we first need to figure out where has
podman placed our GID 2000 in that intermediate mapping using:

    podman unshare cat /proc/self/gid_map

Then, we may see that GID 2000 was mapped to intermediate GID 5. So our --gidmap option should include:

    --gidmap 20000:5:1

This intermediate mapping may change in the future if further groups are subordinated to us (or we stop
having its subordination), so we are forced to verify the mapping with
`podman unshare cat /proc/self/gid_map` every time, and parse it if we want to script it.

**The first usability improvement** we agreed on #18333 is to be able to use:

    --gidmap 20000:@2000:1

so podman does this lookup in the parent user namespace for us.

But this is only part of the problem. We must specify a **full** gidmap and not only what we want:

    --gidmap 0:0:5 --gidmap 5:6:15000 --gidmap 20000:5:1

This is becoming complicated. We had to break the gidmap at 5, because the intermediate 5 had to
be mapped to another value (20000), and then we had to keep mapping all other subordinate ids... up to
close to the maximum number of subordinate ids that we have (or some reasonable value). This is hard
to explain to someone who does not understand how the mappings work internally.

To simplify this, **the second usability improvement** is to be able to use:

   --gidmap "+20000:@2000:1"

where the plus flag (`+`) states that the given mapping should extend any previous/default mapping,
overriding any previous conflicting assignment.

Podman will set that mapping and fill the rest of mapped gids with all other subordinated gids, leading
to the same (or an equivalent) full gidmap that we were specifying before.

One final usability improvement related to this is the following:

By default, when podman  gets a --gidmap argument but not a --uidmap argument, it copies the mapping.
This is convenient in many scenarios, since usually subordinated uids and gids are assigned in chunks
simultaneously, and the subordinated IDs in /etc/subuid and /etc/subgid for a given user match.

For scenarios with additional subordinated GIDs, this map copying is annoying, since it forces the user
to provide a --uidmap, to prevent the copy from being made. This means, that when the user wants:

    --gidmap 0:0:5 --gidmap 5:6:15000 --gidmap 20000:5:1

The user has to include a uidmap as well:

    --gidmap 0:0:5 --gidmap 5:6:15000 --gidmap 20000:5:1 --uidmap 0:0:65000

making everything even harder to understand without proper context.

For this reason, besides the "+" flag, we introduce the "u" and "g" flags. Those flags applied to a
mapping tell podman that the mapping should only apply to users or groups, and ignored otherwise.

Therefore we can use:

   --gidmap "+g20000:@2000:1"

So the mapping only applies to groups and is ignored for uidmaps. If no "u" nor "g" flag is assigned
podman assumes the mapping applies to both users and groups as before, so we preserve backwards compatibility.

Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Sergio Oller <sergioller@gmail.com>
2023-08-28 20:21:04 +02:00
18c2a2be87 [DOC] Clarify default behaviour on uidmap
Specify that by default if only one of uidmap or gidmap is given, the other one is copied

Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Sergio Oller <sergioller@gmail.com>
2023-08-28 20:21:04 +02:00
0938ee1899 push, manifest-push: --force-compression must be true with --compression-format
Value of `--force-compression` should be already `true` is
`--compression-format` is selected otherwise let users decide.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-08-28 16:41:13 +05:30
f727428b52 Merge pull request #19663 from rhatdan/ramfs
Add support for ramfs as well as tmpfs in volume mounts
2023-08-21 16:51:06 -02:30
45ce4834af Add support for ramfs as well as tmpfs in volume mounts
Users want to mount a tmpfs file system with secrets, and make
sure the secret is never saved into swap. They can do this either
by using a ramfs tmpfs mount or by passing `noswap` option to
a tmpfs mount.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-21 07:14:57 -04:00
27b41f0877 libpod: use /var/run instead of /run on FreeBSD
This changes /run to /var/run for .containerenv and secrets in FreeBSD
containers for consistency with FreeBSD path conventions. Running Linux
containers on FreeBSD hosts continue to use /run for compatibility.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-08-17 14:04:53 +01:00
345b9b0295 Update rootfs.md: Fix formatting and wording of idmap option
The newly introduced `idmap` section of rootfs lacked a header
(comparable to Overlay Rootfs Mounts), had odd formatting, and
wording that differed from other instances of idmap, e.g., the
one in the --volume section. This commits addresses those issues.

Signed-off-by: Peter Whittaker <PeterWhittaker@SphyrnaSecurity.com>
2023-08-14 09:21:24 -04:00
1e54539432 Add support for passing container stop timeout as -1 (infinite)
Compat api for containers/stop should take -1 value

Add support for `podman stop --time -1`
Add support for `podman restart --time -1`
Add support for `podman rm --time -1`
Add support for `podman pod stop --time -1`
Add support for `podman pod rm --time -1`
Add support for `podman volume rm --time -1`
Add support for `podman network rm --time -1`

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-04 08:36:45 -04:00
cd5ce63724 Merge pull request #19406 from rhatdan/volumes
Fix up man page and add test on globs
2023-08-02 13:44:34 +02:00