Commit graph

501 commits

Author SHA1 Message Date
OpenShift Merge Robot 3384bd87c8
Merge pull request #2672 from TomSweeneyRedHat/dev/tsweeney/clistoreconf
Add CLI storage conf example to run manpage
2019-03-16 04:12:38 -07:00
OpenShift Merge Robot 3754f58499
Merge pull request #2643 from rhatdan/volumes
Make sure buildin volumes have the same ownership and permissions as …
2019-03-15 14:52:45 -07:00
TomSweeneyRedHat 26a89b61b3 Add CLI storage conf example to run manpage
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Add an example to the run man page to illustrate how
you can configure storage from the CLI.  This addresses
a request from issue #2662.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-03-15 15:03:47 -04:00
baude 5e86acd591 display logs for multiple containers at the same time
add the ability for users to specify more than one container at a time
while using podman logs.  If more than one container is being displayed,
podman will also prepend a shortened container id of the container on
the log line.

also, enabled the podman-remote logs command during the refactoring of
the above ability.

fixes issue #2219

Signed-off-by: baude <bbaude@redhat.com>
2019-03-15 13:41:01 -05:00
OpenShift Merge Robot 6e4c32967e
Merge pull request #2595 from jwhonce/bug/1677908
Add --replace flag to "podman container runlabel"
2019-03-15 10:52:57 -07:00
Daniel J Walsh 9d81be9614
Make sure buildin volumes have the same ownership and permissions as image
When creating a new image volume to be mounted into a container, we need to
make sure the new volume matches the Ownership and permissions of the path
that it will be mounted on.

For example if a volume inside of a containre image is owned by the database
UID, we want the volume to be mounted onto the image to be owned by the
database UID.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-15 10:44:44 -04:00
TomSweeneyRedHat a220473698 Update pull and pull-always in bud man page
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Update the `--pull` and `--pull-always` documentation in the build
command to clarify what each does.

Fixes: https://github.com/containers/buildah/issues/1381
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-03-14 18:09:23 -04:00
OpenShift Merge Robot fc5951ad55
Merge pull request #1642 from kunalkushwaha/image-tree
Tree implementation for podman images
2019-03-14 09:53:49 -07:00
TomSweeneyRedHat d033452b3d Replace skopeo-containers with containers-common
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Replaces 'skopeo-containers' with 'containers-common' in the files that
I feel comfortable changing it in.  There are a number of rpm building
related files that still have it, but I was hesitant to do so.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-03-14 09:01:30 -04:00
OpenShift Merge Robot 296c61d896
Merge pull request #2638 from jwhonce/issue/1959
Corrected detach man pages and code comments
2019-03-14 05:49:24 -07:00
OpenShift Merge Robot f6cfa8f4d8
Merge pull request #2640 from TomSweeneyRedHat/dev/tsweeney/builddocfix2
Replace buildah with podman in build doc
2019-03-14 01:12:19 -07:00
OpenShift Merge Robot fb5f8ebcb6
Merge pull request #2624 from edsantiago/inspect_usability
Usability cleanup for 'inspect'
2019-03-14 00:31:22 -07:00
Kunal Kushwaha a4b3b9ffbb Tree implementation for podman images
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2019-03-14 11:22:06 +09:00
TomSweeneyRedHat 4b41f05a91 Replace buildah with podman in build doc
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Remove the word buildah from the man page and replace it
with podman.  Cut and paste job gone bad apparently.

Fixes: #2639
2019-03-13 20:50:02 -04:00
Jhon Honce f29a765573 Corrected detach man pages and code comments
* Updated documentation to match code

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-13 14:16:37 -07:00
Jhon Honce 504a0ff72f Add --replace flag to "podman container runlabel"
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1677908

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-13 13:16:49 -07:00
Ed Santiago 360487ab6d Add 'podman events' to podman(1)
Also: enforce noSubArgs for podman events

Also: remove unnecessary '[flags]' from Use message (Cobra
adds it automatically)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 10:22:10 -06:00
Ed Santiago 3de5e4a99f Usability cleanup for 'inspect'
Make the usage messages (and options) different between
podman inspect, podman image inspect, and podman container inspect.

Disable inapplicable options (-l, -s) for podman image inspect

Disable -t (type) when the type is implicit through the subcommand.

Update man page to reflect differences in usage.

Fix broken test.

Uglier than desirable due to Go and Cobra limitations

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 08:29:52 -06:00
OpenShift Merge Robot 883566fbc0
Merge pull request #2562 from baude/healtcheckphase2
healthcheck phase 2
2019-03-12 13:09:13 -07:00
baude 03716cf7f3 healtcheck phase 2
integration of healthcheck into create and run as well as inspect.
healthcheck enhancements are as follows:

* add the following options to create|run so that non-docker images can
define healthchecks at the container level.
  * --healthcheck-command
  * --healthcheck-retries
  * --healthcheck-interval
  * --healthcheck-start-period

* podman create|run --healthcheck-command=none disables healthcheck as
described by an image.
* the healthcheck itself and the healthcheck "history" can now be
observed in podman inspect
* added the wiring for healthcheck history which logs the health history
of the container, the current failed streak attempts, and log entries
for the last five attempts which themselves have start and stop times,
result, and a 500 character truncated (if needed) log of stderr/stdout.

The timings themselves are not implemented in this PR but will be in
future enablement (i.e. next).

Signed-off-by: baude <bbaude@redhat.com>
2019-03-12 14:29:18 -05:00
baude ca1e76ff63 Add event logging to libpod, even display to podman
In lipod, we now log major events that occurr.  These events
can be displayed using the `podman events` command. Each
event contains:

* Type (container, image, volume, pod...)
* Status (create, rm, stop, kill, ....)
* Timestamp in RFC3339Nano format
* Name (if applicable)
* Image (if applicable)

The format of the event and the varlink endpoint are to not
be considered stable until cockpit has done its enablement.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-11 15:08:59 -05:00
OpenShift Merge Robot 8656d2d887
Merge pull request #2538 from giuseppe/slirp4netns-path
libpod: allow to configure path to the slirp4netns binary
2019-03-11 07:56:50 -07:00
TomSweeneyRedHat 3e3fcd5422 Remove --rm and --detach don't coexist note
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

With later changes of Podman, you can now use both the
--rm and --detach in a single run command.  This PR removes
the documentation in the man pages saying this is not
allowed.

Fixes: #2601
2019-03-11 09:34:30 -04:00
Giuseppe Scrivano e02393ba70
libpod: allow to configure path to the network-cmd binary
allow to configure the path to the network-cmd binary, either via an
option flag --network-cmd-path or through the libpod.conf
configuration file.

This is currently used to customize the path to the slirp4netns
binary.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 09:29:04 +01:00
Ed Santiago 91e15bd802 add podman-healthcheck(1) to podman(1)
...caught by hack/podman-commands.sh script. Which had a little
buglet, which I fixed: add a special case for 'help', which
neither has nor needs a man page.

I believe the podman-commands.sh script is ready to be run in CI,
hint hint.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-07 14:33:25 -07:00
OpenShift Merge Robot ef714756b7
Merge pull request #2532 from QiWang19/i2520
add flag --extract tar file in podman cp
2019-03-06 09:40:39 -08:00
Qi Wang d9e1b2c470 add flag --extract tar file in podman cp
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-06 10:06:25 -05:00
baude 598bde52d0 podman healthcheck run (phase 1)
Add the ability to manually run a container's healthcheck command.
This is only the first phase of implementing the healthcheck.
Subsequent pull requests will deal with the exposing the results and
history of healthchecks as well as the scheduling.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-05 14:03:55 -06:00
Giuseppe Scrivano 0b34327ad4
exec: support --preserve-fds
Allow to pass additional FDs to the process being executed.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-02 11:45:42 +01:00
OpenShift Merge Robot 8ee471f800
Merge pull request #2495 from baude/runlabelpulldefault
Pull image for runlabel if not local
2019-03-01 12:50:50 -08:00
baude a4b82c03d3 Pull image for runlabel if not local
In cases where a user issues the podman container runlabel
command and the image is not local, we now default to pulling
the image automatically to mimic the atomic cli behavior.

Fixes: BZ #1677905

Signed-off-by: baude <bbaude@redhat.com>
2019-03-01 09:20:12 -06:00
Ed Santiago 6f474c5704 Fix link inconsistencies in man pages
Found via:

    for i in docs/*.md;do x=$(perl -ne 'if (/\[(podman-.*?)\(1\)\]\((podman-.*?)\.1\.md/) { print "  $1 != $2\n" if $1 ne $2; print " ENOENT $2\n" unless -e "docs/$2.1.md" }' <$i); if [ -n "$x" ]; then echo $i; echo "$x";fi;done

...which is probably a good candidate for another CI hook,
except I have no idea how to rewrite it in awk.

Additionally, mark `podman refresh` and `podman container refresh`
as hidden, remove its man page, and remove references to it from
all other man pages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-01 06:53:52 -07:00
Daniel J Walsh be0845936a
Move Alias lines to descriptions of commands
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-28 15:14:08 -05:00
Daniel J Walsh edfe644a0c
No podman container ps command exists
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-28 14:57:03 -05:00
Daniel J Walsh b4b7b298fc
Clean up man pages to match commands
Also add podman-commands.sh to compare man pages to commands.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-27 16:37:40 -05:00
Ed Santiago a20ff42134 Better usage synopses for subcommands
Conceptually simple: include, where applicable, a brief
description of command-line options for each subcommand.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-02-26 18:10:36 -07:00
Matthew Heon 5fcbe5baab Add volume path to default libpod.conf (and manpage)
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-26 09:38:02 -05:00
Valentin Rothberg 7fea0d7077 docs: cross-reference podman-{generate,play}-kube
Addresses: https://github.com/containers/libpod/pull/2428#discussion_r260200694
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-26 15:07:05 +01:00
OpenShift Merge Robot f9ef82ee7c
Merge pull request #2362 from mheon/add_locks_to_config
Add num_locks to the default libpod config
2019-02-26 10:37:59 +01:00
Matthew Heon 5b010ee58b Add num_locks to the default libpod config
Allow adjusting number of locks in libpod.conf via an already
available knob we previously didn't expose in the default config
file.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-25 17:43:25 -05:00
OpenShift Merge Robot e45c442080
Merge pull request #2358 from rhatdan/namespace
Fix up handling of user defined network namespaces
2019-02-25 21:31:50 +01:00
Daniel J Walsh fe4c0c3780
Change exit code to 1 on podman rmi nosuch image
Make it easy for scripts to determine if an image removal
failure.   If only errors were no such image exit with 1
versus 125.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-25 12:49:27 -05:00
Daniel J Walsh e41279b902
Change exit code to 1 on podman rm nosuch container
Make it easy for scripts to determine if a container removal
fails versus the container did not exist.

If only errors were no such container exit with 1 versus 125.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-25 10:31:04 -05:00
Daniel J Walsh b87bdced1f
Fix up handling of user defined network namespaces
If user specifies network namespace and the /etc/netns/XXX/resolv.conf
exists, we should use this rather then /etc/resolv.conf

Also fail cleaner if the user specifies an invalid Network Namespace.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-23 05:47:27 -05:00
TomSweeneyRedHat ff0b4652ef Vendor Buildah v1.7
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Vendors in Buildah 1.7 into Podman.
Also the latest imagebuilder and changes for
`build --target`

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-22 16:40:05 -05:00
baude 6ab6e2c307 hide --latest on the remote-client
in the case of the remote-client, it was decided to hide the latest
flag to avoid confusion for end-users on what the "last" container,
volume, or pod are.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-22 14:13:08 -06:00
Matthew Heon d2b77f8b33 Do not make renumber shut down the runtime
The original intent behind the requirement was to ensure that, if
two SHM lock structs were open at the same time, we should not
make such a runtime available to the user, and should clean it up
instead.

It turns out that we don't even need to open a second SHM lock
struct - if we get an error mapping the first one due to a lock
count mismatch, we can just delete it, and it cleans itself up
when it errors. So there's no reason not to return a valid
runtime.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-21 10:51:42 -05:00
TomSweeneyRedHat 675a202a1b Fifth chunk of Cobra Examples
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

The fifth and final chunk of examples for the Cobra
examples in the CLI help output.

Also includes a few man page touchups.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-18 19:37:09 -05:00
OpenShift Merge Robot 3f32eae56f
Merge pull request #2357 from TomSweeneyRedHat/dev/tsweeney/cobrahelp3
Add 3rd chunk of Cobra examples
2019-02-17 22:44:04 +01:00
OpenShift Merge Robot 6aaf8d39a9
Merge pull request #2295 from haircommander/recursive-start
Recursively start a pod if a container is run in it
2019-02-17 21:04:33 +01:00
TomSweeneyRedHat b62c0e703d Add 3rd chunk of Cobra examples
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Adds the third chunk of Cobra examples to the cli help.
As were putting together a release tomorrow, tried to
hit the heavy commands with this PR.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-17 13:49:05 -05:00
Peter Hunt 81804fc464 pod infra container is started before a container in a pod is run, started, or attached.
Prior, a pod would have to be started immediately when created, leading to confusion about what a pod state should be immediately after creation. The problem was podman run --pod ... would error out if the infra container wasn't started (as it is a dependency). Fix this by allowing for recursive start, where each of the container's dependencies are started prior to the new container. This is only applied to the case where a new container is attached to a pod.

Also rework container_api Start, StartAndAttach, and Init functions, as there was some duplicated code, which made addressing the problem easier to fix.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-02-15 16:39:24 -05:00
TomSweeneyRedHat 72b91eb87f Second chunk of Cobra help
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Adds examples to Cobra help for a second chunk of commands.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-15 14:38:46 -05:00
OpenShift Merge Robot 40c6d5c98c
Merge pull request #2188 from TomSweeneyRedHat/dev/tsweeney/pullall
Add --all-tags to pull command
2019-02-15 14:45:03 +01:00
Giuseppe Scrivano 7899b738f4
docs: mention the new OCI runtime configuration
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-02-15 13:04:23 +01:00
OpenShift Merge Robot 81ace5caac
Merge pull request #2333 from TomSweeneyRedHat/dev/tsweeney/helpexamples
Add examples for Cobra
2019-02-15 00:07:34 +01:00
OpenShift Merge Robot 1a9128d1e4
Merge pull request #2320 from QiWang19/stdinPW
--password-stdin flag in `podman login`
2019-02-14 22:31:58 +01:00
OpenShift Merge Robot 18bf883eeb
Merge pull request #2151 from QiWang19/cp
'podman cp' copy between host and container
2019-02-14 22:31:52 +01:00
TomSweeneyRedHat a7a691809a Add examples for Cobra
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

First pass of entries for the Examples listed in the Cobra
Help.  Will add others in following PR's.
2019-02-14 15:03:11 -05:00
Daniel J Walsh 52df1fa7e0
Fix volume handling in podman
iFix builtin volumes to work with podman volume

Currently builtin volumes are not recored in podman volumes when
they are created automatically. This patch fixes this.

Remove container volumes when requested

Currently the --volume option on podman remove does nothing.
This will implement the changes needed to remove the volumes
if the user requests it.

When removing a volume make sure that no container uses the volume.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-14 13:21:52 -05:00
Qi Wang a8b149b406 --password-stdin flag in podman login
Support --password-stdin flag, reads a password from STDIN and pass it to `podman login`.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-02-14 10:09:25 -05:00
Qi Wang 36d962990a 'podman cp' copy between host and container
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-02-14 09:29:53 -05:00
OpenShift Merge Robot b7a3685cba
Merge pull request #2281 from rhatdan/deleteContainer
Remove container from storage on --force
2019-02-11 20:31:03 +01:00
OpenShift Merge Robot 8440b0734c
Merge pull request #2306 from baude/podstatsgotemplate
Podman pod stats -- fix GO template output
2019-02-11 16:02:53 +01:00
baude 4994fecd46 Podman pod stats -- fix GO template output
Go templates were not being processed or printed correctly for podman
pod stats.  Added the ability to do templates as well as honor the
table identifier.

Fixes #2258

Signed-off-by: baude <bbaude@redhat.com>
2019-02-10 11:27:09 -06:00
Daniel J Walsh 62c8ba527e
Add troubleshooting information about running a rootless containers.
Add a problem statement about shadow-utils and missing entries from
/etc/subuid and /etc/subgid.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-10 08:08:22 -07:00
TomSweeneyRedHat 1543a01be8 Add --all-tags to pull command
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Add --all-tags for the `podman pull` command so all tags
of an image will be pulled, not just ':latest'.  Emulates
the change in Buildah https://github.com/containers/buildah/pull/1263

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-09 20:00:19 -05:00
OpenShift Merge Robot c86e8f180c
Merge pull request #2280 from TomSweeneyRedHat/dev/tsweeney/trusty2
Update image-trust man with further comments
2019-02-09 14:02:10 +01:00
Daniel J Walsh 233ba5bd89
Remove container from storage on --force
Currently we can get into a state where a container exists in
storage but does not exist in libpod.  If the user forces a
removal of this container, then we should remove it from storage
even if the container is owned by another tool.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-09 05:33:14 -07:00
TomSweeneyRedHat 38422a38e7 Update image-trust man with further comments
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

After the last update, @mtrmac had some great suggestions which I've incorporated.
I've updated the G:oogle doc and have added this PR in case it's easier to see the diffs.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-08 13:47:30 -05:00
OpenShift Merge Robot f250745fe0
Merge pull request #2269 from rhatdan/selinux
Add documentation on running systemd on SELinux systems
2019-02-07 03:35:57 +01:00
Daniel J Walsh 1dd7bd0d0f
Add documentation on running systemd on SELinux systems
Lots of users are attempting to run systemd within a container.  They are
being blocked from running SELinux systems since they need the
container_manage_cgroup which is not enabled by default.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-06 05:52:39 -08:00
Daniel J Walsh 74d984e056
Add podman system prune and info commands
We are missing the equivalence of the docker system commands

This patch set adds `podman system prune`
and `podman system info`

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-05 10:41:55 -08:00
Daniel J Walsh 3554bfce98
Merge pull request #2196 from baude/toolbox
Changes to container runlabel for toolbox project
2019-02-05 10:34:40 -05:00
OpenShift Merge Robot d5593b8e71
Merge pull request #2233 from TomSweeneyRedHat/dev/tsweeney/trusty
Touch up image-trust man
2019-02-02 22:20:33 +01:00
TomSweeneyRedHat bae483c496 Touch up image-trust man
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

In #1899, @rhatdan asked me to try and tweak the verbiage
a bit in the podman-images-trust man page.  I've done so,
or attempted to, and have also added a policy-json(5) link.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-02 15:03:17 -05:00
TomSweeneyRedHat b58b95b408 Rework Podman description
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Rework the Podman Description.  I'm starting off with the Podman man page
to build consensus and we can then add to other places as appropriate.

This partially addresses: #1636

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-01 13:44:41 -05:00
OpenShift Merge Robot 805c6d997b
Merge pull request #2244 from rhatdan/version
Add support for short option -f in podman version
2019-01-30 18:51:22 +01:00
OpenShift Merge Robot d38da7b8be
Merge pull request #2243 from rhatdan/size
Add support for short option -s in podman inspect
2019-01-30 18:51:12 +01:00
Daniel J Walsh 2ed52c299f
Add support for short option -f in podman version
docker version supports a short options -f for --format

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-30 15:41:52 +00:00
Daniel J Walsh a05f3a49fd
Add support for short option -s in podman inspect
docker inspect supports a short -s option for --size.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-30 15:31:19 +00:00
Daniel J Walsh 9e340da255
Add support for short option -f
docker info supports a short -f option for --format.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-30 15:28:15 +00:00
baude 735f0de633 Changes to container runlabel for toolbox project
The toolbox project would benefit from a few changes to more closely
resembe the original atomic cli project.  Changes made are:

* only pull image for container runlabel if the label exists in the image
* if a container image does not have the desired label, exit with non-zero

Signed-off-by: baude <bbaude@redhat.com>
2019-01-30 08:44:58 -06:00
baude 656033ca96 podman image prune -- implement all flag
we now, by default, only prune dangling images.  if --all is passed, we
prune dangling images AND images that do not have an associated containers.

also went ahead and enabled the podman-remote image prune side of things.

Fixes: #2192

Signed-off-by: baude <bbaude@redhat.com>
2019-01-29 16:51:48 -06:00
Ken Dreyer 8b47e3ce6f tutorials: describe how to use podman in updates-testing
Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
2019-01-25 16:11:03 -07:00
OpenShift Merge Robot 812894bcea
Merge pull request #2203 from 9034725985/patch-1
remove sudo
2019-01-23 22:01:42 +01:00
Kushal f7f220d827
remove sudo
just tested with podman 1.0.0 on fedora 29
we don't need sudo

I tried this again and it seems like we DO need sudo?
Maybe I misunderstood something
but looks like I am unable to reproduce getting an IP address

also it would be nice if creating a check point
(which I belive means writing to disk) could be done without root
but I guess it depends on where on disk I am writing?

in any case, here is my new console output

```console
[kus@asus-vivobook personal]$ cd libpod/
[kus@asus-vivobook libpod]$ git checkout patch-1
Branch 'patch-1' set up to track remote branch 'patch-1' from 'origin'.
Switched to a new branch 'patch-1'
[kus@asus-vivobook libpod]$ podman run -dt -e HTTPD_VAR_RUN=/var/run/httpd -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
>                   -e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
>                   -e HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \
>                   registry.fedoraproject.org/f29/httpd /usr/bin/run-httpd
Trying to pull registry.fedoraproject.org/f29/httpd...Getting image source signatures
Copying blob 281a37f51f75: 85.68 MiB / 85.68 MiB [=======================] 1m47s
Copying blob ab0d48faadd2: 4.64 MiB / 4.64 MiB [=========================] 1m47s
Copying blob e1bf69dce18d: 49.77 MiB / 49.77 MiB [=======================] 1m47s
Copying config 532763348c4e: 6.66 KiB / 6.66 KiB [==========================] 0s
Writing manifest to image destination
Storing signatures
78917177dbf7634993fdcc44e0bc90c9422482b9a9e757c85c14dfd1ee09c777
[kus@asus-vivobook libpod]$ podman ps
CONTAINER ID  IMAGE                                        COMMAND               CREATED        STATUS            PORTS  NAMES
78917177dbf7  registry.fedoraproject.org/f29/httpd:latest  container-entrypo...  4 seconds ago  Up 3 seconds ago         nifty_lewin
[kus@asus-vivobook libpod]$ podman inspect -l | grep IPAddress\"
            "IPAddress": "",
[kus@asus-vivobook libpod]$ sudo podman inspect -l | grep IPAddress\"
[sudo] password for kus:
no such container
[kus@asus-vivobook libpod]$ podman logs --latest
=> sourcing 10-set-mpm.sh ...
=> sourcing 20-copy-config.sh ...
=> sourcing 40-ssl-certs.sh ...
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
[Tue Jan 22 12:59:38.887673 2019] [ssl:warn] [pid 1:tid 140100965338496] AH01909: 10.0.2.100:8443:0 server certificate does NOT include an ID which matches the server name
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
[Tue Jan 22 12:59:38.998169 2019] [ssl:warn] [pid 1:tid 140100965338496] AH01909: 10.0.2.100:8443:0 server certificate does NOT include an ID which matches the server name
[Tue Jan 22 12:59:38.998876 2019] [lbmethod_heartbeat:notice] [pid 1:tid 140100965338496] AH02282: No slotmem from mod_heartmonitor
[Tue Jan 22 12:59:39.001562 2019] [cgid:error] [pid 28:tid 140100965338496] (13)Permission denied: AH01243: Couldn't bind unix domain socket /run/httpd/cgisock.1
[Tue Jan 22 12:59:39.006051 2019] [mpm_event:notice] [pid 1:tid 140100965338496] AH00489: Apache/2.4.37 (Fedora) OpenSSL/1.1.1-pre9 configured -- resuming normal operations
[Tue Jan 22 12:59:39.006164 2019] [core:notice] [pid 1:tid 140100965338496] AH00094: Command line: 'httpd -D FOREGROUND'
[Tue Jan 22 12:59:39.006445 2019] [cgid:crit] [pid 1:tid 140100965338496] AH01238: cgid daemon failed to initialize
[kus@asus-vivobook libpod]$ podman top 78917177dbf7634993fdcc44e0bc90c9422482b9a9e757c85c14dfd1ee09c777
USER      PID   PPID   %CPU    ELAPSED           TTY     TIME   COMMAND
default   1     0      0.000   2m10.968144627s   pts/0   0s     httpd -D FOREGROUND
default   24    1      0.000   2m9.968688975s    pts/0   0s     /usr/bin/coreutils --coreutils-prog-shebang=cat /usr/bin/cat
default   25    1      0.000   2m9.968784295s    pts/0   0s     /usr/bin/coreutils --coreutils-prog-shebang=cat /usr/bin/cat
default   26    1      0.000   2m9.968880829s    pts/0   0s     /usr/bin/coreutils --coreutils-prog-shebang=cat /usr/bin/cat
default   27    1      0.000   2m9.968997468s    pts/0   0s     /usr/bin/coreutils --coreutils-prog-shebang=cat /usr/bin/cat
default   29    1      0.000   2m9.969134191s    pts/0   0s     httpd -D FOREGROUND
default   38    1      0.000   2m9.969239549s    pts/0   0s     httpd -D FOREGROUND
default   72    1      0.000   2m9.969344456s    pts/0   0s     httpd -D FOREGROUND
[kus@asus-vivobook libpod]$ podman container checkpoint 78917177dbf7634993fdcc44e0bc90c9422482b9a9e757c85c14dfd1ee09c777
checkpointing a container requires root
[kus@asus-vivobook libpod]$ podman stop --latest
78917177dbf7634993fdcc44e0bc90c9422482b9a9e757c85c14dfd1ee09c777
[kus@asus-vivobook libpod]$ podman ps -a
CONTAINER ID  IMAGE                                        COMMAND               CREATED        STATUS                    PORTS  NAMES
78917177dbf7  registry.fedoraproject.org/f29/httpd:latest  container-entrypo...  3 minutes ago  Exited (0) 9 seconds ago         nifty_lewin
[kus@asus-vivobook libpod]$ podman rm --latest
78917177dbf7634993fdcc44e0bc90c9422482b9a9e757c85c14dfd1ee09c777
```

original:
```console
[kus@mcny ~]$ podman run -dt -e HTTPD_VAR_RUN=/var/run/httpd -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
>                   -e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
>                   -e HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \
>                   registry.fedoraproject.org/f27/httpd /usr/bin/run-httpd
Trying to pull registry.fedoraproject.org/f27/httpd...Getting image source signatures
Copying blob ff3dab903f92: 80.73 MiB / 80.73 MiB [=========================] 14s
Copying blob 9347d6e9d864: 7.30 MiB / 7.30 MiB [===========================] 14s
Copying blob 2fc5c44251d4: 44.82 MiB / 44.82 MiB [=========================] 14s
Copying config 18f01f6f77ef: 6.55 KiB / 6.55 KiB [==========================] 0s
Writing manifest to image destination
Storing signatures
d0362571c3850159315778700a63a305296150177578a9339cca0d9c86ed97f1
[kus@mcny ~]$ podman ps
CONTAINER ID  IMAGE                                        COMMAND               CREATED         STATUS             PORTS  NAMES
d0362571c385  registry.fedoraproject.org/f27/httpd:latest  container-entrypo...  36 seconds ago  Up 36 seconds ago         happy_babbage
[kus@mcny ~]$
```

Signed-off-by: Kushal <kushaldeveloper@gmail.com>
2019-01-22 08:04:25 -05:00
Daniel J Walsh 69f8b8bd7e
Update transfer.md and commands.md to add missing commands.
These pages are a litte out of data.  Add missing content.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-21 14:08:19 -05:00
Daniel J Walsh 78fc4c67fd
Add --latest and --all to podman mount/umount
I find these useful for playing around with containers.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-16 10:05:41 -05:00
Giuseppe Scrivano 50c86ae389
oci: allow to define multiple OCI runtimes
we can define multiple OCI runtimes that can be chosen with
--runtime.

in libpod.conf is possible to specify them with:

[runtimes]
foo = [
             "/usr/bin/foo",
	     "/usr/sbin/foo",
]
bar = [
             "/usr/bin/foo",
	     "/usr/sbin/foo",
]

If the argument to --runtime is an absolute path then it is used
directly without any lookup in the configuration.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-01-14 10:22:18 +01:00
Daniel J Walsh 55583bdfa6
Fix up image sign and trust
Add completions
Fix man pages
fix code in sign to answer PR Comments.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-09 15:19:46 -05:00
OpenShift Merge Robot c37f731596
Merge pull request #2040 from QiWang19/signimg
Support podman image sign
2019-01-09 09:09:10 -08:00
OpenShift Merge Robot 7f91ebb441
Merge pull request #2103 from debarshiray/wip/debarshiray/man-page-order-long-short-options
List the long variant of each option before its shorter counterpart
2019-01-09 03:04:53 -08:00
Debarshi Ray bdf8965846 List the long variant of each option before its shorter counterpart
This is the style followed in most of the other man pages.

Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2019-01-09 11:14:06 +01:00
W. Trevor King f6a2b6bf2b hooks: Add pre-create hooks for runtime-config manipulation
There's been a lot of discussion over in [1] about how to support the
NVIDIA folks and others who want to be able to create devices
(possibly after having loaded kernel modules) and bind userspace
libraries into the container.  Currently that's happening in the
middle of runc's create-time mount handling before the container
pivots to its new root directory with runc's incorrectly-timed
prestart hook trigger [2].  With this commit, we extend hooks with a
'precreate' stage to allow trusted parties to manipulate the config
JSON before calling the runtime's 'create'.

I'm recycling the existing Hook schema from pkg/hooks for this,
because we'll want Timeout for reliability and When to avoid the
expense of fork/exec when a given hook does not need to make config
changes [3].

[1]: https://github.com/opencontainers/runc/pull/1811
[2]: https://github.com/opencontainers/runc/issues/1710
[3]: https://github.com/containers/libpod/issues/1828#issuecomment-439888059

Signed-off-by: W. Trevor King <wking@tremily.us>
2019-01-08 21:06:17 -08:00
OpenShift Merge Robot c9d63fe89d
Merge pull request #2097 from debarshiray/wip/debarshiray/podman-exec-workdir
Add a --workdir option to 'podman exec'
2019-01-08 10:21:14 -08:00
Debarshi Ray 867669374c Add a --workdir option to 'podman exec'
Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2019-01-08 17:42:37 +01:00
Debarshi Ray e02199f2a4 Default --sig-proxy to true for 'podman start --attach'
The --sig-proxy option in both 'podman attach' and 'podman run' default
to true, and there's no reason for 'podman start --attach' to be any
different. However, since it only makes sense to proxy signals when
the container is attached, 'podman start --sig-proxy' will continue to
error if --attach isn't used.

Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2019-01-08 16:34:09 +01:00
Qi Wang bce22dc621 [WIP]Support podman image sign
Generate a signature claim for an image using user keyring (--sign-by). The signature file will be stored in simple json format under the default or the given directory (--directory or yaml file in /etc/containers/registries.d/).

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-01-08 09:53:18 -05:00
Daniel J Walsh b367855d5f
Add the configuration file used to setup storage to podman info
Users have no idea what storage configuration file is used to setup
storage, so adding this to podman info, should make it easier to
discover.

This requires a revendor of containers/storage

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-07 10:02:26 -05:00
Valentin Rothberg 75578aad61 add container-init support
Add support for executing an init binary as PID 1 in a container to
forward signals and reap processes.  When the `--init` flag is set for
podman-create or podman-run, the init binary is bind-mounted to
`/dev/init` in the container and "/dev/init --" is prepended to the
container's command.

The default base path of the container-init binary is `/usr/libexec/podman`
while the default binary is catatonit [1].  This default can be changed
permanently via the `init_path` field in the `libpod.conf` configuration
file (which is recommended for packaging) or temporarily via the
`--init-path` flag of podman-create and podman-run.

[1] https://github.com/openSUSE/catatonit

Fixes: #1670
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-04 11:42:03 +01:00
Daniel J Walsh ad36345fde
Add troubleshooting for sparse files
A common failure with people building container images is the
creation of large sparse files, particularly useradd creating
the lastlog file.

This PR Documents the failures.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-30 08:08:13 -05:00
Daniel J Walsh a22f00d4c5
Allow alias for list, ls, ps to work
Allow multiple alias for listing containers and images.

Also fix documentation for umount and unmount

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-23 09:38:57 -05:00
Daniel J Walsh c657dc4fdb
Switch all referencs to image.ContainerConfig to image.Config
This will more closely match what Docker is doing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-21 15:59:34 -05:00
OpenShift Merge Robot 2de6cadd6f
Merge pull request #1967 from baude/kubereplay
Add Play
2018-12-20 05:41:38 -08:00
OpenShift Merge Robot 2e9952c424
Merge pull request #1900 from vbatts/cni-config-instructions
docs/tutorials: add a basic network config
2018-12-20 03:55:03 -08:00
OpenShift Merge Robot 8ec8ee935e
Merge pull request #1899 from QiWang19/trustimg
Support podman image trust command
2018-12-19 13:07:10 -08:00
baude 9b03cacc87 Add Play
podman play kube adds the ability for the user to recreate pods and containers
from a Kubernetes YAML file in libpod.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-19 14:20:55 -06:00
Qi Wang 31edf47285 Support podman image trust command
Display the trust policy of the host system. The trust policy is stored in the /etc/containers/policy.json file and defines a scope of registries or repositories.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2018-12-19 13:36:11 -05:00
OpenShift Merge Robot c8eaf59d5f
Merge pull request #2021 from rhatdan/restart
Add information on --restart
2018-12-18 13:02:39 -08:00
OpenShift Merge Robot 9b6a70f6c9
Merge pull request #1935 from deuscapturus/master
add getlogin command
2018-12-18 12:27:29 -08:00
Daniel J Walsh 59635cd186
Add information on --restart
We need to recommend that users use Systemd unit files if they want
the container to restart automatically.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-18 12:50:50 -05:00
baude 0702e71ca5 generate service object inline
no longer require the service object be output to a different file; we should be
doing this inline with the pods for user convenience.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-18 09:17:30 -06:00
Vincent Batts 4faf8d8836
docs/tutorials: add a basic network config
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-12-17 12:28:55 -05:00
Theodore Cowan d5647fe053
add --get-login command to podman-login.
Returns user if user is logged-in to the registry.  Returns error
if not logged in with non-zero status code.

Signed-off-by: Theodore Cowan <theodore-cowan@pluralsight.com>
2018-12-17 11:20:40 -05:00
OpenShift Merge Robot 5073638d83
Merge pull request #1953 from baude/podstoptimeout
add timeout to pod stop
2018-12-07 09:06:03 -08:00
baude 5209894100 add timeout to pod stop
like podman stop of containers, we should allow the user to specify
a timeout override when stopping pods; otherwise they have to wait
the full timeout time specified during the pod/container creation.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-07 10:27:41 -06:00
OpenShift Merge Robot 49d9a8f951
Merge pull request #1928 from baude/podtokube
generate kube
2018-12-07 07:46:52 -08:00
Miloslav Trmač b134951d14 Minimally update for the DockerInsecureSkipTLSVerify type change
Following SystemContext.DockerInsecureSkipTLSVerify, make the
DockerRegistryOne also an OptionalBool, and update callers.

Explicitly document that --tls-verify=true and --tls-verify unset
have different behavior in those commands where the behavior changed
(or where it hasn't changed but the documentation needed updating).

Also make the --tls-verify man page sections a tiny bit more consistent
throughout.

This is a minimal fix, without changing the existing "--tls-verify=true"
paths nor existing manual insecure registry lookups.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:34:59 +01:00
OpenShift Merge Robot 5c6e02b55b
Merge pull request #1904 from umohnani8/volume
Add "podman volume" command
2018-12-06 08:59:13 -08:00
OpenShift Merge Robot 3e60de629d
Merge pull request #1912 from baude/prune
Add ability to prune containers and images
2018-12-06 08:31:20 -08:00
OpenShift Merge Robot 99bbbeb746
Merge pull request #1887 from mheon/rm_sync
Add --sync option to podman rm
2018-12-06 08:11:51 -08:00
Matthew Heon e5335fd74c Remove --sync flag from podman rm
Per discussion with Dan, it would be better to automatically
handle potential runtime errors by automatically syncing if they
occur. Retaining the flag for `ps` makes sense, as we won't even
be calling the OCI runtime and as such won't see errors if the
state desyncs, but rm can be handled automatically.

The automatic desync handling code will take some additional work
so we'll land this as-is (sync on ps is enough to solve most
desync issues).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
Matthew Heon 28bead8be8 Add --sync flag to podman ps
The previous commit added support for --sync to podman rm to
ensure state inconsistencies would not prevent containers from
being removed.

Add the flag to podman ps as well, so that all containers can be
forcibly synced and all state inconsistencies resolved.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
Matthew Heon a0c9be2061 Add --sync option to podman rm
With the changes made recently to ensure Podman does not hit the
OCI runtime as often to sync state, we can find ourselves in a
situation where the runtime's state does not match ours.

Add a --sync flag to podman rm to ensure we can still remove
containers when this happens.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-12-06 09:10:45 -05:00
umohnani8 4c70b8a94b Add "podman volume" command
Add support for podman volume and its subcommands.
The commands supported are:
	podman volume create
	podman volume inspect
	podman volume ls
	podman volume rm
	podman volume prune

This is a tool to manage volumes used by podman. For now it only handle
named volumes, but eventually it will handle all volumes used by podman.

Signed-off-by: umohnani8 <umohnani@redhat.com>
2018-12-06 10:17:16 +00:00
Giuseppe Scrivano 0a838fc239
tutorial: add ostree dependency
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-06 11:13:56 +01:00
baude e037427035 Add ability to prune containers and images
Allow user to prune unused/unnamed images, the layer images from building,
via podman rmi --prune.

Allow user to prune stopped/exiuted containers via podman rm --prune.

This should resolve #1910

Signed-off-by: baude <bbaude@redhat.com>
2018-12-05 19:57:54 -06:00
OpenShift Merge Robot b81f640bb5
Merge pull request #1920 from wking/explicit-hooks-dirs
libpod/container_internal: Deprecate implicit hook directories
2018-12-04 12:19:48 -08:00
baude c8436b4912 generate kube
add the ability to generate kubernetes pod and service yaml representations
of libpod containers and pods.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-04 08:03:49 -06:00
baude 9c359a31d5 create pod on the fly
when a user specifies --pod to podman create|run, we should create that pod
automatically.  the port bindings from the container are then inherited by
the infra container.  this signicantly improves the workflow of running
containers inside pods with podman.  the user is still encouraged to use
podman pod create to have more granular control of the pod create options.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-03 15:49:17 -06:00
W. Trevor King a4b483c848 libpod/container_internal: Deprecate implicit hook directories
Part of the motivation for 800eb863 (Hooks supports two directories,
process default and override, 2018-09-17, #1487) was [1]:

> We only use this for override. The reason this was caught is people
> are trying to get hooks to work with CoreOS. You are not allowed to
> write to /usr/share... on CoreOS, so they wanted podman to also look
> at /etc, where users and third parties can write.

But we'd also been disabling hooks completely for rootless users.  And
even for root users, the override logic was tricky when folks actually
had content in both directories.  For example, if you wanted to
disable a hook from the default directory, you'd have to add a no-op
hook to the override directory.

Also, the previous implementation failed to handle the case where
there hooks defined in the override directory but the default
directory did not exist:

  $ podman version
  Version:       0.11.2-dev
  Go Version:    go1.10.3
  Git Commit:    "6df7409cb5a41c710164c42ed35e33b28f3f7214"
  Built:         Sun Dec  2 21:30:06 2018
  OS/Arch:       linux/amd64
  $ ls -l /etc/containers/oci/hooks.d/test.json
  -rw-r--r--. 1 root root 184 Dec  2 16:27 /etc/containers/oci/hooks.d/test.json
  $ podman --log-level=debug run --rm docker.io/library/alpine echo 'successful container' 2>&1 | grep -i hook
  time="2018-12-02T21:31:19-08:00" level=debug msg="reading hooks from /usr/share/containers/oci/hooks.d"
  time="2018-12-02T21:31:19-08:00" level=warning msg="failed to load hooks: {}%!(EXTRA *os.PathError=open /usr/share/containers/oci/hooks.d: no such file or directory)"

With this commit:

  $ podman --log-level=debug run --rm docker.io/library/alpine echo 'successful container' 2>&1 | grep -i hook
  time="2018-12-02T21:33:07-08:00" level=debug msg="reading hooks from /usr/share/containers/oci/hooks.d"
  time="2018-12-02T21:33:07-08:00" level=debug msg="reading hooks from /etc/containers/oci/hooks.d"
  time="2018-12-02T21:33:07-08:00" level=debug msg="added hook /etc/containers/oci/hooks.d/test.json"
  time="2018-12-02T21:33:07-08:00" level=debug msg="hook test.json matched; adding to stages [prestart]"
  time="2018-12-02T21:33:07-08:00" level=warning msg="implicit hook directories are deprecated; set --hooks-dir="/etc/containers/oci/hooks.d" explicitly to continue to load hooks from this directory"
  time="2018-12-02T21:33:07-08:00" level=error msg="container create failed: container_linux.go:336: starting container process caused "process_linux.go:399: container init caused \"process_linux.go:382: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: oh, noes!\\\\n\\\"\""

(I'd setup the hook to error out).  You can see that it's silenly
ignoring the ENOENT for /usr/share/containers/oci/hooks.d and
continuing on to load hooks from /etc/containers/oci/hooks.d.

When it loads the hook, it also logs a warning-level message
suggesting that callers explicitly configure their hook directories.
That will help consumers migrate, so we can drop the implicit hook
directories in some future release.  When folks *do* explicitly
configure hook directories (via the newly-public --hooks-dir and
hooks_dir options), we error out if they're missing:

  $ podman --hooks-dir /does/not/exist run --rm docker.io/library/alpine echo 'successful container'
  error setting up OCI Hooks: open /does/not/exist: no such file or directory

I've dropped the trailing "path" from the old, hidden --hooks-dir-path
and hooks_dir_path because I think "dir(ectory)" is already enough
context for "we expect a path argument".  I consider this name change
non-breaking because the old forms were undocumented.

Coming back to rootless users, I've enabled hooks now.  I expect they
were previously disabled because users had no way to avoid
/usr/share/containers/oci/hooks.d which might contain hooks that
required root permissions.  But now rootless users will have to
explicitly configure hook directories, and since their default config
is from ~/.config/containers/libpod.conf, it's a misconfiguration if
it contains hooks_dir entries which point at directories with hooks
that require root access.  We error out so they can fix their
libpod.conf.

[1]: https://github.com/containers/libpod/pull/1487#discussion_r218149355

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-12-03 12:54:30 -08:00
baude 318bf7017b podman pod exists
like containers and images, users would benefit from being able to check
if a pod exists in local storage.  if the pod exists, the return code is 0.
if the pod does not exists, the return code is 1.  Any other return code
indicates a real errors, such as permissions or runtime.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-03 12:00:18 -06:00
OpenShift Merge Robot b504623a11
Merge pull request #1317 from rhatdan/privileged
Disable mount options when running --privileged
2018-11-30 11:09:51 -08:00
baude 82bcef3895 add pod short option to ps
podman ps has a flag --pod; simply adding a short option of -p

Signed-off-by: baude <bbaude@redhat.com>
2018-11-30 09:15:11 -06:00
OpenShift Merge Robot effd63d6d5
Merge pull request #1848 from adrianreber/master
Add tcp-established to checkpoint/restore
2018-11-28 07:00:24 -08:00
Daniel J Walsh 3beacb73bc
Disable mount options when running --privileged
We now default to setting storage options to "nodev", when running
privileged containers, we need to turn this off so the processes can
manipulate the image.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-11-28 07:53:28 -05:00
Giuseppe Scrivano 95f22a2ca0
network: allow slirp4netns mode also for root containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 09:21:59 +01:00
Adrian Reber af7d67771b
Add '--tcp-established' to checkpoint/restore man page
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
baude 9d883d2032 add podman container|image exists
Add an exists subcommand to podman container and podman image that allows
users to verify the existence of a container or image by ID or name.  The return
code can be 0 (success), 1 (failed to find), or 125 (failed to work with runtime).

Issue #1845

Signed-off-by: baude <bbaude@redhat.com>
2018-11-26 09:19:39 -06:00
OpenShift Merge Robot e3ece3bb90
Merge pull request #1860 from TomasTomecek/version-add-format
implement --format for version command
2018-11-25 04:52:38 -08:00
Tomas Tomecek 43c20d0200 implement --format for version command
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2018-11-25 12:42:05 +01:00
Steve Phillips 22d971cd75
podman_tutorial.md typos: arguement -> argument; missing 'a'
Signed-off-by: Steve Phillips <steve@tryingtobeawesome.com>
2018-11-24 16:08:58 -08:00
OpenShift Merge Robot 1fdfeb8710
Merge pull request #1835 from adrianreber/master
Added option to keep container running after checkpointing
2018-11-21 05:11:12 -08:00
Adrian Reber 24c0739453
Update checkpoint/restore man pages
This adds the '--leave-running, -R' to the container-checkpoint man
page. As the information for '--all, -a' and '--latest, -l' was also
still missing it is included in this commit.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-20 17:25:44 +01:00
baude 690c52a113 Allow users to expose ports from the pod to the host
we need to allow users to expose ports to the host for the purposes
of networking, like a webserver.  the port exposure must be done at
the time the pod is created.

strictly speaking, the port exposure occurs on the infra container.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-20 09:49:34 -06:00
OpenShift Merge Robot 7965716c74
Merge pull request #1803 from QiWang19/issuebuildah1051
Add space between num & unit in images output
2018-11-12 13:33:28 -08:00
Qi Wang b6fabf1d21 Add space between num & unit in images output
Signed-off-by: Qi Wang <qiwan@redhat.com>
2018-11-12 14:06:31 -05:00
OpenShift Merge Robot d2f2c56aaa
Merge pull request #1794 from jmtd/patch-1
remove $-prefix from (most) shell examples
2018-11-12 09:34:45 -08:00
OpenShift Merge Robot 87668f10c1
Merge pull request #1799 from xakraz/fixes/doc_containers
docs: Fix duplicated entry for pod-container-unmount
2018-11-12 07:52:05 -08:00