Commit graph

236 commits

Author SHA1 Message Date
Paul Holzinger ae3816614d Install the new shell completion logic
Add a new make target (completion) to generate the shell
completion scripts. This will generate the scripts for bash,
zsh and fish for both podman and podman-remote with `podman completion`.
The scripts are put into the completions directory and can be
installed system wide with `sudo make install.completions`.

This commit replaces the current handwritten scripts for bash and zsh.

The `validate.completion` target has been adjusted to make sure nobody
edits these scripts directly.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 11:40:29 +01:00
Daniel J Walsh 980b1e87d4
Switch use of Flags to Options
Want to have man pages match commands, since we have lots of printed
man pages with using Options, we will change the command line to use
Options in --help.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 08:37:57 -04:00
Daniel J Walsh 571ae9db72
Fix sorting issues in completions
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-15 10:17:52 -04:00
Daniel J Walsh db23e12611
Add support for external container
External containers are containers created outside of Podman.
For example Buildah and CRI-O Containers.

$ buildah from alpine
alpine-working-container
$ buildah run alpine-working-container touch /test
$ podman container exists --external alpine-working-container

$ podman container diff alpine-working-container
C /etc
A /test

Added --external flag to refer to external containers, rather then --storage.

Added --external for podman container exists and modified podman ps to use
--external rather then --storage.  It was felt that --storage would confuse
the user into thinking about changing the storage driver or options.

--storage is still supported through the use of aliases.

Finally podman contianer diff, does not require the --external flag, since it
there is little change of users making the mistake, and would just be a pain
for the user to remember the flag.

podman container exists --external is required because it could fool scripts
that rely on the existance of a Podman container, and there is a potential
for a partial deletion of a container, which could mess up existing users.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-15 09:51:31 -04:00
Qi Wang 66798e993a Search repository tags using --list-tags
For fix of BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1684263
Add --list-tags to podman search to return a table the repository tags.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-09 11:49:46 -04:00
zhangguanzhang 1492f3c936 --rm option shold conflicts with --restart
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-02 21:57:37 +08:00
zhangguanzhang e18e4f4327 fix missing completion in podman run
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-09-17 21:40:03 +08:00
Daniel J Walsh 9c8bc47d8d
Fix completions for namespaces
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1873650

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-11 15:57:21 -04:00
OpenShift Merge Robot fc70360a3b
Merge pull request #7576 from openSUSE/manifest-add-extend-flags
Extend the flags of the `manifest add` command
2020-09-10 12:51:21 -04:00
Flavio Castelli 9c67a5f31c
Extend bash completion to cover new flags
Ensure the new flags added to `manifest add` are known to bash
completion.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:50:14 +02:00
Daniel J Walsh 581afbb86f
Show c/storage (Buildah/CRI-O) containers in ps
The `podman ps --all` command will now show containers that
are under the control of other c/storage container systems and
the new `ps --storage` option will show only containers that are
in c/storage but are not controlled by libpod.

In the below examples, the '*working-container' entries were created
by Buildah.

```
podman ps -a
CONTAINER ID  IMAGE                             COMMAND  CREATED       STATUS                   PORTS  NAMES
9257ef8c786c  docker.io/library/busybox:latest  ls /etc  8 hours ago   Exited (0) 8 hours ago          gifted_jang
d302c81856da  docker.io/library/busybox:latest  buildah  30 hours ago  storage                         busybox-working-container
7a5a7b099d33  localhost/tom:latest              ls -alF  30 hours ago  Exited (0) 30 hours ago         hopeful_hellman
01d601fca090  localhost/tom:latest              ls -alf  30 hours ago  Exited (1) 30 hours ago         determined_panini
ee58f429ff26  localhost/tom:latest              buildah  33 hours ago  storage                         alpine-working-container

podman ps --external
CONTAINER ID  IMAGE                             COMMAND  CREATED       STATUS    PORTS  NAMES
d302c81856da  docker.io/library/busybox:latest  buildah  30 hours ago  external         busybox-working-container
ee58f429ff26  localhost/tom:latest              buildah  33 hours ago  external         alpine-working-container

```
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 06:10:02 -04:00
Daniel J Walsh 3c6603a2f8
Add support for variant when pulling images
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-28 09:36:11 -04:00
Daniel J Walsh f49b98c610
Document override-arch and override-os
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-28 09:35:13 -04:00
OpenShift Merge Robot 8fdc116954
Merge pull request #7372 from giuseppe/add-unified-configuration
podman: add option --cgroup-conf
2020-08-24 09:55:14 -04:00
zhangguanzhang 7ea1864043 Add missing autocomplete
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-08-23 00:22:14 +08:00
Giuseppe Scrivano d856210ea8
podman: add option --cgroup-conf
it allows to manually tweak the configuration for cgroup v2.

we will expose some of the options in future as single
options (e.g. the new memory knobs), but for now add the more generic
--cgroup-conf mechanism for maximum control on the cgroup
configuration.

OCI specs change: https://github.com/opencontainers/runtime-spec/pull/1040

Requires: https://github.com/containers/crun/pull/459

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-21 19:06:05 +02:00
Daniel J Walsh eb9e8fc558 Add support for --connection
* override --url and/or --identity fields from containers.conf
* --connection flag has higher precedence than ActiveService from
containers.conf. Which is set via podman system connection default
* Add newline to error message printed on stderr
* Added --connection to bash completion and documentation
* Updated bindings to query server in case of no path or /

Closes #jira-991
Fixes #7276

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Squashed commits to work around CI issue
2020-08-19 08:37:44 -07:00
Daniel J Walsh 6979d140f1
Add podman image mount
There are many use cases where you want to just mount an image
without creating a container on it. For example you might want
to just examine the content in an image after you pull it for
security analysys.  Or you might want to just use the executables
on the image without running it in a container.

The image is mounted readonly since we do not want people changing
images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 10:27:44 -04:00
Ashley Cui d4d3fbc155 Add --umask flag for create, run
--umask sets the umask inside the container
Defaults to 0022

Co-authored-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-21 14:22:30 -04:00
Ashley Cui 9a1543caec Add --tz flag to create, run
--tz flag sets timezone inside container
Can be set to IANA timezone as well as `local` to match host machine

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-02 13:30:59 -04:00
Valentin Rothberg 1c6c12581c podman untag: error if tag doesn't exist
Throw an error if a specified tag does not exist.  Also make sure that
the user input is normalized as we already do for `podman tag`.

To prevent regressions, add a set of end-to-end and systemd tests.

Last but not least, update the docs and add bash completions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-24 15:34:46 +02:00
Daniel J Walsh 0560a98e0e
Add podman network to bash command completions
network commands were not supported in command completions.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-23 15:31:08 -04:00
Qi Wang f61a7f25a8 Add --preservefds to podman run
Add --preservefds to podman run. close https://github.com/containers/libpod/issues/6458

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-19 09:40:13 -04:00
Valentin Rothberg fe488b5f11 pod create --replace
Add a `--replace` flag to the `pod create` command.  If another pod with
the same name already exists, it will be replaced and removed.

Adding this flag is motivated by #5485 to make running Podman in systemd
units (or any other scripts/automation) more robust.  In case of a
crash, a pod may not be removed by a sytemd unit anymore.  The
`--replace` flag allows for supporting crashes.

Note that the `--replace` flag does not require the `--name` flag to be
set, so it can be set unconditionally in `podman generate systemd`.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-15 15:55:55 +02:00
Valentin Rothberg 402c68b41d pod create: add --infra-conmon-pidfile
Add an `--infra-conmon-pidfile` flag to `podman-pod-create` to write the
infra container's conmon process ID to a specified path.  Several
container sub-commands already support `--conmon-pidfile` which is
especially helpful to allow for systemd to access and track the conmon
processes.  This allows for easily tracking the conmon process of a
pod's infra container.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
Valentin Rothberg cf89bb6711 container-{create,run}: add --pod-id-file
Allow containers to join an existing pod via the `--pod-id-file` which
is already supported by a number of `podman-pod` subcommands.  Also add
tests to make sure it's working and to prevent future regressions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
Valentin Rothberg 7d71d24440 podman-pod{rm,start,stop}: support --pod-id-file
Support the `--pod-id-file` flag in the rm, start and stop pod commands.
This completes the already support flag in pod-create and is another
prerequisite for generating generic systemd unit files for pods.

Also add completions, docs and tests.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
Boaz Shuster 1f8a78747a Add --format to pod inspect
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2020-05-27 09:48:38 +03:00
Luap99 e704f1362a Added new flags to 'podman generate systemd' to change the unit name prefix
--container-prefix <string> - default 'container'
Systemd unit name prefix for containers

--pod-prefix <string> - default 'pod'
Systemd unit name prefix for pods

--separator <string> - default '-'
Systemd unit name seperator between name/id and prefix

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-05-22 18:38:39 +02:00
Kunal Kushwaha 087fdda199 Testcase added for network commands
New testcase for network ls --filter and inspect --format
added. Also bash completion options updated.

Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
2020-05-20 02:53:47 +00:00
Valentin Rothberg 1c3bd95b81 auto-update: support authfiles
Support using custom authfiles for auto updates by adding a new
`--authfile` flag and passing it down into the backend.

Also do some minor fixes in the help text and the man page.

Fixes: #6159
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-12 10:20:48 +02:00
Qi Wang 5621f5199d Manifest remove, push
Implements podman manifest remove and podman manifest push.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-06 10:54:28 -04:00
Qi Wang 1090d4d5d9 manifest annotate
Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-05 15:01:32 -04:00
Qi Wang 2f3734b143 Add --os to manifest add
Add --os to manifest add for overriding the os field.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-04-24 14:57:56 -04:00
Qi Wang 17783dda68 manifest create,add,inspect
Implememts manifest subcommands create, add, inspect.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-04-22 20:05:21 -04:00
OpenShift Merge Robot e318b09b68
Merge pull request #5620 from cfelder/play-kube-networking
Add support for specifying CNI networks in podman play kube
2020-04-06 18:45:25 +02:00
Daniel J Walsh 3449b27cd1
Switch to using --time as opposed to --timeout to better match Docker.
We need to consistently use --time rather then --timeout throughout the code.
Fix locations where timeout defaults are not set correctly as well.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-31 08:50:32 -04:00
Daniel J Walsh 4352d58549
Add support for containers.conf
vendor in c/common config pkg for containers.conf

Signed-off-by: Qi Wang qiwan@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-27 14:36:03 -04:00
Christian Felder 91dbdff77e Add support for specifying CNI networks in podman play kube
Fixes: #5609
Signed-off-by: Christian Felder <c.felder@fz-juelich.de>
2020-03-27 10:00:01 +01:00
Sujil02 5efa6dae90 Implemented --iidfile for podman commit
Added flag to Write the image ID to the file with podman commit command.
Fix to issue #5461

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-03-19 16:32:02 -04:00
Valentin Rothberg f4e873c4e1 auto updates
Add support to auto-update containers running in systemd units as
generated with `podman generate systemd --new`.

`podman auto-update` looks up containers with a specified
"io.containers.autoupdate" label (i.e., the auto-update policy).

If the label is present and set to "image", Podman reaches out to the
corresponding registry to check if the image has been updated.  We
consider an image to be updated if the digest in the local storage is
different than the one of the remote image.  If an image must be
updated, Podman pulls it down and restarts the container.  Note that the
restarting sequence relies on systemd.

At container-creation time, Podman looks up the "PODMAN_SYSTEMD_UNIT"
environment variables and stores it verbatim in the container's label.
This variable is now set by all systemd units generated by
`podman-generate-systemd` and is set to `%n` (i.e., the name of systemd
unit starting the container).  This data is then being used in the
auto-update sequence to instruct systemd (via DBUS) to restart the unit
and hence to restart the container.

Note that this implementation of auto-updates relies on systemd and
requires a fully-qualified image reference to be used to create the
container.  This enforcement is necessary to know which image to
actually check and pull.  If we used an image ID, we would not know
which image to check/pull anymore.

Fixes: #3575
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-17 17:18:56 +01:00
Boaz Shuster 11e5c53d11 Add the rmi flag to podman-run to delete container image
The --rmi flag will delete the container image after its execution
unless that image is already been used by another container(s).

This is useful when one wants to execute a container once and remove
any resources attached to it.

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2020-03-03 14:27:11 +02:00
Brent Baude 0184714a82 Add --no-healthcheck command to create/run
Now support --no-healthcheck option to disable defined healthchecks in a container image.  --health-cmd=none remains supported as well.

Fixes: #5299

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-22 12:45:15 -06:00
Matthew Heon 97323808ed Add network options to podman pod create
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes #2808
Fixes #3837
Fixes #4432
Fixes #4718
Fixes #4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-19 11:29:30 -05:00
李俊杰 27f861f785 Fixed a bug about bash automatically complete
When I input podman start in bash , and then type tab , cannot automatically complete container name , this pr will fix the bug .

Signed-off-by: 李俊杰 <phpor@users.noreply.github.com>
2020-02-14 00:10:37 +08:00
OpenShift Merge Robot a65f6b888a
Merge pull request #5152 from QiWang19/device-cgroup-rule
support device-cgroup-rule
2020-02-13 02:34:42 +01:00
Qi Wang d3260738d3 support device-cgroup-rule
fix #4876
Add `--device-cgroup-rule` to podman create and run. This enables to add device rules after the container has been created.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-02-12 14:30:23 -05:00
OpenShift Merge Robot e223675625
Merge pull request #5144 from marusak/doc_fixes
[CI:DOCS] podman system service doc fixes
2020-02-12 13:48:56 +01:00
Valentin Rothberg 9e1f6aeef8 podman build -f completions
Also cleanup the code a bit. There's no --runtime flag for build.

Fixes: #3878
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-11 13:42:23 +01:00
Matej Marusak d64e8b7dd5 bash-completions: Add missing subcommands in 'podman system'
Signed-off-by: Matej Marusak <mmarusak@redhat.com>
2020-02-10 16:31:50 +01:00