Commit Graph

135 Commits

Author SHA1 Message Date
c7f7b0b0c5 Add support for memory reservation
Signed-off-by: qhuang <qhuang@10.0.2.15>
Upstream-commit: d5b1d055b8
Component: cli
2017-06-02 00:07:10 +00:00
e4e2ea0cbd Docs: correct the description of docker cp
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 9ec9856889
Component: cli
2017-06-02 00:07:10 +00:00
f67f9bd91a Catchup missing changes for the zsh completion
- felixr/docker-zsh-completion@6ae6279: Add --privileged flag to docker exec command in zsh completion
 - felixr/docker-zsh-completion@259ea00: Remove -h help flag from subcommands in zsh completion
 - felixr/docker-zsh-completion@5f77b29: Add docker ps --format flag to zsh completion
 - felixr/docker-zsh-completion@a1f39f8: Add --config flag to zsh completion
 - felixr/docker-zsh-completion@6a503b4: Filter zsh completions of inspect command by --type
 - felixr/docker-zsh-completion@d286ccd: Add --ulimit flag to build command to zsh completion
 - felixr/docker-zsh-completion@bdc1261: Add support for kernel memory limit in zsh completion
 - felixr/docker-zsh-completion@c8ce164: Add docker volume command and subcommands in zsh completion
 - felixr/docker-zsh-completion@7f996bf: Add docker daemon command to zsh completion
 - felixr/docker-zsh-completion@4ccd292: Be more generic when parsing "docker ps" output.
 - felixr/docker-zsh-completion@cd0f1b9: Fix container completion by name
 - felixr/docker-zsh-completion@8bf9041: Use "docker ps --no-trunc" to build completion.
 - felixr/docker-zsh-completion@b721bbb: Only keep the last name for a running/stopped container
 - felixr/docker-zsh-completion@6791b3e: Fix "docker run --stop-signal" completion
 - felixr/docker-zsh-completion@961f628: Try some heuristics to determine the canonical container name

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
Upstream-commit: 65c5e2b950
Component: cli
2017-06-02 00:07:10 +00:00
5c93fb306b Bash completion: avoid 'compopt: command not found' errors on Mac OS
The shell builtin `compopt` is not available on the outdated bash
version 3.2.57 that ships with Mac OS.
It is used in Docker's bash completion to suppress trailing spaces
in advanced completions of hash map options, e.g. `--log-opt`.

If `compopt` is not available, the new behavior is to do nothing,
i.e. the user will have to delete the additional space.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 7310f4a2bd
Component: cli
2017-06-02 00:07:10 +00:00
e0b0bc40ce bash completion: use generic tag log driver option
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: eb684d2bad
Component: cli
2017-06-02 00:07:09 +00:00
85e27f63c7 docker restarts running OR stopped containers, docs edit rm "running"
Signed-off-by: Sally O'Malley <somalley@redhat.com>
Upstream-commit: fac1158156
Component: cli
2017-06-02 00:07:09 +00:00
8a794fe86d Add support for DNS options
Signed-off-by: Tim Hockin <thockin@google.com>
Upstream-commit: 8bdf17d8fe
Component: cli
2017-06-02 00:07:09 +00:00
e19ee5c257 Fix bash completion when extglob is not set
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: f5eb62c180
Component: cli
2017-06-02 00:07:09 +00:00
a522975349 Signal to stop a container.
Allow to set the signal to stop a container in `docker run`:
- Use `--stop-signal` with docker-run to set the default signal the container will use to exit.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 36a36bdaf5
Component: cli
2017-06-02 00:07:08 +00:00
1ef4dd2a6c Add awslogs driver for Amazon CloudWatch Logs
Signed-off-by: Samuel Karp <skarp@amazon.com>
Upstream-commit: 0d2d916b13
Component: cli
2017-06-02 00:07:08 +00:00
aef04c70b9 bash completion for docker volume
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 6c98ca574f
Component: cli
2017-06-02 00:07:08 +00:00
5c0a31aa05 Add docker ps --filter=… image completion
I missed that on #15919, thanks @albers

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 1cf99bf127
Component: cli
2017-06-02 00:07:07 +00:00
14dfc30977 Update shell completion on docker ps for ancestor
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8387eacede
Component: cli
2017-06-02 00:07:07 +00:00
a302fd9a45 Change all optional unit to [unit]
As suggested before, we should change every signal one.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: b243bbed9c
Component: cli
2017-06-02 00:07:07 +00:00
7528eacd46 Make run and rmi bash completions configurable
Allow the user to configure how Docker's bash completion works for the
"events", "history", "inspect", "run", "rmi" and "save" commands through the
following environment variables:

DOCKER_COMPLETION_SHOW_IMAGE_IDS
  "none" - Show names only (default)
  "non-intermediate" - Show names and ids, but omit intermediate image IDs
  "all" - Show names and ids, including intermediate image IDs

DOCKER_COMPLETION_SHOW_TAGS
  "yes" - include tags in completion options (default)
  "no"  - don't include tags in completion options

Fixes #9474.

Signed-off-by: Rory Hunter <roryhunter2@gmail.com>
Upstream-commit: e7d0fd2b23
Component: cli
2017-06-02 00:07:06 +00:00
1386a1809c Add support for kernel memory limit
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 5731775665
Component: cli
2017-06-02 00:07:06 +00:00
20d188cf61 Fix bash completion for log driver options
This option was incorrectly ported to the new `daemon` subcommand
structure.

Beside the obvious effect that completion of `docker daemon --log-opt`
did not work, this also caused completion of `docker` and `docker xxx`
to fail on macs with

> bash: words: bad array subscript

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 8d6fd1542f
Component: cli
2017-06-02 00:07:05 +00:00
229ae40481 Revert "Revert "Add docker exec run a command in privileged mode""
This reverts commit 40b71adee390e9c06471b89ed845132b4ec80177.

Original commit (for which this is effectively a rebased version) is
72a500e9e5929b038816d8bd18d462a19e571c99 and was provided by Lei Jitang
<leijitang@huawei.com>.

Signed-off-by: Tim Dettrick <t.dettrick@uq.edu.au>
Upstream-commit: d0fa83e285
Component: cli
2017-06-02 00:07:05 +00:00
3db9619f22 Add storage options to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: cefc964f4c
Component: cli
2017-06-02 00:07:05 +00:00
ee38886f4e Add options for the json-file logging driver to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 0f17194e5f
Component: cli
2017-06-02 00:07:05 +00:00
1467924768 Update bash completion for docker run
Also fixed sort order of options using `sort -d`

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: a287253ec5
Component: cli
2017-06-02 00:07:05 +00:00
32fd4e2f42 Remove -h flag from completion and daemon reference
All docker subcommands support `-h` as an alias for `--help`
unless they have `-h` aliased to something else like `docker run`,
which uses `-h` for `--hostname`.

`-h` is not included in the help messages of the commands, though.

It ist visible in
* reference: only in `docker daemon` reference,
  see output of `grep -Rse --help=false docs`
* man pages: only in `docker` man page
  see output of `grep -RF '**-h**' man`

For consistency reasons, this commit removes `-h` as an alias for
`--help` from the reference page, man page and the bash completion.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 91300d7db0
Component: cli
2017-06-02 00:07:05 +00:00
b0c12747dd Add missing storage drivers to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 9fafadf6fc
Component: cli
2017-06-02 00:07:05 +00:00
30eef932c8 Add docker ps --format to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: c3bbab15c2
Component: cli
2017-06-02 00:07:05 +00:00
da30fbe58c Add --config to bash completion
The custom configuration will also be used in docker invocations made
by the completion script itself, just like `-H`.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: f3f1340aa0
Component: cli
2017-06-02 00:07:04 +00:00
3851ff8dba Filter completions of docker inspect by --type
Completion now filters the images and containers by given
`--type`.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 57062f2a44
Component: cli
2017-06-02 00:07:04 +00:00
647a177c61 Fix completion of commands after a global option with arg
Without this fix, `docker -l info ` would not complete the commands.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 3de0756fd1
Component: cli
2017-06-02 00:07:04 +00:00
925fae2cca Add completion of global options to docker daemon
It's a bit confusing: the "global options" are valid as "global options"
for all client commands (i.e. all but daemon).
Example: `docker --log-level info run`

For `docker daemon`, these "global options" are only valid as "command
options".
Example: `docker daemon --log-level info`

As command completion cannot tell which command the user is going to
type next, completion for the daemon command has to allow illegal
syntaxes like
`docker --log-level info daemon --log-level info`

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 35e75dc3e7
Component: cli
2017-06-02 00:07:04 +00:00
ecd79f9a49 Add docker daemon to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 48ad74a01c
Component: cli
2017-06-02 00:07:04 +00:00
2bae062cf7 Fix file mode for docker bash completion
A bash completion file shouldn't have a executable bit set.
Just change file mode to 644 (instead of 755).

Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
Upstream-commit: 371f131e2a
Component: cli
2017-06-02 00:07:03 +00:00
e94877f883 Complete all known driver options if no log driver was specified
Without this fix, `docker --log-opt ` would not complete anything
because the completions were driver specific.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 4f3ba975fb
Component: cli
2017-06-02 00:07:03 +00:00
9d8a40e4ad Fix problem with = in completion of docker global options
Without this fix, `docker --log-driver fluentd --log-opt fluentd-tag=b`
would complete `b` to `build`.
Completion of the commands has to be nailed to __docker_pos_first_nonflag

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 763ba5078d
Component: cli
2017-06-02 00:07:03 +00:00
Lei
2d2192c579 Add ulimit to docker build.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: f793c1b50c
Component: cli
2017-06-02 00:07:02 +00:00
738ed44f7d Second level completions for --log-opt
Advanced completion for some log driver options:
gelf-address, syslog-address, syslog-facility.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: ad1ca76a0b
Component: cli
2017-06-02 00:07:02 +00:00
622fdc9393 Completion: Add support for '=' in arguments to __docker_pos_first_nonflag
This solves several problems that arise from the special treatment of
"=" in Bash.
The fix was required as some log drivers have options in a key=value
form. It also addresses the --option=value and the negated boolean syntax
(--boolean=false).

Note that this is not a general fix for these problems, it is limited to
the __docker_pos_first_nonflag function.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: f7eb7787da
Component: cli
2017-06-02 00:07:02 +00:00
d423291b54 Driver-specific completions for --log-opt
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: d3098f54ab
Component: cli
2017-06-02 00:07:02 +00:00
31610116ef Add missing log drivers to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: e00293bec8
Component: cli
2017-06-02 00:07:02 +00:00
ef4e017a4c zsh: update zsh completion for docker command
zsh completion is updated with the content of
felixr/docker-zsh-completion.

 - felixr/docker-zsh-completion@a93e1cb7bd Fix completion of repositories with tags
 - felixr/docker-zsh-completion@590ea70596 Respect provided `--host` flag when invoking docker
 - felixr/docker-zsh-completion@6c557babaa Several cosmetic improvements
 - felixr/docker-zsh-completion@5b63cc591a Update completion for `inspect`
 - felixr/docker-zsh-completion@b7d8f2f7cc Order completions alphabetically
 - felixr/docker-zsh-completion@63f6a06224 Factor completion for `build`, `create` and `run`
 - felixr/docker-zsh-completion@ade49ee47f Enforce positional arguments being last
 - felixr/docker-zsh-completion@850b6b6d95 Update completion for build/commit/export/exec/history/import
 - felixr/docker-zsh-completion@01bfd8c075 Remove completion for `insert` and duplicate of `import`
 - felixr/docker-zsh-completion@c64a1d730a Update completion for `stats` to add `--no-stream` flag
 - felixr/docker-zsh-completion@5e81d78b52 Update completion for `log` to add `--since` flag
 - felixr/docker-zsh-completion@b3c146a1a2 Update completion for `run` to add `--group-add` flag
 - felixr/docker-zsh-completion@8d4f196ad8 Don't trigger expensive completion function for flags
 - felixr/docker-zsh-completion@bd5aaa124d Add completion for `--help` everywhere
 - felixr/docker-zsh-completion@3a67a0e8c4 Return appropriate status code on completion
 - felixr/docker-zsh-completion@4dfcb450ea Add Steve as a regular contributor.
 - felixr/docker-zsh-completion@996a1c6def Add completion for top-level flags
 - felixr/docker-zsh-completion@b6df75905f Ensure short/long option are not allowed twice
 - felixr/docker-zsh-completion@75b6a500a0 Complete repositories with tags only on repository match
 - felixr/docker-zsh-completion@5e6292135f Factorize completion of images/repositories/tags
 - felixr/docker-zsh-completion@1c504eb677 Handle repositories with ":"
 - felixr/docker-zsh-completion@0a05bf818b Update completion for `pause' and `unpause'
 - felixr/docker-zsh-completion@b3a63253e2 Containers name can include Swarm host

In summary:

 - Swarm support
 - Handling repositories with ":"
 - Rework how completion of images/repositories/tags work:
    - felixr/docker-zsh-completion@5e6292135f
    - felixr/docker-zsh-completion@75b6a500a0
    - felixr/docker-zsh-completion@a93e1cb7bd

The remaining changes are here to sync changes done in Docker repository
(mostly from PR #14074 and #14555, by @sdurrheimer). With some minor changes:

 - boolean flags don't complete their arguments (true/false)
 - reuse of `--host` argument is done with `$opt_arg` to avoid parsing
   error
 - build/create/run common options are factorized out
 - `--help` flag is handled differently
 - `pause` and `unpause` accepts several containers as far as I know, so
   the change is reverted
 - some more, but difficult to notice (more completion for some flags I think)

Some labels are reverted, mostly because I did the merge by copy/pasting
new options instead of modifying existing options.

This commit is partial. The way the `--help` option is handled triggered
a major change due to the way things are quoted. Those changes were
partially and programmaticaly reverted in this commit only to minimize
the changes to review. The next commit will restore the full changes.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Upstream-commit: c15fdb2435
Component: cli
2017-06-02 00:07:02 +00:00
2eca0b71ce Several cosmetic improvements in zsh completion
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
Upstream-commit: 66c1b06bc4
Component: cli
2017-06-02 00:07:01 +00:00
e5d2433008 Zsh completion update for the following commits:
- Add fluentd logging driver to zsh completion #12876
- Add inspect --type flag to zsh completion #13187
- Respect -H option in zsh completion #13195
- Fix number of argument limit for pause and unpause in zsh completion

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
Upstream-commit: 31c530fd42
Component: cli
2017-06-02 00:07:01 +00:00
7d2ef56baf zsh: remove Vincent Bernat from reviewers for ZSH completion
Signed-off-by: Vincent Bernat <vincent@bernat.im>
Upstream-commit: 3a6ca4b1d8
Component: cli
2017-06-02 00:07:01 +00:00
b93f7135a0 Adds documentation for additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: 7301088482
Component: cli
2017-06-02 00:07:01 +00:00
6553295dca Add some missing events to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 23256b7438
Component: cli
2017-06-02 00:07:01 +00:00
4aa2c173ed Flag Addition: --type flag added for docker inspect command
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: 24e7d40f42
Component: cli
2017-06-02 00:06:59 +00:00
f7d91b77b4 Update the zsh completion
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
Upstream-commit: becaec720e
Component: cli
2017-06-02 00:06:58 +00:00
b291440ff0 Update bash completion for 1.7.0
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 342d0cd04c
Component: cli
2017-06-02 00:06:56 +00:00
6b897604a6 Revert "Add docker exec run a command in privileged mode"
This reverts commit 72a500e9e5929b038816d8bd18d462a19e571c99.

Signed-off-by: Jessica Frazelle <princess@docker.com>

Conflicts:
	daemon/execdriver/native/exec.go
	integration-cli/docker_cli_exec_test.go
	runconfig/exec.go
Upstream-commit: 05c0da3b96
Component: cli
2017-06-02 00:06:56 +00:00
ea16c04a2a respect -H in bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 9c413dcfc4
Component: cli
2017-06-02 00:06:56 +00:00
4ae6d04e85 root dir for execdriver (/var/run/docker) should be configurable
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: 7defdb0868
Component: cli
2017-06-02 00:06:56 +00:00
62f1457cde Add --since argument to docker logs cmd
Added --since argument to `docker logs` command. Accept unix
timestamps and shows logs only created after the specified date.

Default value is 0 and passing default value or not specifying
the value in the request causes parameter to be ignored (behavior
prior to this change).

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: a92995bc14
Component: cli
2017-06-02 00:06:56 +00:00