Commit Graph

560 Commits

Author SHA1 Message Date
fd3a8adfe2 Merge pull request #30754 from yongtang/25696-stop-signal
Add `--stop-signal` for `service create` and `service update`
Upstream-commit: decce9cad1
Component: cli
2017-03-01 18:10:57 +01:00
c367119f5f Merge pull request #31124 from vdemeester/volume-unit-tests
Add unit tests to cli/command/volume package
Upstream-commit: 04d124ff1b
Component: cli
2017-03-01 14:13:47 +01:00
f87541dc93 Merge pull request #31290 from thaJeztah/print-d_type_warning
add d_type warning to docker info, and optimize output
Upstream-commit: 59f2b071df
Component: cli
2017-02-28 16:35:00 +01:00
7e228fcaaf Add unit tests to cli/command/volume package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 407d65df9d
Component: cli
2017-02-27 18:39:35 +01:00
a6a721cf4e Merge pull request #30383 from TDAbboud/30096-add-host-docker-build
Add --add-host for docker build
Upstream-commit: 7665cb52dc
Component: cli
2017-02-27 12:42:18 +01:00
f341d1bde4 Merge pull request #31212 from fate-grand-order/fixed
use t.Fatal() to output the err message and fix typo
Upstream-commit: 76b6faa13d
Component: cli
2017-02-27 12:26:35 +09:00
f51c729cfc Fixed typo.
Signed-off-by: Genki Takiuchi <genki@s21g.com>
Upstream-commit: 5a53ae5170
Component: cli
2017-02-26 12:59:18 +09:00
b6d88b7b92 add d_type warning to docker info, and optimize output
The overlay(2) drivers were moved up in the list of storage drivers,
and are known to have problems if the backing filesystem does not
support d_type.

Commit 2e20e63da2a8a0ffbbb3f2146f87559e17f43046 added a warning,
which is logged in the daemon logs, however, many users do not
check those logs, and may overlook this warning.

This patch adds the same warning to the output of `docker info`
so that the warning is more easily found.

In addition, the output of warnings printed by `docker info` is
optimized, by;

- moving all warnings to the _end_ of the output, instead of
  mixing them with the regular output
- wrapping the storage-driver warnings, so that they are more
  easily readable

Example output with this patch applied
============================================

devicemapper using loopback devices:

    ...
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false

    WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
             Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
    WARNING: bridge-nf-call-iptables is disabled
    WARNING: bridge-nf-call-ip6tables is disabled

overlay2 on xfs without d_type support;

    ...
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false

    WARNING: overlay2: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.
             Reformat the filesystem with ftype=1 to enable d_type support.
             Running without d_type support will not be supported in future releases.
    WARNING: bridge-nf-call-iptables is disabled

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b09aa604c8
Component: cli
2017-02-23 13:36:57 +01:00
1195f9c5ee Delete dots to align with other commands description
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
Upstream-commit: 5b67f20a91
Component: cli
2017-02-23 16:46:08 +08:00
5145dfe136 use t.Fatal() to output the err message where the values used for formatting
text does not appear to contain a placeholder

Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>
Upstream-commit: 98c222239e
Component: cli
2017-02-23 10:16:22 +08:00
e1a9ffba6b Add --stop-signal for service create and service update
This fix tries to address the issue raised in 25696 where
it was not possible to specify `--stop-signal` for `docker service create`
and `docker service update`, in order to use special signal to stop
the container.

This fix adds `--stop-signal` and update the `StopSignal` in `Config`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 25696.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9037f77d31
Component: cli
2017-02-21 15:19:45 -08:00
19b5092756 Merge pull request #31206 from xuzhenglun/master
fix wrong print format
Upstream-commit: adcf82c65a
Component: cli
2017-02-21 14:13:32 -08:00
b7afa18df2 fix wrong print format
Signed-off-by: Reficul <xuzhenglun@gmail.com>
Upstream-commit: a77cf51173
Component: cli
2017-02-21 10:26:06 +08:00
8daaeb5db9 Merge pull request #30814 from YuPengZTE/devSwarmCliExplain
fix the type
Upstream-commit: 0eacd8a363
Component: cli
2017-02-21 00:59:58 +01:00
4b398302d7 Add --add-host for docker build
Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: e66e519e8d
Component: cli
2017-02-20 17:32:28 -05:00
d7f5ca1d45 add missing API changes
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: e858f5f7c4
Component: cli
2017-02-19 01:33:43 -08:00
d296e1a385 Merge pull request #28213 from yongtang/11062016-service-ps-format
Add `--format` to `docker service ps`
Upstream-commit: 91da14c343
Component: cli
2017-02-17 10:23:18 -08:00
0f240849ec Merge pull request #31114 from allencloud/split-compose-stack-deploy-from-deploydotgo
split compose deploy from deploy.go
Upstream-commit: cd904a5294
Component: cli
2017-02-17 08:48:51 -08:00
5dcfa95c07 Merge pull request #30848 from nishanttotla/suppress-digest-docker-ps
Suppressing image digest in docker ps
Upstream-commit: 798ed3eb6c
Component: cli
2017-02-17 10:27:49 +01:00
00c0b3590a split compose deploy from deploy.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 16b1631594
Component: cli
2017-02-17 17:13:31 +08:00
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
9ca4d7a35c Suppressing image digest in docker ps
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 9e78c9b063
Component: cli
2017-02-16 18:11:56 -08: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
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
193f92812e fix the type
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
Upstream-commit: 03aed78d68
Component: cli
2017-02-14 09:54: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
060813f997 Add --format to docker service ps
This fix tries to address the issue raised in 27189 where
it is not possible to support configured formatting stored in
config.json.

Since `--format` was not supported in `docker service ps`,
the flag `--format` has also been added in this fix.

This fix
1. Add `--format` to `docker service ps`
2. Add `tasksFormat` to config.json
3. Add `--format` to `docker stack ps`
4. Add `--format` to `docker node ps`

The related docs has been updated.

An integration test has been added.

This fix fixes 27189.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 53bdc98713
Component: cli
2017-02-10 16:53:04 -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
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
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
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
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
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