454 Commits

Author SHA1 Message Date
393a8f0261 disable dnsname when --internal
when doing a network creation, the dnsname plugin should be disabled
when the --internal bool is set.  a warning is displayed if this
happens and docs are updated.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-25 08:51:15 -06:00
1305f7c47a Merge pull request #9067 from Luap99/podman-manifest-exists
podman manifest exists
2021-01-23 11:05:09 +01:00
6e6a38b416 podman manifest exists
Add podman manifest exists command with remote support.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-22 20:19:13 +01:00
94f96c78a6 Add a notice to remove pod before starting service
Signed-off-by: xcffl <2216902+xcffl@users.noreply.github.com>
2021-01-22 18:28:19 +08:00
9d31fed5f7 podman volume exists
Add podman volume exists command with remote support.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-21 19:18:51 +01:00
5e7262ddf5 Merge pull request #9021 from Luap99/podman-network-exists
podman network exists
2021-01-19 16:56:17 -05:00
37abec240a [CI:DOCS] fix go-md2man HTMLSpan warnings
I'm tired of seeing these every time I run 'make':

   WARNING: go-md2man does not handle node type HTMLSpan

Cause: left-angle-brackets ( < ) in document source

Solution:
  1) backquote-escape those that need to be shown, usually
     ones referring to an argument or email address; or
  2) Actual HTML ( <sup> and <a> ) which are meant to be
     shown in generated HTML docs but can't be shown in
     man pages, we filter out via a sed expression.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-01-19 12:59:03 -07:00
a45d22a1dd podman network exists
Add podman network exists command with remote support.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-19 15:18:03 +01:00
341c4b1fd9 Merge pull request #8942 from rhatdan/push
Allow podman push to push manifest lists
2021-01-17 06:52:35 -05:00
cf51c7ed9f Allow podman push to push manifest lists
When doing a podman images, manifests lists look just like images, so
it is logical that users would assume that they can just podman push them
to a registry.  The problem is we throw out weird errors when this happens
and users need to somehow figure out this is a manifest list rather then
an image, and frankly the user will not understand the difference.

This PR will make podman push just do the right thing, by failing over and
attempting to push the manifest if it fails to push the image.

Fix up handling of manifest push

Protocol should bring back a digest string, which can either be
printed or stored in a file.

We should not reimplement the manifest push setup code in the tunnel
code but take advantage of the api path, to make sure remote and local
work the same way.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-15 13:24:34 -05:00
7d3a628c6b Merge pull request #8982 from Luap99/container-rename-bindings
Container rename bindings
2021-01-15 10:48:27 -05:00
0688f080b8 Fix missing podman-container-rename man page link
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-15 12:57:33 +01:00
c88022589a Bump to containers/buildah 1.9.2
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-15 06:23:19 -05:00
3fcf346890 Merge pull request #8955 from mheon/rename
Container Rename
2021-01-14 22:03:01 -05:00
997de2f8e9 Initial implementation of renaming containers
Basic theory: We remove the container, but *only from the DB*.
We leave it in c/storage, we leave the lock allocated, we leave
it running (if it is). Then we create an identical container with
an altered name, and add that back to the database. Theoretically
we now have a renamed container.

The advantage of this approach is that it doesn't just apply to
rename - we can use this to make *any* configuration change to a
container that does not alter its container ID.

Potential problems are numerous. This process is *THOROUGHLY*
non-atomic at present - if you `kill -9` Podman mid-rename things
will be in a bad place, for example. Also, we can't rename
containers that can't be removed normally - IE, containers with
dependencies (pod infra containers, for example).

The largest potential improvement will be to move the majority of
the work into the DB, with a `RecreateContainer()` method - that
will add atomicity, and let us remove the container without
worrying about depencies and similar issues.

Potential problems: long-running processes that edit the DB and
may have an older version of the configuration around. Most
notable example is `podman run --rm` - the removal command needed
to be manually edited to avoid this one. This begins to get at
the heart of me not wanting to do this in the first place...

This provides CLI and API implementations for frontend, but no
tunnel implementation. It will be added in a future release (just
held back for time now - we need this in 3.0 and are running low
on time).

This is honestly kind of horrifying, but I think it will work.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-01-14 18:29:28 -05:00
b53cb57680 Initial implementation of volume plugins
This implements support for mounting and unmounting volumes
backed by volume plugins. Support for actually retrieving
plugins requires a pull request to land in containers.conf and
then that to be vendored, and as such is not yet ready. Given
this, this code is only compile tested. However, the code for
everything past retrieving the plugin has been written - there is
support for creating, removing, mounting, and unmounting volumes,
which should allow full functionality once the c/common PR is
merged.

A major change is the signature of the MountPoint function for
volumes, which now, by necessity, returns an error. Named volumes
managed by a plugin do not have a mountpoint we control; instead,
it is managed entirely by the plugin. As such, we need to cache
the path in the DB, and calls to retrieve it now need to access
the DB (and may fail as such).

Notably absent is support for SELinux relabelling and chowning
these volumes. Given that we don't manage the mountpoint for
these volumes, I am extremely reluctant to try and modify it - we
could easily break the plugin trying to chown or relabel it.

Also, we had no less than *5* separate implementations of
inspecting a volume floating around in pkg/infra/abi and
pkg/api/handlers/libpod. And none of them used volume.Inspect(),
the only correct way of inspecting volumes. Remove them all and
consolidate to using the correct way. Compat API is likely still
doing things the wrong way, but that is an issue for another day.

Fixes #4304

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-01-14 15:35:33 -05:00
a7c0c9125f Add more information and examples on podman and pipes
Improve the documentation to help users to know proper way to
use podman within a pipe.

Helps Prevent: https://github.com/containers/podman/issues/8916

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-13 15:08:46 -05:00
183f443a58 Merge pull request #8957 from srcshelton/feature/issue-8945
Add 'MemUsageBytes' format option
2021-01-13 06:28:00 -05:00
a6af56f5b4 Add 'MemUsageBytes' format option
Although storage is more human-readable when expressed in SI units,
IEC/JEDEC (Bytes) units are more pertinent for memory-related values
(and match the format of the --memory* command-line options).

(To prevent possible compatibility issues, the default SI display is
left unchanged)

See https://github.com/containers/podman/issues/8945

Signed-off-by: Stuart Shelton <stuart@shelton.me>
2021-01-12 23:38:08 +00:00
a6046dceef Remove the ability to use [name:tag] in podman load command
Docker does not support this, and it is confusing what to do if
the image has more then one tag.  We are dropping support for this
in podman 3.0

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-12 17:38:32 -05:00
5575c7be20 Merge pull request #8819 from chen-zhuohan/add-pre-checkpoint
Add pre-checkpoint and restore with previous
2021-01-12 07:57:05 -05:00
2aa381f2d0 add pre checkpoint
Signed-off-by: Zhuohan Chen <chen_zhuohan@163.com>
2021-01-10 21:38:28 +08:00
3d453f9d2e podman build --force-rm defaults to true in code
The man page and code should match for what is the default settings.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-10 05:52:33 -05:00
38baf3d5e2 Add Networks format placeholder to podman ps and pod ps
`podman ps --format {{.Networks}}` will show all connected networks for
this container. For `pod ps` it will show the infra container networks.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-09 19:15:43 +01:00
1242e7b7a6 Add network filter for podman ps and pod ps
Allow to filter on the network name or full id.
For pod ps it will filter on the infra container networks.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-09 17:03:32 +01:00
49db79e735 Merge pull request #8781 from rst0git/cr-volumes
Add support for checkpoint/restore of containers with volumes
2021-01-08 10:41:05 -05:00
d9ebbbfe5b Switch references of /var/run -> /run
Systemd is now complaining or mentioning /var/run as a legacy directory.
It has been many years where /var/run is a symlink to /run on all
most distributions, make the change to the default.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-07 05:37:24 -05:00
288ccc4c84 Include named volumes in container migration
When migrating a container with associated volumes, the content of
these volumes should be made available on the destination machine.

This patch enables container checkpoint/restore with named volumes
by including the content of volumes in checkpoint file. On restore,
volumes associated with container are created and their content is
restored.

The --ignore-volumes option is introduced to disable this feature.

Example:

 # podman container checkpoint --export checkpoint.tar.gz <container>

The content of all volumes associated with the container are included
in `checkpoint.tar.gz`

 # podman container checkpoint --export checkpoint.tar.gz --ignore-volumes <container>

The content of volumes is not included in `checkpoint.tar.gz`. This is
useful, for example, when the checkpoint/restore is performed on the
same machine.

 # podman container restore --import checkpoint.tar.gz

The associated volumes will be created and their content will be
restored. Podman will exit with an error if volumes with the same
name already exist on the system or the content of volumes is not
included in checkpoint.tar.gz

 # podman container restore --ignore-volumes --import checkpoint.tar.gz

Volumes associated with container must already exist. Podman will not
create them or restore their content.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2021-01-07 07:51:19 +00:00
c81e29525b add --cidfile to container kill
Add the ability to read container ids from one or more files for the
kill command.

Fixes: #8443

Signed-off-by: baude <bbaude@redhat.com>
2020-12-23 12:01:46 -06:00
54b82a175f Merge pull request #8787 from jsoref/spelling
Spelling
2020-12-23 17:38:43 +01:00
3cc0801516 Document uid/gidmap are based on subuid/gid mapping
* Closes #6123

Signed-off-by: Tobias Boesch <tobias.boesch@googlemail.com>
2020-12-23 11:47:59 +01:00
b41fa90a4c Merge pull request #8774 from cevich/events_file_docs
[CI:DOCS] Document location of backend events file
2020-12-23 04:43:16 -05:00
767e1ac17f Merge pull request #8804 from baude/issue8512
add pod filter for ps
2020-12-23 04:42:30 -05:00
4fa1fce930 Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-12-22 13:34:31 -05:00
c50c75419b add pod filter for ps
adds the ability to filter containers based on the filter "pod".  the
value can be a pod name or its full or partial id.

Fixes: #8512

Signed-off-by: baude <bbaude@redhat.com>
2020-12-22 09:40:39 -06:00
04b43ccf64 Add Security information to podman info
When debugging issues, it would be helpful to know the
security settings of the system running into the problem.
Adding security info to `podman info` is also useful to users.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-22 08:13:14 -05:00
ea6c1c5bd0 Document location of backend events file
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-12-18 16:18:27 -05:00
adcb3a7a60 remote copy
Implement `podman-remote cp` and break out the logic from the previously
added `pkg/copy` into it's basic building blocks and move them up into
the `ContainerEngine` interface and `cmd/podman`.

The `--pause` and `--extract` flags are now deprecated and turned into
nops.

Note that this commit is vendoring a non-release version of Buildah to
pull in updates to the copier package.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-12-18 12:08:49 +01:00
e5741b984e Merge pull request #8689 from bblenard/issue-8672-volume-prune
Add volume prune --filter support
2020-12-14 09:22:30 -05:00
a0204ada09 Add volume prune --filter support
This change adds support for the `--filter` / `?filters` arguments on
the `podman volume prune` subcommand.

  * Adds ParseFilterArgumentsIntoFilters helper for consistent
    Filter string slice handling
  * Adds `--filter` support to podman volume prune cli
  * Adds `?filters...` support to podman volume prune api
  * Updates apiv2 / e2e tests

Closes #8672

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
2020-12-12 20:07:04 -06:00
36bec385f3 Merge pull request #7718 from QiWang19/sign-multi-arch
Sign multi-arch images
2020-12-12 03:46:31 -05:00
6730556e2f Sign multi-arch images
podman image sign handles muti-arch images.
--all option to create signature for each manifest from the image manifest list.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-12-11 14:15:56 -05:00
098e0a7885 Handle --rm when starting a container
podman start should follow the same behaviour as podman run when removing a
container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-11 06:07:14 -05:00
6823a5d6cc Merge pull request #8664 from rhatdan/prune
Add --filter to podman system prune
2020-12-10 13:32:41 -05:00
eaa19a1c10 Merge pull request #8641 from umohnani8/play
Do not pull if image domain is localhost
2020-12-10 05:20:48 -05:00
15cdcdca76 Add --filter to podman system prune
Also document the allowable filters in podman system prune, podman image prune
and podman container prune.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 16:01:13 -05:00
059c2ee739 Merge pull request #8669 from giuseppe/unmask-also-cover-ro-paths
security: honor systempaths=unconfined for ro paths
2020-12-09 15:04:41 -05:00
176be90e0a security: honor systempaths=unconfined for ro paths
we must honor systempaths=unconfined also for read-only paths, as
Docker does:

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-09 19:26:23 +01:00
49d11b53e1 Merge pull request #8661 from rhatdan/codespell
Fix spelling mistakes
2020-12-09 09:52:20 -05:00
b875c5c27c Merge pull request #8599 from rhatdan/prune
Repeat system pruning until there is nothing removed
2020-12-09 08:46:44 -05:00