236 Commits

Author SHA1 Message Date
6fe9bd0f7a docs: user namespace can't be shared in pods
When running "podman pod create --share user" the errors appears:
Error: User sharing functionality not supported on pod level
Fix docs and remove 'user' from shareable parameters.

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2020-07-14 20:05:40 +03:00
b020d1ad13 Vendor in new version of Buildah
This also pulls in latest runc and containers/common

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-09 11:02:28 -04:00
0b1c1ef461 Implement --sdnotify cmdline option to control sd-notify behavior
--sdnotify container|conmon|ignore
With "conmon", we send the MAINPID, and clear the NOTIFY_SOCKET so the OCI
runtime doesn't pass it into the container. We also advertise "ready" when the
OCI runtime finishes to advertise the service as ready.

With "container", we send the MAINPID, and leave the NOTIFY_SOCKET so the OCI
runtime passes it into the container for initialization, and let the container advertise further metadata.
This is the default, which is closest to the behavior podman has done in the past.

The "ignore" option removes NOTIFY_SOCKET from the environment, so neither podman nor
any child processes will talk to systemd.

This removes the need for hardcoded CID and PID files in the command line, and
the PIDFile directive, as the pid is advertised directly through sd-notify.

Signed-off-by: Joseph Gooch <mrwizard@dok.org>
2020-07-06 17:47:18 +00:00
9532509c50 Merge pull request #6836 from ashley-cui/tzlibpod
Add --tz flag to create, run
2020-07-06 13:28:20 -04:00
4bdc11951e Merge pull request #6790 from QiWang19/set_engine_env
Set engine env from common config
2020-07-06 09:36:08 -04:00
0ef5def0be auto-update: clarify systemd-unit requirements
Clarify in the help message and the man page that auto updates only work
with systemd units that are similar to the ones from `generate systemd
--new`.  Units that merely start/stop a container do not work as they
will use the same image.

Fixes: #6793
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-06 11:14:33 +02:00
4192298be3 Set engine env from common config
Set the env that is used by Podman.
related issue containers/common#31

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-07-03 15:29:38 -04:00
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
6fbd1570f8 Merge pull request #6773 from markstos/issue-6756-improve-inspect-docs
docs: recommend alternatives to podman inspect
2020-06-30 12:35:32 -04:00
8d69f5178b docs: recommend alternatives to podman inspect
podman inspect is problematic because there can be naming clashes. Also,
it only inspects a couple of types of objects and the docs for it didn't
help discover that several more types could be inspected as well.

To address both concerns, we deprecate `podman inspect` and update the
docs to point to to the recommend alternatives.

Issue: #6756
Signed-off-by: Mark Stosberg <mark@rideamigos.com>
2020-06-30 10:50:33 -04:00
a9912b52d0 Add a note on the APIs supported by system service
This makes it clear that we target compatibility with a specific
Docker version (v1.40), but do not reject other versions. It also
adds a link to documentation on the Podman-specific API.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-06-29 14:26:07 -04:00
e0b93af70f Merge pull request #6808 from mheon/allow_empty_hostport
Allow empty host port in --publish flag
2020-06-29 13:52:47 -04:00
6ac009d530 Merge pull request #6666 from giuseppe/conmon-delegate
podman: add new cgroup mode split
2020-06-29 10:53:41 -04:00
3601b96600 Allow empty host port in --publish flag
I didn't believe that this was actually legal, but it looks like
it is. And, unlike our previous understanding (host port being
empty means just use container port), empty host port actually
carries the same meaning as `--expose` + `--publish-all` (that
is, assign a random host port to the given container port). This
requires a significant rework of our port handling code to handle
this new case. I don't foresee this being commonly used, so I
optimized having a fixed port number as fast path, which this
random assignment code running after the main port handling code
only if necessary.

Fixes #6806

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-29 09:33:43 -04:00
6ee5f740a4 podman: add new cgroup mode split
When running under systemd there is no need to create yet another
cgroup for the container.

With conmon-delegated the current cgroup will be split in two sub
cgroups:

- supervisor
- container

The supervisor cgroup will hold conmon and the podman process, while
the container cgroup is used by the OCI runtime (using the cgroupfs
backend).

Closes: https://github.com/containers/libpod/issues/6400

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-25 17:16:12 +02:00
c6090c290e Docs: consistency between man / --help
New functionality in hack/man-page-checker: start cross-
referencing the man page 'Synopsis' line against the
output of 'podman foo --help'. This is part 1, flag/option
consistency. Part 2 (arg consistency) is too big and will
have to wait for later.

flag/option consistency means: if 'podman foo --help'
includes the string '[flags]' in the Usage message,
make sure the man page includes '[*options*]' in its
Synopsis line, and vice-versa. This found several
inconsistencies, which I've fixed.

While doing this I realized that Cobra automatically
includes a 'Flags:' subsection in its --help output
for all subcommands that have defined flags. This
is great - it lets us cross-check against the
usage synopsis, and make sure that '[flags]' is
present or absent as needed, without fear of
human screwups. If a flag-less subcommand ever
gets extended with flags, but the developer forgets
to add '[flags]' and remove DisableFlagsInUseLine,
we now have a test that will catch that. (This,
too, caught two instances which I fixed).

I don't actually know if the new man-page-checker
functionality will work in CI: I vaguely recall that
it might run before 'make podman' does; and also
vaguely recall that some steps were taken to remedy
that.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-06-24 10:39:10 -06:00
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
4e85acf052 Fix typo in manpage for podman auto update.
Signed-off-by: Peter Oliver <git@mavit.org.uk>
2020-06-23 20:15:37 +01:00
7377e578a9 V2 podman system connection
* Implement command
* Refactor podman-remote to pull from containers.conf by default
* podman-remote defaults to --remote being true
* Write podman-system-connection.1.md

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-23 08:18:53 -07:00
9e37fd43e4 Merge pull request #6625 from QiWang19/fd
Add --preservefds to podman run
2020-06-23 10:00:21 +02:00
d2d4523be0 "pod" was being truncated to "po" in the names of the generated systemd unit files.
s/po/pod

Signed-off-by: Gavin Campbell <gavin@gavincampbell.dev>
2020-06-21 18:19:19 +01:00
f18d2751f6 correct the absolute path of rm executable
Signed-off-by: Yuan-Hao Chen <yhchen0906@gmail.com>
2020-06-19 22:23:35 +08:00
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
4dc934080b Fix remote docs
Fix renaming bug in remote-docs.sh
Remove mentions of 'remote' in windows and mac dos
Remove podman-remote.conf.5

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-06-18 12:13:46 -04:00
7b00e49f65 Merge pull request #6560 from mheon/fix_exec_logdriver
Do not share container log driver for exec
2020-06-17 17:17:27 -04:00
6f1440a3ec Add support for the unless-stopped restart policy
We initially believed that implementing this required support for
restarting containers after reboot, but this is not the case.
The unless-stopped restart policy acts identically to the always
restart policy except in cases related to reboot (which we do not
support yet), but it does not require that support for us to
implement it.

Changes themselves are quite simple, we need a new restart policy
constant, we need to remove existing checks that block creation
of containers when unless-stopped was used, and we need to update
the manpages.

Fixes #6508

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-17 11:16:12 -04:00
0e171b7b33 Do not share container log driver for exec
When the container uses journald logging, we don't want to
automatically use the same driver for its exec sessions. If we do
we will pollute the journal (particularly in the case of
healthchecks) with large amounts of undesired logs. Instead,
force exec sessions logs to file for now; we can add a log-driver
flag later (we'll probably want to add a `podman logs` command
that reads exec session logs at the same time).

As part of this, add support for the new 'none' logs driver in
Conmon. It will be the default log driver for exec sessions, and
can be optionally selected for containers.

Great thanks to Joe Gooch (mrwizard@dok.org) for adding support
to Conmon for a null log driver, and wiring it in here.

Fixes #6555

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-17 11:11:46 -04:00
2e22e18afb Add deprecated message to varlink command
* Remove varlink references from the man pages
* Fix signature for extractTarFile()

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-15 11:41:57 -07:00
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
fa3b8a75c4 {create,run} --replace
Add a `--replace` flag to the `container {create,run}` commands.
If another container 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 container may not be removed by a sytemd unit anymore.  The
`--replace` flag allows for supporting crashes.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-15 15:53:51 +02:00
1408dbfa4d Merge pull request #6551 from QiWang19/doc-check-auth
update document login see config.json as valid
2020-06-11 14:39:50 -04:00
b1f8aac056 update document login see config.json as valid
Update the document, pointing out podman credentials from $HOME/.docker/config.json can be used by Podman.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-11 13:24:21 -04:00
139f82933d docs: create/run fix --pod-id-file description
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
8d8746adee generate systemd: create pod template
Create a new template for generating a pod unit file. Eventually, this
allows for treating and extending pod and container generation
seprately.

The `--new` flag now also works on pods.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
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
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
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
99cbe59917 podman-events: clarify streaming behaviour
Unless `--since` or `--until` is specified, `podman events` will stream
new events.  Clarify this behavior in the `--help` message and man page
to avoid confusion.

Fixes: #6536
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-10 11:09:12 +02:00
d023909c0b add socket information to podman info
this is step 1 to self-discovery of remote ssh connections.  we add a remotesocket struct to info to detect what the socket path might be.

Co-authored-by: Jhon Honce <jhonce@redhat.com>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-03 15:20:37 -05:00
cbca625328 V2 Add support for ssh authentication methods
* podman --remote ssh://<user>:<password>@<host>:<port><path>
* podman --remote ssh://<user>:<password>@<host>:<port><path> \
  --identity <path> --passphrase <phrase>
* ssh-add <key>
  podman --remote ssh://<user>@<host><path>
* Fix `podman help` to run even if podman missing components
* Prompt for passphrase on stdin IFF key is protected and passphrase
  not given via any other configuration

* cobra flags do not support optional value flags therefore refactored
  --remote to be a boolean and --url will now contain the URI to Podman
  service

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-03 09:54:39 -07:00
eb9788db23 Update man pages for --ip with CNI networks
Originally, we did not allow this, and the manpage reflects that.
We added support with 1.7.0, but did not update the manpage. Fix
the manpages so they are once again accurate.

Signed-off-by: Matthew Heon <mheon@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-31 06:02:34 -04:00
78c38460eb Merge pull request #6380 from mheon/fix_mount_readonly
Add support for `readonly` option to --mount
2020-05-29 08:26:05 -04:00
89b4683cc4 Merge pull request #6372 from boaz0/gh_6283
Add --format to pod inspect
2020-05-27 09:59:25 -04:00
1f8a78747a Add --format to pod inspect
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2020-05-27 09:48:38 +03:00
e26f9eda64 Add support for readonly option to --mount
This is just an alias to the `ro` option, but it's already in the
manpages (and Docker) so we might as well add support for it.

Fixes #6379

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-26 16:05:11 -04:00
26c8a826a6 docs: fix typo
- Similar is misspelled
- a `to` is missing after Similar

Signed-off-by: Damiano Donati <damiano.donati@gmail.com>
2020-05-26 20:59:40 +01:00
1077d2d0b7 Merge pull request #6321 from Luap99/podman-generate-systemd-unit-prefix
Allow to change the generated systemd unit name prefix
2020-05-25 06:46:17 -04:00
35567e706b Attempt to turn on additional build tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-22 12:55:23 -04:00
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
8fe0e294b5 Merge pull request #6306 from fatherlinux/master
[CI:DOCS] Docs revamp.
2020-05-22 15:41:37 +02:00