Commit Graph

679 Commits

Author SHA1 Message Date
ed5a89b79a Merge pull request #31088 from xulike666/make-code-readable-again
Typo fixed and this time I provide my cSpell.json
Upstream-commit: 7377abd9e0
Component: cli
2017-02-16 22:04:27 -05:00
405e82d675 Merge pull request #31006 from vdemeester/30991-secret-mode-in-stack-deploy
Set 0444 as default secret mode in stack deploy
Upstream-commit: 325c8823bc
Component: cli
2017-02-16 20:34:21 -05:00
6fa6de6703 why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: ca2aeb5a3e
Component: cli
2017-02-17 00:32:48 +08:00
c0bbf0e6a7 Sort docker stack ls by name
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ddae8d967b
Component: cli
2017-02-16 14:30:39 +01:00
d2654dd0cc Set 0444 as default secret mode in stack deploy
Change the default secret mode to match the default one used in
`service` subcommands.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 645f6ba7f5
Component: cli
2017-02-16 11:26:05 +01:00
8a6ea28359 Merge pull request #29819 from vdemeester/service-validate-publish-simple-syntax
Make sure we validate simple syntax on service commands
Upstream-commit: 1de08ac417
Component: cli
2017-02-15 12:31:46 -08:00
200980812d fix docker stack volume's nocopy parameter
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
Upstream-commit: 6887337d86
Component: cli
2017-02-15 19:46:27 +08:00
a693b1f09e Merge pull request #30900 from YuPengZTE/devPublisedPort
Add "=" before the value of PublishedPort
Upstream-commit: 6cae9ce20b
Component: cli
2017-02-12 21:56:43 +01:00
bfe71dc0ac Merge pull request #30476 from yongtang/30447-port-config-long-syntax
Support expanded syntax of ports in `docker stack deploy`
Upstream-commit: ad5f8089c2
Component: cli
2017-02-11 11:13:54 -08:00
9ac6e27b96 Add = before the value of PublishedPort
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
Upstream-commit: 04bea16969
Component: cli
2017-02-10 14:53:18 +08:00
b9c1f91e08 print 'worker' join token after swarm init
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 9e940b9020
Component: cli
2017-02-09 14:54:05 -08:00
5d377f6184 Merge pull request #30776 from WeiZhang555/stats-all-format-name-panic-cli
Fix panic of "docker stats --format {{.Name}} --all"
Upstream-commit: 487c3488fe
Component: cli
2017-02-08 11:40:06 -08:00
ee6a54e8c3 Fix panic of "docker stats --format {{.Name}} --all"
This commit fixes panic when execute stats command:

* use --format {{.Name}} with --all when there're exited containers.
* use --format {{.Name}} while stating exited container.

The root cause is when stating an exited container, the result from the
api didn't contain the Name and ID field, which will make format
process panic.

Panic log is like this:

```
panic: runtime error: slice bounds out of range [recovered]
	panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0xb20f80, 0xc420014110)
	/usr/local/go/src/runtime/panic.go:500 +0x1a1
text/template.errRecover(0xc4201773e8)
	/usr/local/go/src/text/template/exec.go:140 +0x2ad
panic(0xb20f80, 0xc420014110)
	/usr/local/go/src/runtime/panic.go:458 +0x243
github.com/docker/docker/cli/command/formatter.(*containerStatsContext).Name(0xc420430160,
0x0, 0x0)
	/go/src/github.com/docker/docker/cli/command/formatter/stats.go:148
+0x86
reflect.Value.call(0xb9a3a0, 0xc420430160, 0x2213, 0xbe3657, 0x4,
0x11bc9f8, 0x0, 0x0, 0x4d75b3, 0x1198940, ...)
	/usr/local/go/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0xb9a3a0, 0xc420430160, 0x2213, 0x11bc9f8, 0x0, 0x0,
0xc420424028, 0xb, 0xb)
	/usr/local/go/src/reflect/value.go:302 +0xa4
text/template.(*state).evalCall(0xc420177368, 0xb9a3a0, 0xc420430160,
0x16, 0xb9a3a0, 0xc420430160, 0x2213, 0x1178fa0, 0xc4203ea330,
0xc4203de283, ...)
	/usr/local/go/src/text/template/exec.go:658 +0x530
```

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 758383200e
Component: cli
2017-02-08 10:26:52 +08:00
d4d38719f1 Merge pull request #30790 from vdemeester/pr-30602
Carry #30602 : Bump go-units
Upstream-commit: b5a74e23ab
Component: cli
2017-02-08 11:04:22 +09:00
bb64592fc8 Merge pull request #30457 from dmcgowan/distribution-reference-update-2
reference: use distribution reference and remove fork
Upstream-commit: 326583e728
Component: cli
2017-02-07 22:01:25 +01:00
d81f14e15b Bump go-units
To include  https://github.com/docker/go-units/pull/23
Fixes a unit test that fails because of it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6ef0b64945
Component: cli
2017-02-07 21:58:56 +01:00
78cba3d0ad Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 635d686a88
Component: cli
2017-02-07 11:08:37 -08:00
7cfd3076e4 Support expanded ports in Compose loader
This commit adds support for expanded ports in Compose loader,
and add several unit tests for loading expanded port format.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c53471254b
Component: cli
2017-02-07 09:14:56 -08:00
af8335c602 Add expanded port syntax to Compose schema and types.
This commit adds expanded port syntax to Compose schema and types
so that it is possible to have
```
ports:
  - mode: host
    target: 80
    published: 9005
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c69e0f7dd5
Component: cli
2017-02-07 09:12:55 -08:00
5097259d19 Make sure we validate simple syntax on service commands
We ignored errors for simple syntax in `PortOpt` (missed that in the
previous migration of this code). This make sure we don't ignore
`nat.Parse` errors.

Test has been migrate too (errors are not exactly the same as before
though -_-)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6f8f1d20a2
Component: cli
2017-02-07 12:45:47 +01:00
b7b7587759 Merge pull request #30749 from yongtang/28005-docker-stats-header-windows
Fix Windows `docker stats` showing Linux headers
Upstream-commit: 6d194cd68d
Component: cli
2017-02-06 14:09:23 -08:00
c09e34c27e Merge pull request #30742 from yongtang/29975-compose-network-attachable
Add compose support of `attachable` in networks
Upstream-commit: a4cd8a978f
Component: cli
2017-02-06 12:27:44 -08:00
f84f745895 Merge pull request #30769 from tianon/prompt-for-confirmation
Fix "command.PromptForConfirmation" to accept "enter" for the "N" default
Upstream-commit: 3fd87661c7
Component: cli
2017-02-06 11:44:45 -08:00
b7dbd9db5d Fix "command.PromptForConfirmation" to accept "enter" for the "N" default
This adjusts `command.PromptForConfirmation` in `cli/command/utils.go` to use `bufio`'s `ReadLine` rather than using `fmt.Fscan` for reading input, which makes `<Enter>` properly accept the default value of "No" as one would expect.

This new code actually came from `cli/command/plugin/install.go`'s `acceptPrivileges` function, which I've also refactored here to use `command.PromptForConfirmation` as it should.

Additionally, this updates `cli/command/plugin/upgrade.go`'s `runUpgrade` function to use `command.PromptForConfirmation` for further consistency.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 21c0b6c0e6
Component: cli
2017-02-06 09:13:07 -08:00
3a4832fb11 Fix Windows docker stats showing Linux headers
This fix is an attempt to fix issue raised in #28005 where
`docker stats` on Windows shows Linux headers if there is
no containers in stats.

The reason for the issue is that, in case there is no container,
a header is faked in:
https://github.com/docker/docker/blob/v1.13.0/cli/command/formatter/formatter.go#L74-L78
which does not know OS type information (as OS was stored with container stat entries)

This fix tries to fix the issue by moving OS type information
to stats context (instead of individual container stats entry).

Additional unit tests have been added.

This fix fixes #28005.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: af80020ef2
Component: cli
2017-02-05 08:55:30 -08:00
857a9c8722 Add compose support of attachable in networks
This fix tries to address the issue raised in 29975 where
it was not possible to specify `attachable` flag for networks
in compose format.

NOTE: Compose format aleady supports `labels` in networks.

This fix adds the support of `attachable` for compose v3.1 format.

Additiona unit tests have been updated and added.

This fix fixes 29975.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1a677699ae
Component: cli
2017-02-04 14:16:06 -08:00
d73850cfbf Merge pull request #28751 from ijc25/wrap-help-output
Wrap CLI --help output to terminal width
Upstream-commit: bba31c3f04
Component: cli
2017-02-03 23:04:11 -08:00
1ecc83f981 Add docker plugin upgrade
This allows a plugin to be upgraded without requiring to
uninstall/reinstall a plugin.
Since plugin resources (e.g. volumes) are tied to a plugin ID, this is
important to ensure resources aren't lost.

The plugin must be disabled while upgrading (errors out if enabled).
This does not add any convenience flags for automatically
disabling/re-enabling the plugin during before/after upgrade.

Since an upgrade may change requested permissions, the user is required
to accept permissions just like `docker plugin install`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d98ab3d3ab
Component: cli
2017-02-03 16:21:12 -05:00
7b7e8e4da1 Wrap output of docker cli --help
This should go some way to unblocking a solution to #18797, #18385 etc by
removing the current rather restrictive constraints on help text length.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Upstream-commit: 2469463a22
Component: cli
2017-02-03 11:05:49 +00:00
4f11f6fb59 Merge pull request #30180 from allencloud/add-endpoint-mode-a-default-value
add endpoint mode a default value
Upstream-commit: 9f3d30afe3
Component: cli
2017-02-02 11:51:44 -08:00
1c35c6a82f Merge pull request #28199 from yongtang/11062016-service-ls-format
Add `--format` to `docker service ls`
Upstream-commit: 16c1a50ddf
Component: cli
2017-02-02 10:40:04 +01:00
4f8232c350 Merge pull request #30203 from allencloud/validate-healthcheck-params-in-daemon-side
validate healthcheck params in daemon side
Upstream-commit: 1ce67df34e
Component: cli
2017-02-01 21:19:30 -05:00
0fe55a8f05 Merge pull request #29747 from xlgao-zju/break-the-for
exit collect when we get EOF
Upstream-commit: 2454afb121
Component: cli
2017-02-01 22:29:18 +01:00
c340c8f767 Add --format to docker service ls
This fix tries to improve the display of `docker service ls`
and adds `--format` flag to `docker service ls`.

In addition to `--format` flag, several other improvement:
1. Updates `docker stacks service`.
2. Adds `servicesFormat` to config file.

Related docs has been updated.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 31fb756bb6
Component: cli
2017-02-01 08:33:19 -08:00
8d883b5e67 Merge pull request #29692 from yongtang/29492-daemon-shm-size
Add daemon option `--default-shm-size`
Upstream-commit: cb8723543e
Component: cli
2017-02-01 16:56:10 +01:00
042d091899 Merge pull request #28627 from yongtang/28624-docker-plugin-ls
Add `--filter enabled=true` for `docker plugin ls`
Upstream-commit: 8efe4cea80
Component: cli
2017-02-01 16:52:00 +01:00
b090b514cd Merge pull request #22563 from mlaventure/cgroup-devices
Allow adding rules to cgroup devices.allow on container create/run
Upstream-commit: 77467608bd
Component: cli
2017-02-01 16:29:34 +01:00
d08c0b0b1c Merge pull request #30506 from vdemeester/29732-follow-up-compose-indempotent
Make docker stack deploy a little bit more indempotent
Upstream-commit: 7b5071b028
Component: cli
2017-01-31 13:35:04 -08:00
7812d9088a Merge pull request #30162 from yongtang/29972-service-read-only
Add `--read-only` for `service create` and `service update`
Upstream-commit: 7ed541d8bd
Component: cli
2017-01-31 13:20:00 -08:00
8f6cebdec9 Merge pull request #30411 from thaJeztah/fix-build-from-local-github-directories
do not ignore local build-contexts starting with "github.com"
Upstream-commit: 543c88bb33
Component: cli
2017-01-31 12:45:11 -08:00
c312097e9d Merge pull request #30521 from dnephin/cleanup-compose-loader
`cli/compose` cleanup - remove the old loading system
Upstream-commit: 94958362a1
Component: cli
2017-01-30 13:55:23 -08:00
9bdd0ca52f Add --read-only for service create and service update
This fix tries to address the issue raised in 29972 where
it was not possible to specify `--read-only` for `docker service create`
and `docker service update`, in order to have the container's root file
system to be read only.

This fix adds `--read-only` and update the `ReadonlyRootfs` in `HostConfig`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 29972.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: b849aa6b95
Component: cli
2017-01-30 12:47:26 -08:00
41c8dfca13 Merge pull request #30186 from thaJeztah/add-version-annotation-to-flags
Add version annotation to various flags added in 1.13
Upstream-commit: 2e02d615c4
Component: cli
2017-01-30 12:33:36 -08:00
2874513efc validate healthcheck params in daemon side
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 406c6348b6
Component: cli
2017-01-29 13:35:32 +08:00
c3e631a485 remove cli/command/secrets/utils.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: ca1e5ffeea
Component: cli
2017-01-29 13:32:49 +08:00
43d29b1590 add endpoint mode a default value
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 67db25f42e
Component: cli
2017-01-28 20:46:34 +08:00
d1dc107dc1 Remove the old loading system from compose config loading
The original Compose config loading used the `compose` tag, which
was replaced by mapstructure. Some fields were left on the old tag. This
commit removes the old tag and uses types and mapstructure.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 1eefdba226
Component: cli
2017-01-27 17:03:41 -05:00
60b21e3b0e Merge pull request #29218 from yongtang/28884-secret-inspect-follow-up
Move secret name or ID prefix resolving from client to daemon
Upstream-commit: 53edcd37a2
Component: cli
2017-01-27 13:31:04 -08:00
6300064c81 Update opts.MemBytes to disable default, and move docker run/create/build to use opts.MemBytes
This fix made several updates:
1. Update opts.MemBytes so that default value will not show up.
   The reason is that in case a default value is decided by daemon,
   instead of client, we actually want to not show default value.
2. Move `docker run/create/build` to use opts.MemBytes for `--shm-size`
   This is to bring consistency between daemon and docker run
3. docs updates.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: f75ecc5ad2
Component: cli
2017-01-27 12:17:06 -08:00
e94be9a069 Add daemon option --default-shm-size
This fix fixes issue raised in 29492 where it was not
possible to specify a default `--default-shm-size` in daemon
configuration for each `docker run``.

The flag `--default-shm-size` which is reloadable, has been
added to the daemon configuation.
Related docs has been updated.

This fix fixes 29492.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ab794c5579
Component: cli
2017-01-27 12:17:06 -08:00