Commit Graph

1915 Commits

Author SHA1 Message Date
OpenShift Merge Robot c742ec6fea
Merge pull request #19617 from edsantiago/sphinx_ignore
[CI:DOCS] sphinx: skip options include dir
2023-08-14 15:45:04 -02:30
Ed Santiago 4c7546cb31 sphinx: skip options include dir
Tell sphinx not to process the "options" dir, those files
are not to be published.

Context: websearching for podman volume info, I stumbled upon:

   https://docs.podman.io/en/latest/markdown/options/volume.html

...and panicked because I saw '<<container|pod>>', the options
include-file syntax that should never be seen by users. I thought
the filter script was broken.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-08-14 08:12:16 -06:00
Peter Whittaker 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
Urvashi Mohnani dce3ef3c42 Add podman farm update command
Podman farm update allows users to update a farm by addig
connections, removing connections, or changing the default farm.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-08-09 13:37:37 -04:00
Urvashi Mohnani 44a704dfcf Add podman farm remove command
Podman farm remove allows users to remove one or more
existing farms.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-08-09 13:37:37 -04:00
Urvashi Mohnani 59a8140f1f Add podman farm list command
The podman farm list command allows users to list
the existing farms.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-08-09 13:37:37 -04:00
Urvashi Mohnani 6fcdf1a190 Add podman farm create command
The podman farm create command allows users to create
farms from the avaiable podman system connections.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-08-09 13:37:37 -04:00
Urvashi Mohnani 1d5ef29f01 Add podman farm subcommand
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-08-09 13:37:33 -04:00
Daniel J Walsh f55c48ad3a
podman stop --cidfile missing --ignore
Podman should ignore failures to find a cidfile when stoping the
container if the user specified --ignore

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-08 17:03:15 -04:00
OpenShift Merge Robot 1899d21212
Merge pull request #19544 from NitrogenUA/build-docs
[CI:DOCS] fixed couple typos in build docs
2023-08-08 11:01:40 -04:00
Oleh Dmytrychenko 8a410784b4
[CI:DOCS] fixed couple typos in build docs
Signed-off-by: Oleh Dmytrychenko <dmytrychenko.oleh@gmail.com>
2023-08-08 12:57:43 +03:00
OpenShift Merge Robot 2f50d8e579
Merge pull request #19425 from rhatdan/service
Add support for passing container stop timeout as -1 (infinite)
2023-08-08 04:52:33 -04:00
Ygal Blum 518daef729 [CI:DOCS] Quadlet - provide more information about network files
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-08-07 16:53:40 +03:00
OpenShift Merge Robot 9e18e9fafd
Merge pull request #19414 from rhatdan/systemd
Deprecate podman generate systemd
2023-08-04 20:06:41 +02:00
Daniel J Walsh 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
Erik Sjölund f5058f1483 [CI:DOCS] man: remove duplicate entry .LastUp
Fixes: https://github.com/containers/podman/issues/19462

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-08-04 08:47:08 +02:00
OpenShift Merge Robot 84dec22349
Merge pull request #19494 from rhatdan/codespell
Run codespell on code
2023-08-03 19:32:27 +02:00
OpenShift Merge Robot bde942e216
Merge pull request #19468 from flouthoc/manifest-add-compression
manifest, push: implement `--add-compression` to push with compressed variants.
2023-08-03 13:15:34 +02:00
Daniel J Walsh 62a22c5d60
Run codespell on code
Also cleanup --rm=true to be just --rm

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-03 07:00:30 -04:00
Daniel J Walsh 44f159ed31
Deprecate podman generate systemd
Now that Quadlets are fully supported, it is time to Depracate
podman generate systemd command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-03 06:58:53 -04:00
OpenShift Merge Robot b8c9ad8982
Merge pull request #19482 from rhatdan/rmi
Make podman run --rmi automatically set --rm
2023-08-03 10:55:00 +02:00
Aditya R 346f9cb4ed
manifest/push: add support for --add-compression
Adds support for --add-compression which accepts multiple compression
formats and when used it will add all instances in a manifest list with
requested compression formats.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-08-03 14:20:38 +05:30
Adam Jones 15f35d3548
Remove unnecessary backslashes
Signed-off-by: Adam Jones <domdomegg+git@gmail.com>
2023-08-02 15:01:16 +01:00
Adam Jones 18e75daa53
[docs] Use code blocks for commands in podman-completion
Currently, due to sphinx smart quote features being enabled, fancy quotes are used in the commands. This means the docs are harder to use as the commands cannot be copy/pasted into a terminal.

Wrapping the code in code blocks fixes this. An alternative would be to disable smart quotes entirely, but this seems over-the-top (especially considering wrapping commands in code blocks harmonises this page with most of the other documentation)

Signed-off-by: Adam Jones <domdomegg+git@gmail.com>
2023-08-02 14:07:57 +01:00
Daniel J Walsh f3ebd798c6
Make podman run --rmi automatically set --rm
Forcing users to set --rm when setting --rmi is just bad UI.
If I want the image to be removed, it implies that I want the
container removed that I am creating.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-02 08:33:06 -04:00
OpenShift Merge Robot 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
OpenShift Merge Robot 2252ed1241
Merge pull request #19436 from rhatdan/remote
Cleanup CIDFile on podman-remote run --rm command
2023-08-02 12:00:27 +02:00
danishprakash bfd2a8cad3
secret: add support for `--ignore` with rm
Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-08-02 11:13:08 +05:30
Daniel J Walsh 851cd9cca9
Cleanup CIDFile on podman-remote run --rm command
Currently the CIDFile is not removed with podman --remote run --rm
if the client and server are on different machines.

[NO NEW TESTS NEEDED] i
There is currently a test for this that does not fail because the client
and server are on the same machine.

If we run these tests on a MAC or Windows platform, they would start
failing.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-01 14:24:55 -04:00
Daniel J Walsh ee9fb3680d
Merge branch 'main' of github.com:containers/podman into volumes 2023-08-01 14:09:29 -04:00
Daniel J Walsh 33b8c451e5
Fix up man page and add test on globs
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-01 10:28:00 -04:00
OpenShift Merge Robot 7d5f9de7a9
Merge pull request #19423 from rhatdan/man
[CI:DOCS] Mention no comment lines in Containerfile.in podman-build man page
2023-08-01 12:16:25 +02:00
OpenShift Merge Robot ad9015f478
Merge pull request #19096 from BlackHole1/support-new-line
feat(env): support multiline in env-file
2023-07-31 21:40:13 +02:00
Daniel J Walsh 6930f39a66
Update docs/source/markdown/podman-build.1.md.in
Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-31 15:20:58 -04:00
OpenShift Merge Robot a52cefe6b9
Merge pull request #19431 from rhatdan/man1
[CI:DOCS] Improve the description of fields in podman-stats man page
2023-07-31 21:01:24 +02:00
OpenShift Merge Robot 6b404759f2
Merge pull request #19422 from rhatdan/read-only
make /dev & /dev/shm read/only when --read-only --read-only-tmpfs=false
2023-07-31 20:24:16 +02:00
Daniel J Walsh 4f1f88d7c3
Mention TimeoutStartSec in quadlet man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-31 11:43:56 -04:00
Daniel J Walsh acbe7703f9
Update docs/source/markdown/podman-stats.1.md.in
Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-31 09:31:33 -04:00
Black-Hole1 c67ef7c1a1
docs(env-file): improve document description
Signed-off-by: Black-Hole1 <bh@bugs.cc>
2023-07-31 20:24:26 +08:00
Daniel J Walsh 630e7ba394
Improve the description of fields in podman-stats man page
Fixes: https://github.com/containers/podman/issues/15146

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-30 06:28:30 -04:00
Daniel J Walsh 22a8b68866
make /dev & /dev/shm read/only when --read-only --read-only-tmpfs=false
The intention of --read-only-tmpfs=fals when in --read-only mode was to
not allow any processes inside of the container to write content
anywhere, unless the caller also specified a volume or a tmpfs. Having
/dev and /dev/shm writable breaks this assumption.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-30 06:09:30 -04:00
Daniel J Walsh 663fe9446b
Mention no comment lines in Containerfile.in podman-build man page
Fixes: https://github.com/containers/podman/issues/13070

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-29 07:09:02 -04:00
Daniel J Walsh 0fefcf8a4f
Add glob support to podman run/create --mount
HPC Community asked for this support specifically for using GPUs
within containers. Nvidia requires the correct shared library to
to be present in the directory that matches the device mounted
into the container. These libraries have random suffixes based
on versions of the installed libraries on the host.

podman run --mount type=glob:src=/usr/lib64/nvidia\*:ro=true. This helps
quadlets be more portable for this use case.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-27 06:32:54 -04:00
OpenShift Merge Robot 9706147089
Merge pull request #19353 from vrothberg/fix-6160
add "healthy" sdnotify policy
2023-07-26 09:18:57 +02:00
Daniel J Walsh 1f455cf619
Merge pull request #19320 from eriksjolund/remove_unnecessary_please
Remove unnecessary use of the word "please"
2023-07-25 15:20:38 -04:00
Valentin Rothberg 0cfd12786f add "healthy" sdnotify policy
Add a new "healthy" sdnotify policy that instructs Podman to send the
READY message once the container has turned healthy.

Fixes: #6160
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-25 11:17:44 +02:00
OpenShift Merge Robot 22cb23b41e
Merge pull request #19297 from vrothberg/RUN-1865
add a podman-compose command
2023-07-25 03:30:38 +02:00
Daniel J Walsh 2a559dc1a1
Merge pull request #19230 from rhatdan/quadlet
Add support for ShmSize to quadlet
2023-07-24 14:11:36 -04:00
Valentin Rothberg e596b17fbe add a podman-compose command
**podman compose** is a thin wrapper around an external compose provider
such as docker-compose or podman-compose.  This means that `podman
compose` is executing another tool that implements the compose
functionality but sets up the environment in a way to let the compose
provider communicate transparently with the local Podman socket.  The
specified options as well the command and argument are passed directly
to the compose provider.

The default compose providers are `docker-compose` and `podman-compose`.
If installed, `docker-compose` takes precedence since it is the original
implementation of the Compose specification and is widely used on the
supported platforms (i.e., Linux, Mac OS, Windows).

If you want to change the default behavior or have a custom installation
path for your provider of choice, please change the `compose_provider`
field in `containers.conf(5)`.  You may also set the
`PODMAN_COMPOSE_PROVIDER` environment variable.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-24 19:23:04 +02:00
Daniel J Walsh 03ea93c21b
Merge pull request #19323 from eriksjolund/fix_language_typos_markdown_layout
Fix language, typos and markdown layout
2023-07-24 10:56:11 -04:00
Erik Sjölund b5ce0ab2de Fix language, typos and markdown layout
[NO NEW TESTS NEEDED]

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-24 11:18:25 +02:00
Ygal Blum cb5450af70 [CI:DOCS] Add note about QUADLET_UNIT_DIRS to simplify quadlet debug
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-07-24 10:23:02 +03:00
OpenShift Merge Robot 5dd8906e71
Merge pull request #19288 from IceWreck/quadlet-debugging-docs
[CI:DOCS] Add note on debugging quadlet unit files
2023-07-24 09:02:32 +02:00
Anchit Bajaj 0bb73bf554 Add note on debugging quadlet unit files
Signed-off-by: Anchit Bajaj <ab@abifog.com>
2023-07-24 05:06:09 +00:00
Erik Sjölund d4cfc498d7 Remove unnecessary use of the word "please".
Only use the word "please" in these situations:

- reader is asked to do something inconvenient
- reader is asked for permission
- reader is asked for forgiveness

Remove other uses of the word "please" to
make the language more efficient.

[NO NEW TESTS NEEDED]

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-23 17:31:29 +02:00
OpenShift Merge Robot 67f0340687
Merge pull request #18830 from harikannan512/new-18032-2
recursive call in user directories for unit files
2023-07-22 15:11:24 +02:00
Daniel J Walsh 3e534eff9d
Add support for ShmSize to quadlet
I am working on running android auto in a quadlet.

[Container]
AddDevice=/dev/dri/renderD128
AddDevice=/dev/kvm
DropCapability=all
Environment=PULSE_SERVER=$XDG_RUNTIME_DIR/pulse/native
Environment=WAYLAND_DISPLAY=wayland-0
Environment=XDG_RUNTIME_DIR
Image=quay.io/slopezpa/qemu-aaos
ContainerName=Android
PodmanArgs=--shm-size=5g
SecurityLabelDisable=true
Volume=$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR

And I need to be able to set the --shm-size option.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-22 06:41:39 -04:00
Hari Kannan 413552e10e quadlet recursively scan for unit files
Signed-off-by: Hari Kannan <harikannan512@gmail.com>
2023-07-20 23:10:28 +01:00
Matt Heon ce736413b4 Ensure that we appropriately warn that TCP is insecure
`podman system service` + TCP is not a configuration we should be
recommending. There was already language about this in the
manpages, but it was not sufficient in explaining how bad of an
idea this is. Expand the manpage warnings, add a dedicated
heading so people notice, and add a warning every time the
service starts with a TCP URL that directs people to the manpage
to see that explanation.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-07-20 14:22:04 -04:00
OpenShift Merge Robot 7974eb181b
Merge pull request #19275 from jakecorrenti/since-volume-filter-support
Add `since` as valid filter option for `volume` subcommands
2023-07-19 23:34:05 +02:00
OpenShift Merge Robot d98978ae15
Merge pull request #19256 from ygalblum/quadlet-working-dir
Quadlet - Allow setting Service WorkingDirectory for Kube units
2023-07-19 13:45:42 +02:00
Ygal Blum 8d190704a6 Quadlet - Allow setting Service WorkingDirectory for Kube units
Add key for Quadlet to set WorkingDirectory to the directory of the YAML or Unit file
Add Doc
Add E2E tests
Add System test

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-07-19 11:56:38 +03:00
iczero 3d6bc2f865 Fix markdown in docs for podman-network-create
Signed-off-by: iczero <iczero4@gmail.com>
2023-07-18 13:49:41 -07:00
Jake Correnti e55e128fcd Add `since` as valid filter option for `volume` subcommands
Adds support for `since` as a valid filter option for `podman volume ls`
and `podman volume prune`.

Implements: #19228
Initially suggested from: #19119

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-18 14:52:42 -04:00
OpenShift Merge Robot 7791ffd215
Merge pull request #19140 from lsm5/podmansh-followup
Podmansh: Useful timeout error, increase timeout to 30s
2023-07-18 20:50:56 +02:00
Lokesh Mandvekar 6df17332b5
Podmansh: Better error, increase timeout to 30s
Co-authored-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-07-18 10:15:12 -04:00
Jake Correnti 96241159a8 Fix multiple filter options logic for `podman volume ls `
Fixes a bug where `podman volume ls` with multiple `label` filters would
return volumes that matched *any* of the filters, not *all* of them.

Adapts generating volume filter functions to be more in
line with how it is done for containers and pods.

Fixes: #19219

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-18 09:53:03 -04:00
OpenShift Merge Robot 49a924cf39
Merge pull request #19211 from jakecorrenti/add-reserved-flag-generate
Add `--podman-only` flag to `podman generate kube`
2023-07-16 17:34:35 +02:00
Jake Correnti d0602e8f75 Add `--podman-only` flag to `podman generate kube`
Adds an `--podman-only` flag to `podman generate kube` to allow for
reserved annotations to be included in the generated YAML file.

Associated with: #19102

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-14 09:35:59 -04:00
OpenShift Merge Robot bb72016f58
Merge pull request #19066 from Luap99/ps
top: do not depend on ps(1) in container
2023-07-14 13:17:59 +02:00
OpenShift Merge Robot c46fd411e0
Merge pull request #19098 from imphil/userns-docs
[CI:DOCS] Better document the default value of --userns
2023-07-14 13:12:42 +02:00
OpenShift Merge Robot 265718596c
Merge pull request #19225 from Luap99/network-doc
[CI:DOCS] update --network docs
2023-07-14 01:43:12 +02:00
Jake Correnti 0997cf012a Fix `podman container prune` docs for `--filter`
Fixes an error in the `podman container prune` docs that provides an
example of how to use the `--filter until=` flag/filter in an incorrect
way.

Fixes: #19119

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-13 12:04:13 -04:00
Paul Holzinger 383d683f85
docs: podman-build --network add slirp and pasta
Support was added in buildah some weeks ago. [1]

[1] https://github.com/containers/buildah/pull/4877

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-13 16:31:17 +02:00
Paul Holzinger 5e64cbf358
docs: podman run --network mention comma separted names
This syntax was used prior to 4.0 and is still supported for backwards
compatibility.

Fixes #19089

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-13 16:28:01 +02:00
Paul Holzinger 85d9361332
network create: document --internal better
When using --internal for macvlan/ipvlan networks we simply do not add a
default gateway/route. Make this clear in the docs.

Fixes #18914

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-13 13:23:21 +02:00
OpenShift Merge Robot 69f112a8bf
Merge pull request #19200 from rhatdan/secret1
Add secret support to podman login
2023-07-13 03:06:50 -04:00
Philipp Wagner cce8501a5b [CI:DOCS] Reformat and reorder table with --userns options
Reorder the table with --userns options to match the description below.
Also, reformat the Markdown to be better readable in source form.

Signed-off-by: Philipp Wagner <phw@ibm.com>
2023-07-12 16:05:06 +02:00
OpenShift Merge Robot 9d9f4aaafe
Merge pull request #19006 from deuill/quadlet-volume-network-names
Allow setting volume and network names in Quadlet
2023-07-12 08:53:38 -04:00
Daniel J Walsh d497eb369c
Add secret support to podman login
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-12 08:45:02 -04:00
Daniel J Walsh 0dcfe6e069
Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-11 16:44:22 -04:00
Jake Correnti 7b54fd84ec Add `--no-trunc` flag to maintain original annotation length
Adds a `--no-trunc` flag to `podman kube generate` preventing the
annotations from being trimmed at 63 characters. However, due to
the fact the annotations will not be trimmed, any annotation that is
longer than 63 characters means this YAML will no longer be Kubernetes
compatible. However, these YAML files can still be used with `podman
kube play` due to the addition of the new flag below.

Adds a `--no-trunc` flag to `podman kube play` supporting YAML files with
annotations that were not truncated to the Kubernetes maximum length of
63 characters.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-10 18:02:53 -04:00
Alex Palaistras 932fae4028 Allow setting volume and network names in Quadlet
This commit extends `Volume` and `Network` unit definitions with two
additional parameters, `VolumeName` and `NetworkName`, which will,
respectively, set a user-defined name for the corresponding volume and
network. This is similar to how the `ContainerName` directive currently
works, and should allow for smoother transitions to Quadlet-managed
resources.

Closes: #19003
Signed-off-by: Alex Palaistras <alex@deuill.org>
2023-07-10 20:33:19 +01:00
OpenShift Merge Robot eb9d44241e
Merge pull request #19004 from rhatdan/secret
Add --replace flag to podman secret create
2023-07-10 14:59:29 -04:00
Valentin Rothberg a69194b02f manifest inspect: support authentication
Previous tests have worked by pure chance since the client and server
ran on the same host; the server picked up the credentials created by
the client login.

Extend the gating tests and add a new integration test which is further
capable of exercising the remote code.

Note that fixing authentication support requires adding a new
`--authfile` CLi flag to `manifest inspect`.  This will at least allow
for passing an authfile to be bindings.  Username and password are not
yet supported.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-10 16:26:19 +02:00
Paul Holzinger 597ebeb60f
top: do not depend on ps(1) in container
This ended up more complicated then expected. Lets start first with the
problem to show why I am doing this:

Currently we simply execute ps(1) in the container. This has some
drawbacks. First, obviously you need to have ps(1) in the container
image. That is no always the case especially in small images. Second,
even if you do it will often be only busybox's ps which supports far
less options.

Now we also have psgo which is used by default but that only supports a
small subset of ps(1) options. Implementing all options there is way to
much work.

Docker on the other hand executes ps(1) directly on the host and tries
to filter pids with `-q` an option which is not supported by busybox's
ps and conflicts with other ps(1) arguments. That means they fall back
to full ps(1) on the host and then filter based on the pid in the
output. This is kinda ugly and fails short because users can modify the
ps output and it may not even include the pid in the output which causes
an error.

So every solution has a different drawback, but what if we can combine
them somehow?! This commit tries exactly that.

We use ps(1) from the host and execute that in the container's pid
namespace.
There are some security concerns that must be addressed:
- mount the executable paths for ps and podman itself readonly to
  prevent the container from overwriting it via /proc/self/exe.
- set NO_NEW_PRIVS, SET_DUMPABLE and PDEATHSIG
- close all non std fds to prevent leaking files in that the caller had
  open
- unset all environment variables to not leak any into the contianer

Technically this could be a breaking change if somebody does not
have ps on the host and only in the container but I find that very
unlikely, we still have the exec in container fallback.

Because this can be insecure when the contianer has CAP_SYS_PTRACE we
still only use the podman exec version in that case.

This updates the docs accordingly, note that podman pod top never falls
back to executing ps in the container as this makes no sense with
multiple containers so I fixed the docs there as well.

Fixes #19001
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2215572

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-10 13:32:55 +02:00
OpenShift Merge Robot 7cd1fb77f9
Merge pull request #19172 from eriksjolund/fix_underscore_in_man_page
[CI:DOCS] uidmap man pages: fix corrupt italics
2023-07-10 05:30:58 -04:00
Michael Hrivnak 1b7eb44d3b Fixes typo in the path where quadlet looks for files
This change matches the list above in the same document, in the section
`Podman user unit search path`. I also confirmed that this matches [the
code](https://github.com/containers/podman/blob/60a5a59/cmd/quadlet/main.go#L119).

Signed-off-by: Michael Hrivnak <mhrivnak@hrivnak.org>
2023-07-09 15:53:56 -04:00
Daniel J Walsh efefd8cf5b
Add --replace flag to podman secret create
Users may want to replace the secret used within containers, without
destroying the secret and recreating it.

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

Make sure podman --remote secret inspect and podman secret inspect
return the same error message.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-09 07:26:09 -04:00
OpenShift Merge Robot 5d706eb027
Merge pull request #19084 from eriksjolund/add_docs_to_system_service
[CI:DOCS] podman-system-service.1.md: document systemd usage
2023-07-09 07:22:17 -04:00
Erik Sjölund eec438222a [CI:DOCS] uidmap man pages: fix corrupt italics
The markdown-to-manpage sequence interprets
_from_uid_ and *from_uid* differently.
Use the latter syntax to get the expected result.

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

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-09 10:50:48 +02:00
Erik Sjölund f9077689ea [CI:DOCS] podman-system-service.1.md: document systemd usage
Regarding "The command does not support more than one listening socket for the API service."
See this Podman source code: (a permalink into the main branch as of 2 July 2023)
539be58163/cmd/podman/system/service_abi.go (L48-L50)

Move up the paragraph "The REST API provided ...".

Move up the sentence "Note: The default systemd ...".

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-08 18:17:02 +02:00
Anders F Björklund fa654e9857 Use bytes size consistently instead of human size
Previously podman was using "MB" and "GB" (binary) for input but
"MB" and "GB" (decimal) for output, which was causing confusion.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2023-07-06 14:51:06 +02:00
Valentin Rothberg d874790bc6 auto update: fix usage of --authfile
The --authfile flag has been ignored.  Fix that and add a test to make
sure we won't regress another time.  Requires a new --tls-verify flag
to actually test the code.

Also bump c/common since common/pull/1538 is required to correctly check
for updates.  Note that I had to use the go-mod-edit-replace trick on
c/common as c/buildah would otherwise be moved back to 1.30.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2218315
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-05 08:30:39 +02:00
Philipp Wagner 5aabc5088a [CI:DOCS] Better document the default value of --userns
Better document which value `podman run --userns` has if no default
value is specified. Also improve documentation of "host" being an alias
for "".

Fixes #15764

Signed-off-by: Philipp Wagner <phw@ibm.com>
2023-07-03 17:31:39 +02:00
Ed Santiago 4a5396b467 [CI:DOCS] uidmap man pages: fix corrupt tables
The markdown-to-manpage sequence needs a long row of dashes,
not a single dash. A single dash, as used in this one option,
generates unreadable *roff.

Also, some tool somewhere doesn't like too-long columns. Shrtn thm.

Also, verify that there are no more three-or-fewer-dash columns:

    $ ack '\|\s+-{1,3}\s' docs/source/markdown

Fixes: #19086

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-07-02 17:38:42 -06:00
Daniel J Walsh bf60bb0731
Display secret to user in inpspect
It is pretty complicated to display the secret on the host, but is
not really secured. This patch makes it easier to examine the secret.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-28 13:14:49 -04:00
OpenShift Merge Robot c928da6d67
Merge pull request #18975 from rhatdan/man
Kube quadlets can support autoupdate as well as containers
2023-06-27 19:52:09 +02:00
Daniel J Walsh cf9ebcddfd
Fix up podmansh man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-27 12:05:24 -04:00
Daniel J Walsh eeb7aeb496
Kube quadlets can support autoupdate as well as containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-27 11:20:14 -04:00
OpenShift Merge Robot 384638861b
Merge pull request #18978 from rhatdan/man1
[CI:DOCS] Fix example on PublishPort
2023-06-23 20:57:22 +02:00
Valentin Rothberg 1398cbce8a container wait: support health states
Support two new wait conditions, "healthy" and "unhealthy".  This
further paves the way for integrating sdnotify with health checks which
is currently being tracked in #6160.

Fixes: #13627
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-23 14:16:32 +02:00
Daniel J Walsh b680daa2de
[CI:DOCS] Fix example on PublishPort
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-23 06:47:05 -04:00
Valentin Rothberg 64153ace05 podman wait: update man page
While reading the code I found the man page to be lacking some
information that I found worth mentioning and clarifying.
In particular, how the command behaves with respect to exit codes and
when more than one condition is specified.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-23 09:26:30 +02:00
danishprakash bd69b151fa
run,create: modify `--env-merge` behavior for non-existent vars
Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-06-22 15:42:55 +05:30
Giuseppe Scrivano bb932cc840
cmd, push: expose --compression-level
This patch adds the --compression-level option to the push command.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-21 14:28:16 +02:00
OpenShift Merge Robot 772f82ee67
Merge pull request #18917 from Luap99/ip-range
network create --ip-range allow for custom range
2023-06-19 15:02:48 -04:00
OpenShift Merge Robot 30d6543d8a
Merge pull request #18909 from sstosh/service_destination
[CI:DOCS] Fix service_destinations description in podman man page
2023-06-19 04:14:14 -04:00
Aditya R 3829fbd35a
podman: add support for splitting imagestore
Add support for `--imagestore` in podman which allows users to split the filesystem of containers vs image store, imagestore if configured will pull images in image storage instead of the graphRoot while keeping the other parts still in the originally configured graphRoot.

This is an implementation of
https://github.com/containers/storage/pull/1549 in podman.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-06-17 08:51:08 +05:30
Paul Holzinger e292748534
network create --ip-range allow for custom range
The backend allows for any start/end ip in the subnet. There is no
reason to limit the cli to only CIDR subnets. This allows for much more
flexibility.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-16 17:57:17 +02:00
Toshiki Sonoda 8d036906a9 [CI:DOCS] Fix service_destinations description in podman man page
- [service_destinations] should be [engine.service_destinations]
- service_destinations does not read from
  `/usr/share/containers/containers.conf` because podman uses config.ReadCustomConfig().

Fixes: #15615

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-06-16 16:04:21 +09:00
OpenShift Merge Robot 189a74d345
Merge pull request #18891 from rhatdan/update
Add support for setting autoupdate in quadlet
2023-06-15 13:13:37 -04:00
OpenShift Merge Robot 1f18ad535a
Merge pull request #18739 from lsm5/podmansh-exec-3
New command: podmansh
2023-06-15 10:16:59 -04:00
Daniel J Walsh 479677cb65
Add support for setting autoupdate in quadlet
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-15 09:30:37 -04:00
Lokesh Mandvekar 3efaffae43
New command: podmansh
This commit creates a new command `podmansh` command which can be used by
administrators to provide a confined shell to their users.

The user will only have access to the volumes and capabilities for that
user.

Co-authored-by: Paul Holzinger <pholzing@redhat.com>
Co-authored-by: Daniel Walsh <dwalsh@redhat.com>
Co-authored-by: Petr Lautrbach <lautrbach@redhat.com>
Co-authored-by: Ed Santiago <santiago@redhat.com>

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-06-15 08:14:12 -04:00
Daniel J Walsh bdc2e81654
Add quadlet container support for Mask,Umask options
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-14 14:07:39 -04:00
OpenShift Merge Robot 79eed081d8
Merge pull request #18864 from xduugu/quadlet-docs
[CI:DOCS] quadlet: adjust container unit documentation
2023-06-13 18:11:02 -04:00
Daniel J Walsh 741ad0b4f8
Apply suggestions from code review
Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-13 12:54:34 -04:00
Valentin Rothberg 354b8e20b8 [CI:DOCS] clarify supported transports in manifest push
Closes: #18357
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-13 16:14:26 +02:00
Valentin Rothberg aa7a4219ee [CI:DOCS] podman-push: rm confusion on supported transports
Remote clients only support the docker transport which is mentioned in
the destination table below.  So drop the redundant text on supported
transports from the main description to avoid confusion.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-13 16:14:21 +02:00
Paul Holzinger af7555e0dd
network-create: document new bclim option
see https://github.com/containers/common/pull/1474

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-13 11:48:15 +02:00
Toshiki Sonoda 6f821634ad libpod: Podman info output more network information
podman info prints the network information about binary path,
package version, program version and DNS information.

Fixes: #18443

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-06-13 11:19:29 +09:00
Cedric Staniewski ac0ba2c2c3 quadlet: adjust container unit documentation
Fixes #17909

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
2023-06-12 21:59:30 +02:00
OpenShift Merge Robot 77d2ae90c6
Merge pull request #18838 from rhatdan/workdir
Add WorkingDir support to quadlet
2023-06-12 09:56:06 -04:00
Daniel J Walsh 16092930c7
Update docs/source/markdown/podman-systemd.unit.5.md
Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-12 08:07:42 -04:00
Daniel J Walsh a66bab3403
Add WorkingDir support to quadlet
One feature needed for podmansh is the ability to set the default
homedir to be the workingdir when you login.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-12 05:15:44 -04:00
Jan Hendrik Farr 8bf168cc13
Add ability to set static routes
add routes using the --route flag.
the no_default_route option in --opt prevents a default route from
getting added automatically.

Signed-off-by: Jan Hendrik Farr <github@jfarr.cc>
2023-06-12 10:31:59 +02:00
OpenShift Merge Robot 81079575f5
Merge pull request #18785 from LauKr/main
Quadlet: Add support for --sysctl
2023-06-09 04:21:48 -04:00
Laurenz Kruty b37f74b732
Quadlet: Add support for --sysctl flag
The Sysctl=name=value entry can be used to set --sysctl=name=value
directly without the need to use PodmanArgs=--sysctl=name=value.

Signed-off-by: Laurenz Kruty <git@laurenzkruty.de>
2023-06-08 21:19:09 +02:00
OpenShift Merge Robot c99d42b8e4
Merge pull request #18798 from edsantiago/fix_filters
filters: better handling of id=
2023-06-07 12:31:11 -04:00
OpenShift Merge Robot 76f4571b71
Merge pull request #18796 from mheon/lock_debugging
Add support for lock debugging
2023-06-07 08:21:17 -04:00
Ed Santiago 992093ae91 filters: better handling of id=
For filter=id=XXX (containers, pods) and =ctr-ids=XXX (pods):

  if XXX is only hex characters, treat it as a PREFIX
  otherwise, treat it as a REGEX

Add tests. Update documentation. And fix an incorrect help message.

Fixes: #18471

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-07 05:29:06 -06:00
Matt Heon 944673c883 Address review feedback and add manpage notes
The inspect format for `.LockNumber` needed to be documented.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-06 11:04:59 -04:00
Daniel J Walsh 3b79f241b1
Add support for SecurityLabelNested flag in quadlet
This flag will allow us to run nested containers within
a quadlet service.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-06 10:30:48 -04:00
OpenShift Merge Robot eec15a108a
Merge pull request #18657 from arizvisa/GH-18120
Added the "--out" parameter and fixed an issue with "--noout" which prevented stdout from being written to.
2023-06-05 14:34:21 -04:00
Ygal Blum 6611735aeb Quadlet - add support for Pull key in .container
Update code, doc and test
Remove doc comment on pull policy

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-06-04 09:06:30 +03:00
OpenShift Merge Robot af5b1d6e80
Merge pull request #18643 from eriksjolund/use-imperative-form
man pages and command help: unify verb forms
2023-05-31 11:16:23 -04:00
Tom Deseyn 585d715bb9 authfile.md: add default path of file for Windows/macOS.
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
2023-05-30 11:16:34 +02:00
Erik Sjölund de92db0c81 man pages and command help: clean up descriptions
Short description in man pages:
* Use imperative form

Command help (cobra.Command.Short):
* Capitalize first letter
* Use imperative form
* Remove ending full stop when the short description
  only contains one sentence without any commas

Command help (cobra.Command.Long):
* Capitalize first letter unless the sentence starts
  with a command "podman command ..."
* Use imperative form when the long description is
  identical or almost identical to the short description.
  This modification was only done in a few places.

Command tables:
* Use imperative form in the "Description" column

[NO NEW TESTS NEEDED]

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-05-28 18:57:43 +02:00
Ed Santiago dfba6ddd4c Man pages: fix broken tables
Work around a go-md2man bug, and add a check script to make sure
this doesn't hit us again.

Background: go-md2man can't deal with a left-hand column > 31 chars.
It produces man pages that look like:

    | Something With >31 Character |                |
    |                              | ..description  |

(should be all on one row). It also has trouble when the vertical
bars are misaligned: it completely removes the right-hand side.

There's almost certainly a better solution: fix go-md2man, or
use a different conversion tool, or maybe even pre/postprocess.
But this is a quick interim solution.

Sorry for the perl. This could be done in bash/sed/awk/grep,
but not with any sort of sane error messages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-26 06:08:14 -06:00
Valentin Rothberg 8f94a4775a [CI:DOCS] fix Quadlet man page rendering
Fixes: https://github.com/containers/podman/pull/18671#pullrequestreview-1442193542
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:35 +02:00
Valentin Rothberg 6487d9c11a Quadlet: kube: add ExitCodePropagation field
Add a new field `ExitCodePropagation` field to allow for configuring the
newly added functionality of controlling how the main PID of a kube
service exits.

Jira: issues.redhat.com/browse/RUN-1776
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:35 +02:00
Valentin Rothberg 08b0d93ea3 kube play: exit-code propagation
Implement means for reflecting failed containers (i.e., those having
exited non-zero) to better integrate `kube play` with systemd.  The
idea is to have the main PID of `kube play` exit non-zero in a
configurable way such that systemd's restart policies can kick in.

When using the default sdnotify-notify policy, the service container
acts as the main PID to further reduce the resource footprint.  In that
case, before stopping the service container, Podman will lookup the exit
codes of all non-infra containers.  The service will then behave
according to the following three exit-code policies:

 - `none`: exit 0 and ignore containers (default)
 - `any`: exit non-zero if _any_ container did
 - `all`: exit non-zero if _all_ containers did

The upper values can be passed via a hidden `kube play
--service-exit-code-propagation` flag which can be used by tests and
later on by Quadlet.

In case Podman acts as the main PID (i.e., when at least one container
runs with an sdnotify-policy other than "ignore"), Podman will continue
to wait for the service container to exit and reflect its exit code.

Note that this commit also fixes a long-standing annoyance of the
service container exiting non-zero.  The underlying issue was that the
service container had been stopped with SIGKILL instead of SIGTERM and
hence exited non-zero.  Fixing that was a prerequisite for the exit-code
propagation to work but also improves the integration of `kube play`
with systemd and hence Quadlet with systemd.

Jira: issues.redhat.com/browse/RUN-1776
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:34 +02:00
OpenShift Merge Robot 688e6dbef1
Merge pull request #18640 from HirazawaUi/add-pasta-to-podman-info
podman: Add pasta to podman info
2023-05-25 06:55:04 -04:00
binghongtao 977b3cdbf6
podman: Add pasta to podman info
[NO NEW TESTS NEEDED]

Fixes: #18561

Signed-off-by: binghongtao <695097494plus@gmail.com>
2023-05-25 00:39:52 +08:00
Ygal Blum 901900530a Quadlet - add support for PodmanArgs to all groups
PodmanArgs allows users to pass arguments not explicitly supported by
Quadlet.

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-05-24 10:05:02 +03:00
OpenShift Merge Robot af8d19dc2e
Merge pull request #18581 from vrothberg/fix-18572
wait: look for exit code in stopped state
2023-05-22 11:51:14 -04:00
Valentin Rothberg 1b9272a060 wait: look for exit code in stopped state
Make sure to look for the container's exit code when it's in stopped
state.  With `--restart=always`, the container seems to stay in the
stopped state which led the wait logic to loop until the 20 seconds
timeout for the cleanup process to have finished kicks in.

Also defensively make sure to loop when the container is in stopped
state but no exit code has been written yet.

Add a regression test to make sure Podman doesn't wait more than 20
seconds.  Even on a CI machine under high load I expect it to take much
much much less than that, so I do not expect this test to flake in the
future.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-22 14:53:19 +02:00
OpenShift Merge Robot 4003871823
Merge pull request #18625 from Akasurde/docs_fix
Correct markdown in docs
2023-05-22 08:07:45 -04:00
Erik Sjölund 685c736185 source code comments and docs: fix typos, language, Markdown layout
- fix a/an before noun
- fix loose -> lose
- fix "the the"
- fix lets -> let's
- fix Markdown layout
- fix a few typos
- remove unnecessary text in troubleshooting.md

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-05-22 07:52:16 +02:00
binghongtao 29749362a0
podman: Added find slirp4netns binary file from helper_binaries_dir
[NO NEW TESTS NEEDED]

Fixes: #18568
Signed-off-by: binghongtao <695097494plus@gmail.com>
2023-05-20 03:17:22 +08:00
Abhijeet Kasurde 5d522431c6 Correct markdown in docs
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-18 16:44:24 -07:00
Daniel J Walsh 588dbcb516
Merge pull request #18614 from eriksjolund/improve_security_in_mysql_examples
[CI:DOCS] Improve security in mysql examples
2023-05-17 14:31:04 -04:00
OpenShift Merge Robot ae66ad4265
Merge pull request #18601 from giuseppe/block-PODMAN_USERNS-and---pod
run: block PODMAN_USERNS and --pod
2023-05-17 14:15:53 -04:00
Erik Sjölund a99ad3b364 [CI:DOCS] Improve security in mysql examples
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-05-17 19:44:05 +02:00
Giuseppe Scrivano 192ad70e98
run: ignore PODMAN_USERNS with --pod
the combination --pod and --userns is already blocked.  Ignore the
PODMAN_USERNS variable when a pod is used, since it would cause to
create a new user namespace for the container.

Ideally a container should be able to do that, but its user namespace
must be a child of the pod user namespace, not a sibling.  Since
nested user namespaces are not allowed in the OCI runtime specs,
disallow this case, since the end result is just confusing for the
user.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-05-17 16:49:16 +02:00
Ed Santiago bf0cea76c7 fix HTMLSpan warnings
'make docs' has been spitting out these warnings:

   WARNING: go-md2man does not handle node type HTMLSpan

Warnings suck, they cost us important time and attention.

This warning is always caused by left-angle-brackets in markdown
but they are very hard to find. I've found them and fixed them.
Warnings are now gone.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-17 07:21:14 -06:00
Daniel J Walsh 32c2cea0f9
Remove future tense from man pages
Remove all will, would, could, should and use present tense.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-16 15:10:33 -04:00
OpenShift Merge Robot 07d2fbcd52
Merge pull request #18567 from ashley-cui/doc
[CI:DOCS] Document podman-machine-default behavior
2023-05-16 03:05:21 -04:00
Ashley Cui b9aaafbe17 Document podman-machine-default behavior
When no name arg is given to Podman machine commands, Podman assumes the machine name is podman-machine-default. Document this behavior.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-05-15 14:23:17 -04:00
Daniel Rudolf ae5cbf37cf
Fix documentation of `--network-cmd-path` CLI option
The `--network-cmd-path` CLI option only affects rootless networks using `slirp4netns(1)`, not `pasta(1)`.  Following #18568 Podman should rather use the more generic `r.config.FindHelperBinary()` method (and therefore honour the `helper_binaries_dir` config) to find the path to the `slirp4netns` binary and deprecate the misleading `--network-cmd-path` CLI option.  However, since this wasn't implemented yet we can't deprecate `--network-cmd-path` as of now.  Adding a note anyway.

Fixes #18560

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-05-15 17:47:40 +02:00
Daniel J Walsh 13f787842d
Fix handling of .containenv on tmpfs
Fixes: https://github.com/containers/podman/issues/18531

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-13 06:03:21 -04:00
Ygal Blum 26f1e95ab4 Kube Play - Support multi-doc YAML files for configmap argument
Read the entire YAML file in case of a multi-doc file
Adjust the unit test
Add a system test
Add comment in the man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-05-11 13:13:08 +03:00
OpenShift Merge Robot dc01ce8768
Merge pull request #18515 from vrothberg/fix-18486
quadlet: support `HostName`
2023-05-09 11:21:28 -04:00
Valentin Rothberg b97be3406b quadlet: support `HostName`
Add a new `HostName` field to Quadlet `.container` files.

Fixes: #18486
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-09 13:35:54 +02:00
Petr Lautrbach bdb3ed7950 Fix preference of user quadlets directories
If there's a container defined in multiple directories use the following
precedence:

$XDG_CONFIG_HOME/containers/systemd/ or ~/.config/containers/systemd/
takes precedence over /etc/containers/systemd/users/$(UID) and this
takes precedence over /etc/containers/systemd/users/

Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
2023-05-09 12:06:38 +02:00
Daniel J Walsh 27891a6640
Update docs/source/markdown/podman-systemd.unit.5.md
Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-05 05:48:33 -04:00
Daniel J Walsh 73d3487cce
Allow user quadlets to be stored under /etc
I would like to allow admin to control quadlet containers
in users homedirs.

If an admin sets a quadlet in
/etc/containers/systemd/users, then all users will run these
quadlet services when they login.

If an admin places a quadlet in /etc/containers/systemd/users/$(USERNAME)
then only the USERNAME will execute this quadlet service when
they login.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-04 10:06:41 -04:00
Hussam Qasem 42c8227209
Update podman-completion.1.md
Remove extra period.

Signed-off-by: Hussam Qasem <68053227+hussam-qasem@users.noreply.github.com>
2023-05-04 11:24:24 +03:00
OpenShift Merge Robot a4e37ad659
Merge pull request #18354 from Luap99/reset
system reset: show graphRoot/runRoot before removal
2023-05-03 05:26:01 -04:00
Urvashi Mohnani db4ad54f92 Add {{.Restarts}} to podman pod ps
Add Restarts column to the podman pod ps output to show the total number
of times the containers in a pod were restarted. This is the same as the
restarts column displayed by kubernetes with kubectl get pods. This will
only be displayed when --format={{.Restarts}}.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-05-02 10:30:07 -04:00
Urvashi Mohnani 0fef113a4b Add {{.Restarts}} to podman ps
Add Restarts column to the podman ps output to show how many times a
container was restarted based on its restart policy. This column will be
displayed when --format={{.Restarts}}.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-05-02 10:30:07 -04:00
Urvashi Mohnani edbeee5238 Add --restart flag to pod create
Add --restart flag to pod create to allow users to set the
restart policy for the pod, which applies to all the containers
in the pod. This reuses the restart policy already there for
containers and has the same restart policy options.
Add "never" to the restart policy options to match k8s syntax.
It is a synonym for "no" and does the exact same thing where the
containers are not restarted once exited.
Only the containers that have exited will be restarted based on the
restart policy, running containers will not be restarted when an exited
container is restarted in the same pod (same as is done in k8s).

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-05-02 10:29:58 -04:00
OpenShift Merge Robot 0b51f447b8
Merge pull request #18366 from AndroidKitKat/main
[CI:DOCS] Fix simple typo in podman-network-create.md
2023-04-27 07:34:24 -04:00
OpenShift Merge Robot af185b2f25
Merge pull request #18362 from rhatdan/quadlet
Support systemd optional prefix '-' for devices.
2023-04-27 02:59:18 -04:00
OpenShift Merge Robot 832b098471
Merge pull request #18303 from n1hility/user-mode
Add user-mode networking feature to Windows/WSL
2023-04-26 16:01:48 -04:00
Daniel J Walsh d51911f7b0
Support systemd optional prefix '-' for devices.
Systemd supports unit files with a prefix '-' which
tells the system to check if the content exists before
using it. This would allow the QM project to specify
AddDevice=-/dev/kvm, which would add the /dev/kvm device
to the container iff it exists on the host.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-26 14:22:57 -04:00
AndroidKitKat d905e412e8
Fix simple typo in podman-network-create.md
Found a typo today while reading documentation.

Simple enough change :-) 

Signed-off-by: Mike Eisemann <me@michaeleisemann.com>

Signed-off-by: AndroidKitKat <me@michaeleisemann.com>
2023-04-26 12:14:19 -04:00
Paul Holzinger 6aaf6a2843
system reset: show graphRoot/runRoot before removal
system reset it says it will delete containers, images, networks, etc...
However it will also delete the graphRoot and runRoot directories.
Normally this is not an issue, however in same cases these directories
were set to the users home directory or some other important system
directory.

As first step simply show the directories that are configured and thus
will be deleted by reset. As future step we could implement some
safeguard will will not delete some known important directories however
I tried to keep it simple for now.

[NO NEW TESTS NEEDED]

see #18349 and #18295

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-26 16:02:59 +02:00
Jason T. Greene 230ddbe0ca Add user mode networking feature to Windows
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-04-24 17:11:54 -05:00
Valentin Rothberg 1361c6a334 [CI:DOCS] Quadlet: clarify overriding user/system services
Highlight that existing user and system services may be overridden if
they have same name as the Quadlet file.  Also point the user to
systemctl and how to list existing files.

Closes: #18275
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-24 11:22:07 +02:00
Valentin Rothberg 1f1525f2e1 support `--digestfile` for remote push
Wire in support for writing the digest of the pushed image to a
user-specified file.  Requires some massaging of _internal_ APIs
and the extension of the push endpoint to integrate the raw manifest
(i.e., in bytes) in the stream.

Closes: #18216
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-21 10:28:40 +02:00
arctic-alpaca 1cac535062
Update API reference to include v4.5
Signed-off-by: arctic-alpaca <67190338+arctic-alpaca@users.noreply.github.com>
2023-04-17 14:52:36 +02:00
Ygal Blum 4aced7e3eb Quadlet - do not set log-driver by default
Update e2e tests not to expect the flag
System tests - explicitly set the log driver to be able to parse the output

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-04-13 09:14:40 +03:00
OpenShift Merge Robot 8a9386d898
Merge pull request #18145 from sohankunkerkar/registry-migration
*: migrate image registry to registry.k8s.io
2023-04-12 06:37:28 -04:00
Park Jaeon d38b22d507
fix: Document removing anonymous volumes at create
[NO NEW TESTS NEEDED]
Signed-off-by: Park Jaeon <me@finalchild.dev>
2023-04-12 09:44:50 +09:00
Ali Rizvi-Santiago bb2deef8e1 podman: added the --out option for capturing formatted output emitted by various commands
Commands like podman-create(1), podman-run(1), podman-inspect(1),
podman-ps(1) will emit formatted output upon success. This allows
the output from commands to be emitted directly to a file and
can supersede the --noout parameter by using /dev/null. An issue
with --noout was also remedied.

This closes issue #18120.

Signed-off-by: Ali Rizvi-Santiago <arizvisa@gmail.com>
2023-04-11 10:41:13 -05:00
Paul Holzinger b526839a4e
docs: update podman-network-create.1
- add information about netavark plugins
- add missing arguments to options the require an arg
- document that container dns is only supported with bridge

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:42 +02:00
Paul Holzinger ed99a979ce
network create: add --interface-name
Allow users to customize the network_interface option is the network
config. For bridge this allows users to change the bridge name and for
maclvan it will be the same as `--opt parent=...`.
However the main reason for this option is to allow netavark plugins to
make use of it. I demoed the host-device plugin which makes use of this
as an example. While we could let users set them via --opt it is more
natural to just use the field which is designed for that purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:33 +02:00
Sohan Kunkerkar 64ea5971a1 *: migrate image registry to registry.k8s.io
This change is a part of the bigger umbrella issue: https://github.com/kubernetes/k8s.io/issues/4780
Currently, we need this change to get in https://github.com/cri-o/cri-o/pull/6742,
which is failing in CI due to inconsistent vendoring.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2023-04-11 10:30:43 -04:00
Daniel J Walsh 1f2775cbdc
Merge pull request #18130 from flouthoc/bump-deps
vendor: bump `containers/(storage, buildah, image, common)`
2023-04-10 13:33:44 -04:00
Daniel J Walsh 0a89a22c71
Merge pull request #18105 from rhatdan/codespell
Fix up codespell errors
2023-04-10 13:33:04 -04:00
Aditya R 260bc3ec4c
vendor: bump containers/(storage, common, buildah, image)
Bump containers/(storage, common, buildah and image)

Changes since 2023-01-01:
 - skip mount-cache-selinux-long-name test under remote, with
   a FIXME requesting that someone see if it can be made to work.

 - skip six tests that fail under rootless-remote

 - add new --build-arg-file option:
 - update man page

Squash of:
* cf56eb1865
* 561f082772

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
2023-04-10 17:30:14 +05:30
Daniel J Walsh c4e79fc169
Fix up codespell errors
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-08 00:53:38 -04:00
Daniel J Walsh a5dd5c20ee
Capitalize all uid,gid and id words that are not options in docs
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-08 00:41:47 -04:00
OpenShift Merge Robot 430603950b
Merge pull request #18098 from xduugu/quadlet-userns
quadlet: add `UserNS` option key
2023-04-07 23:31:53 -04:00
Cedric Staniewski f6a50311c5 quadlet: add `UserNS` option key
The `UserNS` key will replace the `RemapGid`, `RemapUid`, `RemapUidSize`
and `RemapUsers` options which are therefore marked as deprecated by
this commit.

Closes #17984

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
2023-04-07 17:19:21 +02:00
Ed Santiago 761eca9e75 e2e tests: fix racy flakes
...mostly just test code that wasn't doing the required waits.

My first approach in the kube-play test was to add "--wait".
Bit mistake! The --wait flag, counterintuitively and counter to
documentation, actually destroys all pods+containers+everything
on exit. (Or tries -- see #17803). Since this violates POLA
and is undocumented, I include here a fix to the man page.

Despite my best intentions, I can't reasonably check every single
test for missing waits, especially in kube-play where failing
containers will get retried forever so we can't wait. We'll
just have to fix flakes as we see them.

Fixes: #17958
Fixes: #18071

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-05 13:51:59 -06:00
Valentin Rothberg 10d2e9fdec [CI:DOCS] --creds and registries
Mention that specified credentials are only used to authenticate against
target registries (e.g., during `pull` or `build`) and are not used to
authenticat against mirrors etc.

Closes: #17185
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-05 13:28:46 +02:00
Cedric Staniewski 443f8d89c9 quadlet: implement `Tmpfs` option
This commit adds an quadlet option `Tmpfs` which can be used to mount a
tmpfs in the container.

Closes #17907

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
2023-04-03 20:22:02 +02:00