136 Commits

Author SHA1 Message Date
94087bade2 Cleanup man pages
The format of the --network flags in man pages was all screwed up.
This patch cleans this up.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-10-25 16:47:53 -04:00
e4566cc216 Add multiple networks explanation to docs
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2019-10-24 22:18:16 +03:00
0d623914d0 Add support for anonymous volumes to podman run -v
Previously, when `podman run` encountered a volume mount without
separate source and destination (e.g. `-v /run`) we would assume
that both were the same - a bind mount of `/run` on the host to
`/run` in the container. However, this does not match Docker's
behavior - in Docker, this makes an anonymous named volume that
will be mounted at `/run`.

We already have (more limited) support for these anonymous
volumes in the form of image volumes. Extend this support to
allow it to be used with user-created volumes coming in from the
`-v` flag.

This change also affects how named volumes created by the
container but given names are treated by `podman run --rm` and
`podman rm -v`. Previously, they would be removed with the
container in these cases, but this did not match Docker's
behaviour. Docker only removed anonymous volumes. With this patch
we move to that model as well; `podman run -v testvol:/test` will
not have `testvol` survive the container being removed by `podman
rm -v`.

The sum total of these changes let us turn on volume removal in
`--rm` by default.

Fixes: #4276

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-10-17 13:18:17 -04:00
38a6a2000a systemd: accept also /sbin/init
it is a regression caused by
3ba3e1c7510d1780b6527a4aa52e40ac2c5b576a.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1761514

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-15 11:14:21 +02:00
ca80c60523 Touch up bad math in run man page
We'd an off by one error in the run man page spotted by @leorochael in

Fixes: #4239

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-10-11 13:55:31 -04:00
5963077e93 cli: support --systemd=always
it enforces the systemd mode also when the command name doesn't match
/usr/sbin/init or systemd.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-09 23:39:18 +02:00
3ba3e1c751 systemd: expect full path /usr/sbin/init
"init" is a quite common name for the command executed in a container
image and Podman ends up using the systemd mode also when not
required.

Be stricter on enabling the systemd mode and not enable it
automatically when the basename is "init" but expect the full path
"/usr/sbin/init".

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-09 23:38:45 +02:00
118cf1fc63 Setup a reasonable default for pids-limit 4096
CRI-O defaults to 1024 for the maximum pids in a container.  Podman
should have a similar limit. Once we have a containers.conf, we can
set the limit in this file, and have it easily customizable.

Currently the documentation says that -1 sets pids-limit=max, but -1 fails.
This patch allows -1, but also indicates that 0 also sets the max pids limit.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-10-04 16:09:13 -04:00
405ef9bc56 Add 'relabel' to --mount options
Currently if a user specifies a --mount option, their is no way to tell SELinux
to relabel the mount point.

This patch addes the relabel=shared and relabel=private options.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-16 09:56:43 -04:00
7ac6ed3b4b Merge pull request #3581 from mheon/no_cgroups
Support running containers without CGroups
2019-09-11 00:58:46 +02:00
c1761ba1ac Merge pull request #3817 from xcffl/master
Add explanation mounting named volumes for `podman run`
2019-09-10 19:17:39 +02:00
c2284962c7 Add support for launching containers without CGroups
This is mostly used with Systemd, which really wants to manage
CGroups itself when managing containers via unit file.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-10 10:52:37 -04:00
3d240bd795 Replace "podman" with "Podman"
Signed-off-by: xcffl <xcffl@outlook.com>
2019-09-07 20:16:42 +08:00
cd7a1ac194 Add instructions for mounting named volumes
from the host for `podman run`

Signed-off-by: xcffl <xcffl@outlook.com>
2019-09-07 19:28:21 +08:00
5711aabb4d cli-flags: use a consistent format for <size><unit>
Use a consistent format for description of the <size><unit> flags.
Also, avoid backticks for /dev/shm, as that's interpreted as the format
by the flag parsing lib.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-09-05 11:13:39 +02:00
09f373283a Add command aliases to SYNOPSIS section
The files under docs/links reference another man page, e.g.
`man podman-container-list` displays `podman-ps(1)`. This adds
the alias to the in the displayed page's SYNOPSIS section.

Signed-off-by: Ryan Whalen <rj.whalen@gmail.com>
2019-08-31 16:58:52 -04:00
59261cf014 Merge pull request #3845 from chrahunt/patch-2
Fix minor typos in podman-run docs.
2019-08-22 21:20:38 +02:00
dc19c3e9f8 Fix minor typos in podman-run docs.
Signed-off-by: Chris Hunt <chrahunt@gmail.com>
2019-08-21 21:30:14 -04:00
befaa95d93 Merge pull request #3777 from rhatdan/vendor
Add support & documentation to run containers with different file types
2019-08-19 13:48:15 +02:00
76f327f73f Merge pull request #3617 from QiWang19/create_pull
add --pull flag for podman create&run
2019-08-17 14:55:14 +02:00
2eda50cb31 Remove --tmpfs size default
Docker has unlimited tmpfs size where Podman had it set to 64mb. Should be standard between the two.
Remove noexec default

Signed-off-by: Ashley Cui <ashleycui16@gmail.com>
2019-08-14 09:42:33 -04:00
316e51f0a9 Add support & documentation to run containers with different file types
Udica is adding new features to allow users to define container process
and file types. This would allow us to setup trusted communications channels
between multiple security domains.  ContainerA -> ContainerB -> ContainerC

Add tests to make sure users can change file types

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-08-13 10:16:01 -04:00
decfea65be add --pull flag for podman create&run
Requirement from https://github.com/containers/libpod/issues/3575#issuecomment-512238393

Added --pull for podman create and pull to match the newly added flag in docker CLI.
`missing`: default value, podman will pull the image if it does not exist in the local.
`always`: podman will always pull the image.
`never`: podman will never pull the image.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-08-09 15:21:34 -04:00
37b40e9acd Merge pull request #3466 from TomSweeneyRedHat/dev/tsweeney/myhome
Touch up XDG, add rootless links
2019-08-06 17:42:54 +02:00
2da86bdc3a Set -env variables as appropriate
close #3648

podman create and podman run do not set --env variable if the environment is not present with a value

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-07-30 12:02:18 -04:00
5779e89809 Touch up XDG, add rootless links
Touch up a number of formating issues for XDG_RUNTIME_DIRS in a number
of man pages.  Make use of the XDG_CONFIG_HOME environment variable
in a rootless environment if available, or set it if not.

Also added a number of links to the Rootless Podman config page and
added the location of the auth.json files to that doc.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-07-29 11:29:41 -04:00
0c4dfcfe57 Merge pull request #3639 from giuseppe/user-ns-container
podman: support --userns=ns|container
2019-07-26 15:06:06 +02:00
1d72f651e4 podman: support --userns=ns|container
allow to join the user namespace of another container.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-25 23:04:55 +02:00
e2067836a4 Document SELinux label requirements for the rootfs argument
When using the rootfs argument, SELinux systems fails silently
when the files are not properly labeled.

Related #3628

Signed-off-by: Tristan Cacqueray <tdecacqu@redhat.com>
2019-07-24 08:25:36 -04:00
a1a79c08b7 Implement conmon exec
This includes:
	Implement exec -i and fix some typos in description of -i docs
	pass failed runtime status to caller
	Add resize handling for a terminal connection
	Customize exec systemd-cgroup slice
	fix healthcheck
	fix top
	add --detach-keys
	Implement podman-remote exec (jhonce)
	* Cleanup some orphaned code (jhonce)
	adapt remote exec for conmon exec (pehunt)
	Fix healthcheck and exec to match docs
		Introduce two new OCIRuntime errors to more comprehensively describe situations in which the runtime can error
		Use these different errors in branching for exit code in healthcheck and exec
	Set conmon to use new api version

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-22 15:57:23 -04:00
b59abdc1b1 Merge pull request #3579 from QiWang19/dns_net
fix --dns and --network conflict
2019-07-19 02:22:28 +02:00
3f721f8b17 fix --dns* and --network not set to host conflict
Close #3553
This PR makes --dns, --dns-option, --dns-search, and --network not set to host flag mutually exclusive for podman build and create. Returns conflict error if both flags are set.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-07-18 09:39:31 -04:00
0b57e77d7c libpod: support for cgroup namespace
allow a container to run in a new cgroup namespace.

When running in a new cgroup namespace, the current cgroup appears to
be the root, so that there is no way for the container to access
cgroups outside of its own subtree.

By default it uses --cgroup=host to keep the previous behavior.

To create a new namespace, --cgroup=private must be provided.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-18 10:32:25 +02:00
3e53bfe36e Make the healthcheck flags compatible with Docker CLI
Docker CLI calls the healthcheck flags "--health-*", instead of
"--healthcheck-*".

Introduce the former, in order to keep compatibility, and alias
the later, in order to avoid breaking current usage.

Change "--healthcheck-*" to "--health-*" in the docs and tests.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-07-16 06:15:28 +02:00
e4cba7d36a create: improve parser for --healthcheck-command
Fix Docker CLI compatibility issue: the "--healthcheck-command" option
value should not be split but instead be passed as single string to
"CMD-SHELL", i.e. "/bin/sh -c <opt>".

On the other hand implement the same extension as is already available
for "--entrypoint", i.e. allow the option value to be a JSON array of
strings. This will make life easier for tools like podman-compose.

Updated "--healthcheck-command" option values in tests accordingly.

Continuation of #3455 & #3507

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
2019-07-14 10:33:01 +03:00
6f3e7f7ecc Merge pull request #3557 from rhatdan/env
Add support for --env-host
2019-07-12 10:33:18 +02:00
369f8b8862 Fix spelling mistakes in man pages and other docs
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-11 17:56:54 -04:00
efe9c5b0e7 Add glob parsing for --env flag
Sometimes you want to add a few environmen variables based on the last field being a "*".

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-11 17:15:20 -04:00
2b64f88446 Merge pull request #3491 from giuseppe/rlimit-host
podman: add --ulimit host
2019-07-11 21:35:37 +02:00
df75fc62c8 Add support for -env-host
This flag passes the host environment into the container.  The basic idea is to
leak all environment variables from the host into the container.

Environment variables from the image, and passed in via --env and --env-file
will override the host environment.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-11 13:25:47 -04:00
fb88074e68 podman: add --ulimit host
add a simple way to copy ulimit values from the host.

if --ulimit host is used then the current ulimits in place are copied
to the container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-07-08 19:22:54 +02:00
69a229b24b docs: fix --healthcheck-command option
Make the documentation agree with the code.

Related #3507

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
2019-07-08 19:06:01 +03:00
7e3f1c21b0 libpod: specify a detach keys sequence in libpod.conf
Add the ability of specifying a detach keys sequence in libpod.conf

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-06-26 10:12:34 +02:00
47e2ad8ec3 Fix documentation for log-driver
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-06-19 12:50:05 -04:00
292a48cab4 cmd, docs, test: fix some typos
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-18 10:52:19 +02:00
0d341170d5 Fix subgidname option in docs for podman run
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2019-06-17 15:48:29 +03:00
1ac8307ae4 Merge pull request #3306 from rhatdan/exit
Document exit codes for podman exec
2019-06-14 18:05:56 +02:00
c7ee7f868d Document exit codes for podman exec
Also fix podman run exit codes to show real messages when failures
happen.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-06-13 23:38:10 -04:00
23efe4cb81 storage: support --mount type=bind,bind-nonrecursive
add support for not recursive bind mounts.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-13 15:32:45 +02:00
19e0928037 standardize documentation formatting
Signed-off-by: Ashley Cui <ashleycui16@gmail.com>
2019-06-10 11:48:02 -04:00