Commit graph

1095 commits

Author SHA1 Message Date
OpenShift Merge Robot 738d62ea96
Merge pull request #7964 from vrothberg/shortnames
short-name aliasing
2020-11-13 18:28:17 +01:00
OpenShift Merge Robot 2993e97dec
Merge pull request #6442 from Luap99/podman-autocomplete
Shell completion
2020-11-13 16:46:51 +01:00
OpenShift Merge Robot 6d9d9fee30
Merge pull request #8326 from Luap99/fix-build-namespace
Fix namespace flag parsing for podman build
2020-11-13 16:44:45 +01:00
Valentin Rothberg 8e4a42aa42 short-name aliasing
Add support for short-name aliasing.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-11-13 15:40:06 +01:00
OpenShift Merge Robot 0b1a60ec27
Merge pull request #8308 from jwhonce/jira/run-976
Refactor to use DockerClient vs APIClient
2020-11-13 15:00:01 +01:00
OpenShift Merge Robot 42a5b0fd93
Merge pull request #8301 from TomSweeneyRedHat/dev/tsweeney/fixpully
Change podman build --pull=true to PullIfMissing
2020-11-13 10:42:13 +01:00
OpenShift Merge Robot b2d281afcc
Merge pull request #8328 from FreedomBen/add-socket-start
[CI:DOCS] Add missing --now in systemctl start command
2020-11-13 09:50:58 +01:00
Benjamin Porter ba8a71f9ce Add missing --now in systemctl start command
If you don't use --now or also run systemctl --user start podman.socket
then the socket won't start until a reboot.  Much easier to just start
the socket at the same time as enabling it.

Signed-off-by: Benjamin Porter <FreedomBen@users.noreply.github.com>
2020-11-12 19:18:59 -07:00
TomSweeneyRedHat 6ea13fd872 Change podman build --pull=true to PullIfMissing
One last tweak to the man page for 'build --pull' and after
further testing against Docker, one slight change to the
pull policy.  First I changed `--pull=false` from PullNever
to PullIfMissing.  This matches Docker and will pull the
image if it's not present rather than erroring.  We've
the `--pull-never` option if someone wants the pull to
not do an actual pull and to error if the image isn't
local.

Then for the man page, I'd a much bigger change, in the
initial PR, I've backed most of that out and just
added a tweak.

Hopefully this puts this portion of the pull work behind
us for a while.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-11-12 18:50:31 -05:00
OpenShift Merge Robot 2fc2d4643e
Merge pull request #8316 from rhatdan/codespell
Fix issues found with codespell
2020-11-12 23:29:51 +01:00
Paul Holzinger 79f5aed316 Add podman build --net alias for --network
Fixes #8332

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 23:17:42 +01:00
Jhon Honce a1187ee6f3 Refactor to use DockerClient vs APIClient
* Update tests and framework
* remove tests for APIClient methods

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-11-12 15:13:09 -07:00
Paul Holzinger f5a2e578eb Maintain consistent order of short and long flag names in docs
Make the order of short and long flag names in the documentation
consistent. Also adjust the man page validaten script to only allow
the `**--long**, **-s**` syntax.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 21:46:17 +01:00
Daniel J Walsh a7431003b8
Fix issues found with codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-12 13:37:38 -05:00
OpenShift Merge Robot 53c60a68db
Merge pull request #8300 from TomSweeneyRedHat/dev/tsweeney/addmain
Add podman(1) to the list of man pages on docs.podman.io
2020-11-12 11:54:16 +01:00
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
Paul Holzinger b5d1d89a37 Add shell completion with cobra
Allow automatic generation for shell completion scripts
with the internal cobra functions (requires v1.0.0+).

This should replace the handwritten completion scripts
and even adds support for fish. With this approach it is
less likley that completions and code are out of sync.

We can now create the scripts with
- podman completion bash
- podman completion zsh
- podman completion fish

To test the completion run:
source <(podman completion bash)

The same works for podman-remote and podman --remote and
it will complete your remote containers/images with
the correct endpoints values from --url/--connection.

The completion logic is written in go and provided by the
cobra library. The completion functions lives in
`cmd/podman/completion/completion.go`.

The unit test at cmd/podman/shell_completion_test.go checks
if each command and flag has an autocompletion function set.
This prevents that commands and flags have no shell completion set.

This commit does not replace the current autocompletion scripts.

Closes #6440

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 11:38:31 +01:00
Ed Santiago b0601cb34a [CI:DOCS] Restore man page cross-checker
Somewhere in the CIv2 migration we lost the man page vs --help
cross-checker. Add it back, by adding it into the man-page-check
Makefile target; this is part of 'make validate', which is run
in CI even on CI:DOCS PRs.

As happens when CI doesn't run, things broke. Man pages got out
of sync with --help. This PR:

 1) Fixes hack/xref-helpmsgs-manpages to deal with the new
    "Options" (instead of "Flags") form of podman help. #8034
    did part of that, but one of my review comments was
    accidentally left out.

 2) Fixes hack/xref-helpmsgs-manpages to deal with the new
    option syntax in man pages, post- #8292, in which each
    option is preceded by four hashes so as to make them
    HTML <h4> elements with named anchors.

 3) Fixes man pages that #8292 accidentally missed.

 4) Adds man page entries for two flags that got added
    to podman but not documented (pod create --network-alias,
    play kube --log-driver)

Fixes: #8296

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-11-11 08:31:30 -07:00
TomSweeneyRedHat 4c422cbc34 Add podman(1) to the list of man pages on docs.podman.io
As the title says.

Addresses: #7219

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-11-10 19:36:18 -05:00
OpenShift Merge Robot ca672373b5
Merge pull request #8292 from Luap99/doc-anchors
[CI:DOCS] Add anchors for flag names on docs.podman.io
2020-11-10 19:12:58 +01:00
OpenShift Merge Robot ce2ac7d2d2
Merge pull request #8251 from baude/networkaliases
network aliases for container creation
2020-11-10 19:10:59 +01:00
Paul Holzinger 52a8694705 Add anchors for flag names on docs.podman.io
Change the docs markdown so that flag names will be h4 headers.
Sphinx will automatically add anchors to headers. Add css to
make sure the flag names are not to big compared to the text.

The man pages also still renders fine but it looks a bit different.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-10 15:27:08 +01:00
OpenShift Merge Robot da01191aa3
Merge pull request #8278 from rhatdan/man1
[CI:DOCS] Add example of fuse-overlay to podman system reset
2020-11-10 14:25:44 +00:00
Daniel J Walsh 0ba2261528
Add example of fuse-overlay to podman system reset
A fairly common mistake users are hitting is running rootless podman without
installing fuse-overlay.  Then they want to reset storage.  Sometimes they
modify storage.conf first and `podman system reset` fails.

This PR attempts to explain how to convert properly.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-10 07:24:13 -05:00
Antonio Ojea e7a72d72fd enable ipv6 network configuration options
enable the ipv6 flag in podman network to be able to create
dual-stack networks for containers.

This is required to be compatible with docker, where --ipv6
really means dual stack.

podman, unlike docker, support IPv6 only containers since
07e3f1bba9.

Signed-off-by: Antonio Ojea <aojea@redhat.com>
2020-11-10 08:34:52 +01:00
baude b7b5b6f8e3 network aliases for container creation
podman can now support adding network aliases when running containers
(--network-alias).  It requires an updated dnsname plugin as well as an
updated ocicni to work properly.

Signed-off-by: baude <bbaude@redhat.com>
2020-11-09 15:08:58 -06:00
Daniel J Walsh c12065401f
Update podman build man page to match buildah bud man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-09 15:10:20 -05:00
Kier Davis 71fe822434 podman-pull.1.md: add example for pulling an image by hash
Signed-off-by: Kier Davis <me@kierdavis.com>
2020-11-09 13:18:38 -06:00
Kier Davis c20a70f8c3 podman-import.1.md: fix paragraph formatting
Signed-off-by: Kier Davis <me@kierdavis.com>
2020-11-09 13:18:38 -06:00
Kier Davis f29cda6d92 podman-import.1.md: fix shell syntax
Signed-off-by: Kier Davis <me@kierdavis.com>
2020-11-09 13:18:38 -06:00
OpenShift Merge Robot 4d013caffc
Merge pull request #8249 from marcnuri-forks/fix/doc-typo
[CI:DOCS] fix: podman-system-service doc time is seconds
2020-11-05 16:03:52 +01:00
Marc Nuri 59a3078853 fix: podman-system-service doc time is seconds
Signed-off-by: Marc Nuri <marc@marcnuri.com>
2020-11-05 14:44:25 +01:00
Daniel J Walsh 6ca705bf1a
Add support for mounting external containers
Continue progress on use of external containers.

This PR adds the ability to mount, umount and list the
storage containers whether they are in libpod or not.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-04 13:52:08 -05:00
OpenShift Merge Robot 5b17f58e7e
Merge pull request #8219 from rhafer/rootless-mounts
docs: Mention mounts.conf location for non-root users
2020-11-03 14:34:08 -05:00
JJ Asghar 1147bc7e7b Update README.md
Typo

Signed-off-by: JJ Asghar <jjasghar@gmail.com>
2020-11-02 16:22:52 -06:00
OpenShift Merge Robot 8dfbdb561b
Merge pull request #8166 from rhatdan/unbindable
Allow users to mount with unbindable flag
2020-11-02 18:19:39 +01:00
Ralf Haferkamp 448aafc2fd docs: Mention mounts.conf location for non-root users
Signed-off-by: Ralf Haferkamp <rhafer@suse.com>
2020-11-02 16:55:10 +01:00
Daniel J Walsh 3ee44d942e
Add better support for unbindable volume mounts
Allow users to specify unbindable on volume command line

Switch internal mounts to rprivate to help prevent leaks.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-02 07:19:12 -05:00
TomSweeneyRedHat 7841aea292 Match build pull functionality with Docker's
This is a continuation of #8189 and #8085.

When doing a `docker build` command, if the `--pull` command is not specified
or set to `false` the pullOption used is `PullifMissing`.  This causes the
build to pull the image only if it is not present in local storage.  It also will
raise an error if the image is not found in the registry (or the registry is down),
even if the image is present in local storage.

If the `--pull` command IS specified or specified with an argument of `true`, the
build will always pull the image from the registries.  This uses the pullOption
`PullAlways`.  It also will raise an error if the image is not found in the registry,
even if the image is present in local storage.

These changes now brings the pull functionality for `podman build` into line
with `docker build`.

However, I consider this to be a breaking change.  Previously if you did
`podman build --pull`, `podman build` or `podman build --pull = true`, then
the image would be pulled from the registry if there was not an image in
local storage or if the image in the registry was newer than the one in
local storage.  An error would *NOT* be raised if there was not an image in
the registry or the registry was down as long as there was a copy in the local
storage.  An error would be raised if the image could not be retrieved from
both the registry and local storage.  This is the PullOption `PullIfNewer`.

I believe this also differs from what Buildah does at this time but I'm too
beat to chase that down at the moment.

Personally I'd like to use the `PullIfNewer` for at least `--pull` and
`--pull=true` so that you don't get an error if the registry has a network
hiccup and the image is already stored locally.  But this differs from Docker.

I'd like to post scrum about this at our next stand up to make sure we're
all on the same page about the ramifications of this change.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-10-31 20:11:00 -04:00
OpenShift Merge Robot e5227b9d75
Merge pull request #8201 from QiWang19/search-limit
Remove search limit since pagination support
2020-10-30 20:34:28 +01:00
Qi Wang cab33cfbf6 Remove search limit since pagination support
Remove the search limit check since the c/image v5.6.0 supports pagination and can give result over 100 entries.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-30 11:00:40 -04:00
Chris Evich 611c0cb0e0
[CI:DOCS] Fix broken CI readme links
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-30 10:32:17 -04:00
Valentin Rothberg 65a618886e new "image" mount type
Add a new "image" mount type to `--mount`.  The source of the mount is
the name or ID of an image.  The destination is the path inside the
container.  Image mounts further support an optional `rw,readwrite`
parameter which if set to "true" will yield the mount writable inside
the container.  Note that no changes are propagated to the image mount
on the host (which in any case is read only).

Mounts are overlay mounts.  To support read-only overlay mounts, vendor
a non-release version of Buildah.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-10-29 15:06:22 +01:00
OpenShift Merge Robot 7149a7cb39
Merge pull request #8102 from ashley-cui/inspect
Add pod, volume, network to inspect package
2020-10-27 17:04:44 -04:00
Ashley Cui 61deec451f Add pod, volume, network to inspect package
podman inspect only had the capabilities to inspect containers and images. if a user wanted to inspect a pod, volume, or network, they would have to use `podman network inspect`, `podman pod inspect` etc. Docker's cli allowed users to inspect both volumes and networks using regular inspect, so this commit gives the user the functionality

If the inspect type is not specified using --type, the order of inspection is:

containers
images
volumes
networks
pods

meaning if container that has the same name as an image, podman inspect would return the container inspect.

To avoid duplicate code, podman network inspect and podman volume inspect now use the inspect package as well. Podman pod inspect does not because podman pod inspect returns a single json object while podman inspect can return multiple)

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-10-27 14:42:54 -04:00
OpenShift Merge Robot 95f3ec7b08
Merge pull request #8133 from xordspar0/cpu-limit-details
[CI:DOCS] Add more details about how CPU limits work
2020-10-27 13:26:53 -04:00
Jordan Christiansen f393d32e96 Document how to enable CPU limit delegation
Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-10-27 10:05:43 -05:00
Jordan Christiansen fa73b929e0 Add more details about how CPU limits work
Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-10-27 09:32:41 -05:00
baude c593e49701 filter events by labels
adding the ability to filter evens by the container labels.  this requires that container labels be added to the events data being recorded and subsequently read.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-23 12:07:34 -05:00
Daniel J Walsh 15345ce4c3
podman create doesn't support creating detached containers
Detached containers and detach keys are only created with the podman run, i
exec, and start commands.  We do not store the detach key sequence or the
detach flags in the database, nor does Docker. The current code was ignoreing
these fields but documenting that they can be used.

Fix podman create man page and --help output to no longer indicate that
--detach and --detach-keys works.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 21:00:50 -04:00