Commit graph

148 commits

Author SHA1 Message Date
Matthew Heon 49e696642d Add --storage flag to 'podman rm' (local only)
This flag switches to removing containers directly from c/storage
and is mostly used to remove orphan containers.

It's a superior solution to our former one, which attempted
removal from storage under certain circumstances and could, under
some conditions, not trigger.

Also contains the beginning of support for storage in `ps` but
wiring that in is going to be a much bigger pain.

Fixes #3329.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-13 17:02:20 -04:00
Matthew Heon f909b745ec Add --filename option to generate kube
This allows writing output directly to a file, instead of STDOUT.
Makes things easier for some scripting tasks. Like the unit tests
for 'play kube'.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-11 11:26:46 -04:00
Adrian Reber bef83c42ea
migration: add possibility to restore a container with a new name
The option to restore a container from an external checkpoint archive
(podman container restore -i /tmp/checkpoint.tar.gz) restores a
container with the same name and same ID as id had before checkpointing.

This commit adds the option '--name,-n' to 'podman container restore'.
With this option the restored container gets the name specified after
'--name,-n' and a new ID. This way it is possible to restore one
container multiple times.

If a container is restored with a new name Podman will not try to
request the same IP address for the container as it had during
checkpointing. This implicitly assumes that if a container is restored
from a checkpoint archive with a different name, that it will be
restored multiple times and restoring a container multiple times with
the same IP address will fail as each IP address can only be used once.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-06-04 14:02:51 +02:00
Adrian Reber 7b1ab8a0f4
Added bash completion for container migration
Signed-off-by: Adrian Reber <areber@redhat.com>
2019-06-03 22:05:13 +02:00
Matthew Heon 32fc6b906c Add --pause to podman cp manpage and bash completions
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-29 22:53:51 -04:00
OpenShift Merge Robot 8422503f43
Merge pull request #3221 from josegonzalez/master
Add missing 'container cp' alias and document missing 'container update' command
2019-05-29 20:46:09 +02:00
Jose Diaz-Gonzalez 635c161f38 add missing container cp command
'docker cp' is an alias for 'docker container cp', and podman should have the equivalent alias.

Signed-off-by: Jose Diaz-Gonzalez <email@josediazgonzalez.com>
2019-05-29 12:44:25 -04:00
Peter Hunt f61fa28d39 Added --log-driver and journald logging
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-05-28 11:10:57 -04:00
Peter Hunt 18d7fcb5eb Update completions and docs to use k8s file as log driver
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-05-28 11:10:57 -04:00
Daniel J Walsh baed81029b
Fixup Flags
Mark hidden all references to signature-policy
Default all uses of --authfile
Add --authfile support to podman run and podman create.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-05-20 13:53:32 -04:00
baude c18ad2bfd9 Generate systemd unit files for containers
the podman generate systemd command will generate a systemd unit file
based on the attributes of an existing container and user inputs.  the
command outputs the unit file to stdout for the user to copy or
redirect.  it is enabled for the remote client as well.

users can set a restart policy as well as define a stop timeout
override for the container.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-02 14:35:53 -05:00
Matthew Heon 0b2c9c2acc Add basic structure of podman init command
As part of this, rework the number of workers used by various
Podman tasks to match original behavior - need an explicit
fallthrough in the switch statement for that block to work as
expected.

Also, trivial change to Podman cleanup to work on initialized
containers - we need to reset to a different state after cleaning
up the OCI runtime.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-01 11:12:24 -04:00
James Cassell 354d80626a auto pass http_proxy into container
Signed-off-by: James Cassell <code@james.cassell.me>
2019-04-30 17:29:29 -04:00
Daniel J Walsh 3a4be4b66c
Add --read-only-tmpfs options
The --read-only-tmpfs option caused podman to mount tmpfs on /run, /tmp, /var/tmp
if the container is running int read-only mode.

The default is true, so you would need to execute a command like

--read-only --read-only-tmpfs=false to turn off this behaviour.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-04-26 12:29:10 -04:00
Peter Hunt 0b34b4a59c Add podman pod prune
podman system prune would leave pods be, and not prune them if they were stopped.
Fix this by adding a `podman pod prune` command that prunes stopped pods similarly to containers.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-04-16 11:23:18 -04:00
Ed Santiago a07b2c2c60 (minor): fix misspelled 'Healthcheck'
Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-04-10 09:43:56 -06:00
baude 3423c5a8c9 Add watch mode to podman ps
allows users to "watch" the output of podman ps on a set interval in
seconds. in watch mode, the screen is cleared between intervals as well.

podman -ps -w1 watches on 1 second intervals

Signed-off-by: baude <bbaude@redhat.com>
2019-03-28 08:34:27 -05:00
Matthew Heon 323dc526ce Add manpages and completions for dns=none and no-hosts
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-27 10:12:18 -04:00
Qi Wang 25e0f87069 system df to show podman disk usage
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-25 15:05:26 -04: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
Ed Santiago 6aa8078cc1 zsh completion
Weekend hack by someone who doesn't grok zsh completion
but who finds it deeply offensive that most completion
files have an unmaintainable duplication of options
and arguments. The idea behind this one is to discover
the command line using --help, with a few hardcoded
helpers for discovering containers, images, pods,
and figuring out which args take files/dirs as args.

Working remarkably well. I am using this in my daily
routine and wondering how I ever managed without it.
It's not perfect -- a future version can perhaps
show only stopped containers for podman rm, only
running ones for podman stop -- but ROI seems low
on that given my limited zsh completion skills.

Sadly, I can't figure out how to write a regression
test suite for this. It would be lovely to have a
list if partial command lines and expected completions,
because the history of this change is that (seemingly)
minor tweaks in one place cause breakage in another.
Does anyone know of such a framework?

Still... working well enough to ship, IMO.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 16:40:07 -06: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
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 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
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
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
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
Valentin Rothberg 4d72b9c3df completions: add --pod to run/create
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-13 19:04:28 +01: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
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 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
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
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
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
Daniel J Walsh 0c26aec2ae
Fix completions
Currently completions do not work.  podman generate kube and podman play kube
completions broke this.

Also fixed podman import to work properly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-03 11:57:55 -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
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
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
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
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