Commit graph

2525 commits

Author SHA1 Message Date
Daniel Nephin
6af6a3a538 Move holdHijackConnection to the container package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 12:58:06 -04:00
Daniel Nephin
31d8c27e70 Move container util methods to the container package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 12:38:52 -04:00
Daniel Nephin
bec81075bf Extract input stream into a new type.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 12:34:55 -04:00
Daniel Nephin
a0ab33124a Extract stream output handling to a new type.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 12:33:41 -04:00
Jana Radhakrishnan
99a98ccc14 Add support for docker run in swarm mode overlay
This PR adds support for running regular containers to be connected to
swarm mode multi-host network so that:
    - containers connected to the same network across the cluster can
      discover and connect to each other.
    - Get access to services(and their associated loadbalancers)
      connected to the same network

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 21:20:41 -07:00
Michael Crosby
7c36a1af03 Move engine-api client package
This moves the engine-api client package to `/docker/docker/client`.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00
Michael Crosby
91e197d614 Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00
Aaron Lehmann
86124ca04b Merge pull request #23100 from runcom/fix-stores
support legacy registries in exernal stores
2016-09-07 09:44:41 -07:00
Brian Goff
6168e98a13 Merge pull request #26115 from yongtang/08292016-info-registry-mirrors
Add registry mirrors information in the output of `docker info`
2016-09-07 11:37:36 -04:00
Daniel Nephin
20607e2cc2 Merge pull request #26269 from yuexiao-wang/remove-option
Remove the option for the command service rm
2016-09-07 11:31:11 -04:00
Antonio Murdaca
67d752ac55
support legacy registries in exernal stores
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-09-07 09:45:42 +02:00
Stephen J Day
084ff6dc6d
api/client/node: correct ordering in context argument
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-09-06 17:04:43 -07:00
Vincent Demeester
5c6b54c278 Merge pull request #26282 from mstanleyjones/26280_fix_pretty_print
`docker node inspect <node> --pretty`  needs an extra newline at the end
2016-09-06 16:04:55 +02:00
allencloud
2087f94df5 correct docker volume ls subcommand description
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-06 17:18:41 +08:00
Yong Tang
b9e46235fa Fix incorrect help output in docker network ls
As is raised in 26312, in `docker network ls`, the help output was
mistaken to `volume names`:
```
-q, --quiet Only display volume names
```

This fix changes the help output to:
```
-q, --quiet Only display network IDs
```

This fix also updates the documentation in:
`docs/reference/commandline/network_ls.md`

This fix fixes 26312.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-05 08:24:22 -07:00
Brian Goff
93a8b5c42b Merge pull request #26279 from miaoyq/delete-a-useless-funtion
delete a function which isn't used in the project
2016-09-03 13:36:37 -04:00
Vincent Demeester
c73fae2352 Merge pull request #26290 from tonistiigi/govet17
Fix govet for go1.7
2016-09-03 19:27:19 +02:00
Tonis Tiigi
7a8c7b47cf Fix govet for go1.7
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-02 19:07:54 -07:00
Misty Stanley-Jones
341489f150 'docker node inspect <node> --pretty' needs an extra newline at the end
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-02 11:15:00 -07:00
Yanqiang Miao
81849600fc delete a function which isn't used in the project
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-02 22:54:19 +08:00
yuexiao-wang
1016cbb642 Remove the option for the command service rm
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-09-02 17:23:59 +08:00
Yong Tang
a79a27412d Fix issue in docker import -c with quoted flags
This fix tries to address the issue in 26173 where `docker import -c`
with quoted flags returns an error.

The issue was that in `api/client/image/import.go` the flag
`--change/-c` was handled by `StringSliceVarP` which does not handle
the quote well.

The similiar issue was enountered for 23309 (`docker commit`).

This fix takes the same approach as 23309 where `StringSliceVarP`
was replaced with `VarP` and `opts.ListOpts`.

An integration test has been added to cover the changes.

This fix fixes 26173.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-01 16:28:22 -07:00
Justin Cormack
8ccac1ad4d Merge pull request #26200 from runcom/engine-api-vendor
vendor docker/engine-api@f9cef59044
2016-09-01 10:51:34 +01:00
zhouhao
61c8b3380f Modify rename function usage
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2016-09-01 14:48:02 +08:00
Antonio Murdaca
8f7a8c75ae
vendor docker/engine-api@f9cef59044
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-08-31 22:39:13 +02:00
Vincent Demeester
6ac30e57d0 Merge pull request #26191 from runcom/fix-unknownflag-exit-code
api: client: container: update: fix help text
2016-08-31 21:15:51 +02:00
Antonio Murdaca
c2c2617534
api: client: container: update: fix help text
Before:

$ docker update --cpu-period
Status: flag needs an argument: --cpu-period
See 'docker update --help'., Code: 125

After:

$ docker update --cpu-period
flag needs an argument: --cpu-period
See 'docker update --help'.

Also remove flagErrorFunc function which isn't needed anymore.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-08-31 12:46:40 +02:00
yuexiao-wang
b8af6b579b Miss the options in some commands
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-08-31 14:18:41 +08:00
Arnaud Porterie
ec82819cc9 Merge pull request #26140 from yuexiao-wang/modify-usage
Modify options for the command plugin install
2016-08-31 00:04:45 +00:00
Vincent Demeester
19aee54926 Merge pull request #26145 from allencloud/update-command-description
update command description
2016-08-30 22:16:57 +02:00
Yong Tang
0f6acff796 Add registry mirrors information in the output of docker info
This fix tries to add the registry mirrors information in the output
of `docker info`.

In our active deployment, we use registry mirrors to help speeding
up the `docker pull`. In the current output of `docker info`,
registry mirrors is not present though it is available in `/info` API.

I think it makes sense to add the registry mirrors to `docker info`,
similiar to insecure registries.

This fix adds the registry mirrors to the output of `docker info`:
```
Registry Mirrors:
 https://192.168.1.2/
 http://registry.mirror.com:5000/
```

An integration test has been added to cover the changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-30 09:05:24 -07:00
Anusha Ragunathan
5bd14f88cd Merge pull request #26134 from lixiaobing10051267/masterDockerExec
Modify use of docker exec command in exec.go
2016-08-30 08:27:02 -07:00
allencloud
123ce0e4be update command description
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-30 23:07:42 +08:00
lixiaobing10051267
26bd3e8b11 Modify usage of docker exec command in exec.md
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-08-30 22:14:55 +08:00
yuexiao-wang
d08886618e Modify options for the command plugin install
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-08-30 18:45:06 +08:00
allencloud
b13f5dfd13 make node ps default to self in swarm node
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-30 17:34:16 +08:00
John Howard
c8ce0856b7 Fix golint errors in api
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-29 13:36:16 -07:00
Brian Goff
d09c04a667 Merge pull request #25317 from yongtang/25304-docker-service-create-group
Support `--group` in `docker service create`
2016-08-29 10:27:31 -04:00
Vincent Demeester
bf0077c138 Merge pull request #25990 from vieux/plugin_inspect
add -f to plugin inspect
2016-08-28 17:03:40 +02:00
Cao Weiwei
cdcf7b78fc Fix typo
Signed-off-by: Cao Weiwei <cao.weiwei30@zte.com.cn>
2016-08-28 17:01:22 +08:00
Arnaud Porterie
9ea28ea894 Merge pull request #26055 from mavenugo/ndn
Support container disconnect for non-existing network
2016-08-28 01:48:02 +00:00
Yong Tang
b31969ee36 Support --group-add and --group-rm in docker service create/update
This fix tries to address the issue raised in 25304 to support
`--group-add` and `--group-rm` in `docker service create`.

This fix adds `--group-add` to `docker service create` and `docker service update`,
adds `--group-rm` to `docker service update`.

This fix updates docs for `docker service create` and `docker service update`:
1. Add `--group-add` to `docker service create` and `docker service update`
2. Add `--group-rm` to `docker service update`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-27 11:54:05 -07:00
Madhu Venugopal
05a3f2666e Support container disconnect for non-existing network
There are cases such as migrating from classic overlay network to the
swarm-mode networking (without kv-store), such a mechanism to allow
disconnecting a container even when a network isnt available will be
useful.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-08-26 16:48:52 -07:00
Tibor Vass
ed0dff8f16 Merge pull request #25424 from vieux/enabled
replace active by enabled for consistency in plugins
2016-08-26 15:22:41 -07:00
Alexander Morozov
bdadcfc1bb Merge pull request #25861 from WeiZhang555/wait-remove-for-start
Using waitExitOrRemoved for `docker start`
2016-08-26 13:36:56 -07:00
Vincent Demeester
5168c93419 Merge pull request #23830 from ardnaxelarak/23345_remove_name_from_volume_create
remove --name flag from volume create
2016-08-26 21:52:07 +02:00
Arnaud Porterie
6e85b81df2 Merge pull request #23614 from icecrime/inspect_services
Allow `docker inspect` on all types
2016-08-26 18:45:23 +00:00
Tõnis Tiigi
e875370af8 Merge pull request #25650 from pwzgorilla/master
replace `handleWithGlobalMiddlewares` with `handlerWithGlobalMiddlewa…
2016-08-26 09:51:51 -07:00
mgniu
c5ecf1e6fe change comment
Signed-off-by: mgniu <mgniu@dataman-inc.com>
2016-08-26 18:30:41 +08:00
Victor Vieux
63a19edcb1 add -f to plugin inspect
Signed-off-by: Victor Vieux <vieux@docker.com>

Signed-off-by: Victor Vieux <vieux@docker.com>
2016-08-25 22:40:05 -07:00
Victor Vieux
cf4e268115 replace active by enabled for consistency in plugins
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-08-25 20:42:49 -07:00
Arnaud Porterie (icecrime)
3db9f7afce
Refactor docker inspect to work on all types
Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
2016-08-25 16:29:08 -07:00
Kara Alexandra
ba3f0bf0e7 Add option to specify name without --name in volume create
Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
2016-08-25 14:20:06 -07:00
Daniel Nephin
14712f9ff0 Remove old cli framework.
Also consolidate the leftover packages under cli.
Remove pkg/mflag.
Make manpage generation work with new cobra layout.
Remove remaining mflag and fix tests after rebase with master.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:04 -04:00
Daniel Nephin
31bf9ca0c8 Update unit tests for new cobra root command.
Cleanup cobra integration
Update windows files for cobra and pflags
Cleanup SetupRootcmd, and remove unnecessary SetFlagErrorFunc.
Use cobra command traversal

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:04 -04:00
Daniel Nephin
0452ff5a4d Convert docker root command to use pflag and cobra
Fix the daemon proxy for cobra commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:03 -04:00
Zhang Wei
b8464c1c9b Using waitExitOrRemoved for docker start
Currently start command will invoke getExitCode - which is based on
Inspect API - to get returned exit code after container exits.
There's two race conditions here:

if container is started with Restart Policy, there's chance that the
container is restarted quickly before it calls getExitCode, under such
circumstance, the exit code is wrong.

if container is started with --rm, it's possible that container is
removed before getExitCode, in this situation, you can't get correct
exit code either.

Replace getExitCode with waitExitOrRemoved can solve this problem.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-26 00:16:49 +08:00
Brian Goff
7250dd4222 Merge pull request #26013 from ShawnHe711/correct-nit-in-command-annotation
correct command annotation
2016-08-25 10:39:42 -04:00
shawnhe
b642282990 correct command annotation
Signed-off-by: shawnhe <shawnhe@shawnhedeMacBook-Pro.local>
2016-08-25 21:29:59 +08:00
allencloud
d527149064 fix rm plugin arg number to be min 1
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-25 20:53:49 +08:00
Aaron Lehmann
3b374a25f2 Merge pull request #25582 from anusha-ragunathan/detect-plugin-mediatype
Make `docker pull` detect plugin content and error out.
2016-08-22 09:29:51 -07:00
Anusha Ragunathan
9b6dcc8b9d Make docker pull detect plugin content and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-08-20 12:54:35 -07:00
Vincent Demeester
09b929083d Merge pull request #23436 from yongtang/23367-out-of-band-volume-driver-deletion
Add `--force` in `docker volume rm` to fix out-of-band volume driver deletion
2016-08-19 22:09:57 +02:00
Sebastiaan van Stijn
80798d28d3 Merge pull request #25791 from lixiaobing10051267/masterSwarmJoinToken
Modify usage of docker swarm join-token command
2016-08-19 21:44:42 +02:00
Vincent Demeester
54ed156879
Remove -run flag from commit command.
This flag has been deprecated in version below 1.10 so it's safe to
remove now, according to our deprecation policy.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-19 13:14:03 +02:00
lixiaobing10051267
9123ca546a Modify usage of docker swarm join-token command
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-08-19 09:44:22 +08:00
Yong Tang
6c5c34d50d Add --force in docker volume rm to fix out-of-band volume driver deletion
This fix tries to address the issue in raised #23367 where an out-of-band
volume driver deletion leaves some data in docker. This prevent the
reuse of deleted volume names (by out-of-band volume driver like flocker).

This fix adds a `--force` field in `docker volume rm` to forcefully purge
the data of the volume that has already been deleted.

Related documentations have been updated.

This fix is tested manually with flocker, as is specified in #23367.
An integration test has also been added for the scenario described.

This fix fixes #23367.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-18 18:01:25 -07:00
Kanstantsin Shautsou
57db05cb10
Don't confuse with empty body
It fails with any (even empty) json request body.

Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com>
2016-08-17 02:01:04 +03:00
Brian Goff
37302bbb3f Merge pull request #25721 from cpuguy83/revendor_engine-api
revendor engine-api
2016-08-16 17:18:43 -04:00
Brian Goff
6d98e344c7 revendor engine-api
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-16 14:16:12 -04:00
Tõnis Tiigi
9a3e7d9e34 Merge pull request #25701 from WeiZhang555/update-conflict-rm-restart
Forbid update restart policy of container with AutoRemove flag
2016-08-16 10:37:45 -07:00
Michael Crosby
0c8b0faef8 Merge pull request #25337 from jhorwit2/jah/25332
Add --no-trunc to service/node/stack ps output
2016-08-16 09:25:45 -07:00
Josh Horwitz
204c4d39d3 Add --no-trunc to service/node/stack ps output
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
2016-08-16 10:19:11 -04:00
Sebastiaan van Stijn
dcdf2b404e Merge pull request #25720 from thaJeztah/add-missing-label-filter-docs
Add missing docs for volume ls filter=label
2016-08-16 13:50:56 +02:00
Sebastiaan van Stijn
348f6529b7 Merge pull request #23808 from AkihiroSuda/formatinfo
add `--format` flag to `docker info`
2016-08-16 12:04:26 +02:00
Zhang Wei
4754c64ab5 Forbid update restart policy of container with AutoRemove flag
"--restart" and "--rm" are conflict options, if a container is started
with AutoRemove flag, we should forbid the update action for its Restart
Policy.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-16 15:36:13 +08:00
Akihiro Suda
dc38c9a047 add --format flag to docker info
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-08-16 04:03:52 +00:00
Yong Tang
b4ba575a28 Suppress verbose "Sending build context" messages in non tty scenarios
This fix tries to address the issue raised in 25661 where verbose
"Sending build context" messages were not suppressed in non tty (e.g. log file)
sencarios.

This fix suppress the "Sending build context" message (other than the last one)
if the output is not a tty. The last update of the "Sending build context"
message is still sent to the output.

This fix has been tested manually:
```
docker build -t tmp . > build.log
```
The output is (only one "Sending build context"):
```
Sending build context to Docker daemon 249.4 MB
Step 1 : FROM busybox
 ---> 2b8fd9751c4c
Step 2 : RUN echo 'test'
 ---> Using cache
 ---> 7db298b6c493
Successfully built 7db298b6c493
```

This fix fixes 25661.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-15 18:35:05 -07:00
Sebastiaan van Stijn
5171b83495
Add missing docs for volume ls filter=label
This filter option was added in be045ee2da,
but didn't update the documentation and
man pages.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-15 17:42:16 +02:00
Michael Friis
f9443aa2a5 tweak logout message
Signed-off-by: Michael Friis <friism@gmail.com>
2016-08-12 17:00:06 -07:00
Michael Crosby
2a10899c16 Merge pull request #25216 from aanand/deploy-error-when-not-in-swarm-mode
Better error on 'docker deploy' when not in Swarm mode
2016-08-12 14:17:47 -07:00
Michael Crosby
a86b2376a0 Merge pull request #25070 from yongtang/24881-label-containers-with-stack-name
Label containers with stack name when deploying stack/bundle
2016-08-12 10:20:06 -07:00
Vincent Demeester
64f83cee43 Merge pull request #25568 from thaJeztah/enhance-string-truncate
Implement stringutils.Ellipsis()
2016-08-12 17:19:50 +02:00
Sebastiaan van Stijn
d8240c8e27 Merge pull request #25564 from coolljt0725/fix_inspect_network
Fix inspect network show gateway with mask
2016-08-12 11:11:09 +02:00
Vincent Demeester
353af0b3ec Merge pull request #25557 from yongtang/25529-image-load-api
Return `application/json` for image/load API (quiet=1)
2016-08-12 11:07:43 +02:00
mgniu
e743ab0882 replace handleWithGlobalMiddlewares with handlerWithGlobalMiddlewares
Signed-off-by: mgniu <mgniu@dataman-inc.com>
2016-08-12 10:53:11 +08:00
Tibor Vass
3a7e90c743 Remove --network-add and --network-rm flags from service update
These flags were not supported (daemon returns an error), and it was an
oversight. They were not present in completion scripts.

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 19:37:21 -07:00
Lei Jitang
096bb5fb07 Fix inspect network show gateway with mask
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-08-11 21:08:54 -04:00
Brian Goff
52286b402e Merge pull request #25524 from WeiZhang555/debug-win2lin
Bugfix: client hangs after run container
2016-08-11 15:43:00 -04:00
Vincent Demeester
49cd1680f0 Merge pull request #25428 from yongtang/25375-idempotent-service-update-publish-add
Fix issue in `service update --publish-add`
2016-08-11 20:11:33 +02:00
Zhang Wei
eadcb99619 Refactor waitExitOrRemoved by mlaventure
Reduce complexity of waitExitOrRemoved.

Signed-off-by: mlaventure
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-12 00:50:07 +08:00
Sebastiaan van Stijn
51dc35cf23
Implement stringutils.Ellipsis()
This patch implements an Ellipsis utility to
append an ellipsis (...)  when truncating
strings in output.

It also fixes the existing Truncate() utility
to be compatible with unicode/multibyte characters.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-11 14:14:06 +02:00
Vincent Demeester
ed1a313d8f Merge pull request #25556 from vieux/plugin_description
add description in docker plugin ls
2016-08-11 14:08:50 +02:00
Yong Tang
b487497cd2 Idempotent service update --publish-add
This fix tries to address the issue raised in 25375 where
`service update --publish-add` returns an error if the exact
same value is repeated (idempotent).

This fix use a map to filter out repeated port configs so
that `--publish-add` does not error out.

An integration test has been added.

This fix fixes 25375.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-10 18:03:43 -07:00
Victor Vieux
16d5fbfd9a add description in docker plugin ls
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-08-10 13:06:18 -07:00
Alexander Morozov
64605d709f Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
2016-08-10 11:07:15 -07:00
Vincent Demeester
59ca493121 Merge pull request #25427 from yongtang/25404-service-update-env-add
Fix `service update --env-add` issue
2016-08-10 14:07:05 +02:00
Zhang Wei
a422813113 Bugfix: client hangs after run container
New codes introduced a new method to wait container's exit code and
removal via Events API, but it specified a "since" filter based on
client side clock, which sometimes isn't synced up with daemon's clock,
hence leads the client to hang on waiting container's exit status.

This commit brings the Events call before start, and removes the time
filter, so that it can catch daemon events correctly without care of the
clock issue.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-10 09:36:06 +08:00
Yong Tang
2f27632cde Return application/json for image/load API (quite=1)
This fix tries to address the issue raised in 25529 wehre the
image/load API returns `application/json` for quiet=0 and
`text/plain` for quite=1.

This fix makes the change so that `application/json` is returned
for both quiet=0 and quite=1.

This fix has been tested manually.

This fix fixes 25529.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-09 17:55:42 -07:00
allencloud
0ead624473 add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-10 08:36:09 +08:00
Sebastiaan van Stijn
41d580c7a6 Merge pull request #25512 from diogomonica/add-created-at
Adding Joined at to node inspect --pretty
2016-08-09 12:56:32 +02:00
Yong Tang
c6de8add5f Fix service update --env-add issue
This fix tries to address the issue in 25404 where updating environmental
variable in `service update --env-add` will not work.

The issue is because `--env-add` will only append the env, not update if
the same env already exist.

This fix tracks the env variable with a map and update if the variable
is the same.

An integration test has been added.

This fix fixes 25404.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-08 19:04:56 -07:00
Diogo Monica
d1244abc5c Adding Joined at to node inspect
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
2016-08-08 16:23:10 -07:00
Zhang Wei
6dd8e10d6e Wait container's removal via Events API
If AutoRemove is set, wait until client get `destroy` events, or get
`detach` events that implies container is detached but not stopped.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-08 22:46:53 +08:00
Zhang Wei
3c2886d8a4 Move --rm to daemon side
`--rm` is a client side flag which caused lots of problems:
1. if client lost connection to daemon, including client crash or be
killed, there's no way to clean garbage container.
2. if docker stop a `--rm` container, this container won't be
autoremoved.
3. if docker daemon restart, container is also left over.
4. bug: `docker run --rm busybox fakecmd` will exit without cleanup.

In a word, client side `--rm` flag isn't sufficient for garbage
collection. Move the `--rm` flag to daemon will be more reasonable.

What this commit do is:
1. implement a `--rm` on daemon side, adding one flag `AutoRemove` into
HostConfig.
2. Allow `run --rm -d`, no conflicting `--rm` and `-d` any more,
auto-remove can work on detach mode.
3. `docker restart` a `--rm` container will succeed, the container won't
be autoremoved.

This commit will help a lot for daemon to do garbage collection for
temporary containers.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-08 22:46:53 +08:00
Vincent Demeester
8615c8b52d Merge pull request #25455 from abronan/improve_cli_promote_demote_output
swarm: improve cli output on node promote/demote for unchanged role
2016-08-06 09:12:46 +02:00
Alexandre Beslic
5479df79c7 swarm: improve cli output on node promote/demote for unchanged role
As of now promoting (or demoting) a node that has its role
left unchanged will always print a successful message.

This PR fixes the issue by matching the behavior on swarmkit's
swarmctl command and printing a message when desired role is
the current role of the node.

As a result this also avoids calling update when it is not
necessary.

Signed-off-by: Alexandre Beslic <alexandre.beslic@gmail.com>
2016-08-05 15:51:32 -07:00
Dave Tucker
0e1fe4516f cli: service inspect - Null check for UpdateConfig
Fixes #25453

Signed-off-by: Dave Tucker <dt@docker.com>
2016-08-05 22:42:14 +01:00
Vincent Demeester
049210ce46 Merge pull request #24703 from jhorwit2/jah/#24696
Fixes #24696 - Fixes Size showing 0 in formatted ps output
2016-08-05 21:28:45 +02:00
Vincent Demeester
1ccd9d3137 Merge pull request #23475 from vdemeester/add-format-flag-to-network-and-volume-ls
Add format flag to network and volume ls
2016-08-05 15:17:45 +02:00
Vincent Demeester
85428a1a53 Merge pull request #25096 from vieux/docker_plugin_remove_force
Add --force to docker plugin remove
2016-08-05 14:45:05 +02:00
Victor Vieux
0016b331da Add --force to docker plugin remove
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-08-04 15:55:45 -07:00
Vincent Demeester
7c8780ea63
Refactor dockerCli *Format to ConfigFile call
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-04 15:00:00 +02:00
Vincent Demeester
a488ad1a09
Add volume --format flag to ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-04 14:59:55 +02:00
Vincent Demeester
a8aaafc4a3
Add network --format flag to ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-04 14:59:51 +02:00
Vincent Demeester
e4fdbbc00b
Refactor api/client/formatter files
- Create container.go and image.go for specific context code
- Keep common code in formatter.go and custom.go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-04 14:59:45 +02:00
Daniel Nephin
fab2a3dc82 Ignore 'not a swarm error' when inspecting a task.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-03 12:22:07 -04:00
Daniel Nephin
851c388ad9 Convert inspect to cobra.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-03 10:36:47 -04:00
Tonis Tiigi
e3917c76ce Mask join tokens in daemon logs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-02 15:15:23 -07:00
Brian Goff
404705fd8e Merge pull request #25345 from dperny/fix-service-inspect-pretty
Fix missing newline in service inspect --pretty
2016-08-02 17:50:28 -04:00
Sebastiaan van Stijn
10ae908bfa Merge pull request #25159 from diogomonica/adding-force-to-node-remove
Adding force to node rm
2016-08-02 22:49:15 +02:00
Drew Erny
02ebaf364f Fix missing newline in service inspect --pretty
Printing off networks as part of --pretty was missing a newline, causing
the next thing printed to be concatenated onto the end of the line.
Added an empty println after all networks are printed.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2016-08-02 13:27:35 -07:00
Vincent Demeester
3d28cdd2f5 Merge pull request #25308 from thaJeztah/join-token-refactor
Improve swarm join-token instructions
2016-08-02 18:57:37 +02:00
Sebastiaan van Stijn
ebebd41769
Improve swarm join-token instructions
this change improves the instructions for
swarm join-token and swarm init;

- only print the join-token command for workers
  instead of for both managers and workers, to
  prevent users from copying the wrong command.
  An extra line is added to explain how to obtain
  the manager token.
- print a message that a token was rotated
  sucesfully if '--rotate' is used.
- add some extra white-space before / after
  the join commands, to make copy/pasting
  easier.

this change also does some refactoring of join-token;

- move flagname-constants together with other constants
- use variables for selected role ("worker" / "manager")
  to prevent checking for them multiple times, and to
  keep the "worker" / "manager" sting centralized
- add an extra blank line after "join-token" instructions
  this makes it easier to copy, and cleans up the
  code a tiny bit

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-02 16:44:02 +02:00
Yong Tang
80a3755a8f Update docs in docker service create/update for flag --user
In `docker service create/update`, flag `--user` actually supports
`uid:gid` (same as `docker run`). However, this is not reflected
in the help and documentation yet.

This fix updates docs in `docker service create/update` to change
the description to `Username or UID (format: <name|uid>[:<group|gid>])`.

The help message output has also been updated.

This fix is related to 25304.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-02 07:01:16 -07:00
Diogo Monica
a327c231b5 Add --force to node removal
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
2016-08-01 18:55:58 -07:00
Brian Goff
8f78dae4e3 Merge pull request #25204 from yongtang/25195-docker-info-ca-configuration
Output external CAs in swarm mode with `docker info`
2016-08-01 21:34:00 -04:00
Yong Tang
55d05fc055 Replace "workdir' with const, same as other flags in service create
This is a minor fix that tries to replace `"workdir"` with const in `service create`.

Since `"workdir"` is the only string not defined as const in `func addServiceFlags()`,
I think it makes sense to replace `"workdir"` with a const to be consistent.

The flag `"workdir"` in `service update` has also been replaced.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-01 11:45:28 -07:00
Yong Tang
995128e9eb Output external CAs in swarm mode with docker info
This fix tries to address the issue raised in 25195 where external
CA configurations are not present in `docker info`.

This fix adds the output of external CAs in `docker info` in swarm
mode.

The test is done manually with:
```
docker run -p 8888:8888 -e CXFSSL_ADDRESS=0.0.0.0 -d fabric8/cfssl
docker swarm init --external-ca protocol=cfssl,url=http://172.17.0.2:8888
```

The `docker info` output:
```
 Managers: 1
 Nodes: 1
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot interval: 10000
  Heartbeat tick: 1
  Election tick: 3
 Dispatcher:
  Heartbeat period: 5 seconds
 CA configuration:
  Expiry duration: 3 months
  External CAs:
    cfssl: https://172.17.0.2:8888
```

This fix fixes 25195.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-30 09:14:16 -07:00
allencloud
6c5988ed8c update command description in CLI
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-31 00:06:18 +08:00
allencloud
ac13162464 uppercase output in docker info related to swarm mode
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-30 10:14:44 +08:00
Brian Goff
6bf2db574b Merge pull request #24365 from xianlubird/bug/network-list
Change buildEndpointResource params avoid repeat visits resource
2016-07-29 14:54:05 -04:00
Aanand Prasad
aab92ec7ec Better error on 'docker deploy' when not in Swarm mode
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-07-29 11:12:20 +01:00
Vincent Demeester
3d42bf5f12 Merge pull request #23759 from AkihiroSuda/cobraexec
Migrate exec command to cobra
2016-07-29 07:41:02 +02:00
Vincent Demeester
faf9dac22c Merge pull request #24986 from mlaventure/add-live-restore-to-info
Add live restore to info
2016-07-29 07:37:56 +02:00
Akihiro Suda
9d9dff3d0d Migrate exec command to cobra
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-07-29 02:10:36 +00:00
Kenfe-Mickael Laventure
189aaf8aea Add live-restore state to docker info output
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-28 17:10:40 -07:00
Aaron Lehmann
614ad95fbb service ls: Show tasks from nodes that are not down, not only "ready" nodes
Currently, the counter only shows tasks on READY nodes. It's more
correct to also count nodes in the other states except DOWN, because
the tasks assocated with those nodes are still assumed to be running for
orchestration purposes. One example of when this could matter is during
a leader failover when agents are in the process of reconnecting.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-28 11:44:28 -07:00
Arnaud Porterie
95ede360e8 Merge pull request #25013 from dnephin/remove-extraneous-aliases
Remove extraneous mount cli aliases
2016-07-27 22:51:56 +00:00
Daniel Nephin
39a3700c01 Remove extraneous mount aliases.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-27 15:05:31 -04:00
Stephen J Day
0aa4e1e689
cli: docker service|node|stack ps instead of tasks
Rather than conflict with the unexposed task model, change the names of
the object-oriented task display to `docker <object> ps`. The command
works identically to `docker service tasks`. This change is superficial.

This provides a more sensical docker experience while not trampling on
the task model that may be introduced as a top-level command at a later
date.

The following is an example of the display using `docker service ps`
with a service named `condescending_cori`:

```
$ docker service ps condescending_cori
ID                         NAME                  SERVICE             IMAGE   LAST STATE              DESIRED STATE  NODE
e2cd9vqb62qjk38lw65uoffd2  condescending_cori.1  condescending_cori  alpine  Running 13 minutes ago  Running        6c6d232a5d0e
```

The following shows the output for the node on which the command is
running:

```console
$ docker node ps self
ID                         NAME                  SERVICE             IMAGE   LAST STATE              DESIRED STATE  NODE
b1tpbi43k1ibevg2e94bmqo0s  mad_kalam.1           mad_kalam           apline  Accepted 2 seconds ago  Accepted       6c6d232a5d0e
e2cd9vqb62qjk38lw65uoffd2  condescending_cori.1  condescending_cori  alpine  Running 12 minutes ago  Running        6c6d232a5d0e
4x609m5o0qyn0kgpzvf0ad8x5  furious_davinci.1     furious_davinci     redis   Running 32 minutes ago  Running        6c6d232a5d0e
```

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-27 11:06:42 -07:00
Yong Tang
796636716d Label containers with stack name when deploying stack/bundle
This fix tries to address the issue raised in 24881 where
the stack name is not visable when inspecting containers
deployed through stacks.

This fix adds `labelNamespace` (`com.docker.stack.namespace`)
to containers at the client side so that the stack name label
will show up after containers are deployed.

This fix is tested manually:
 - Build the binary with `make DOCKER_EXPERIMENTAL=1`
 - Create a bundle file and deploy with the `docker stack deploy`
 - Verify that `com.docker.stack.namespace` has been
set properly by checking contaners with `docker inspect <ContainerID>`

This fix fixes 24881.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-26 11:53:39 -07:00
Vincent Demeester
f0173abd36 Merge pull request #25047 from aaronlehmann/unsafe-flag-updates
service update: Don't assume existing pointers in spec are valid
2016-07-26 10:14:29 +02:00
Tibor Vass
9ee430fcf5 Merge pull request #25042 from tiborvass/carry-24492
Carry 24492: Remove swarm inspect and use info instead
2016-07-26 01:11:37 -07:00
Aaron Lehmann
f9c920a126 service update: Don't assume existing pointers in spec are valid
When updating values in the spec according to CLI flags, don't write
into the existing pointers. They may be nil. Instead, update them to
point to the new value we're writing.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-25 23:56:50 -07:00
Tibor Vass
8ad9438ede Address some displaying issues in docker info
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:07:39 -07:00
Vincent Demeester
e6923f6d75 Remove swarm inspect and use info instead
Remove the swarm inspect command and use docker info instead to display
swarm information if the current node is a manager.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-25 20:31:10 -07:00
Tibor Vass
e462b4507a Prevent panic on update --container-label-add
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 19:17:06 -07:00
Vincent Demeester
4031d70d1b Add container labels to service create/update
Swarm mode makes it possible through the API to set labels to containers
but not through command line. This tries to fix it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-25 18:57:02 -07:00
Tibor Vass
afac3361dc Merge pull request #25023 from cpuguy83/25022_fix_label_panic
fix panic on --label-add
2016-07-25 18:13:15 -07:00
Brian Goff
85bc3194aa fix panic on --label-add
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-25 19:20:44 -04:00
Tibor Vass
c65925f24b Merge pull request #24943 from aaronlehmann/rolling-updates
Add failure action for rolling updates
2016-07-25 10:15:28 -07:00
Tibor Vass
087ca1b3b7 Merge pull request #24917 from aluzzardi/improve-service-error-reporting
service tasks: Improve error reporting
2016-07-25 09:44:08 -07:00
Aaron Lehmann
57ae29aa74 Add failure action for rolling updates
This changes the default behavior so that rolling updates will not
proceed once an updated task fails to start, or stops running during the
update. Users can use docker service inspect --pretty servicename to see
the update status, and if it pauses due to a failure, it will explain
that the update is paused, and show the task ID that caused it to pause.
It also shows the time since the update started.

A new --update-on-failure=(pause|continue) flag selects the
behavior. Pause means the update stops once a task fails, continue means
the old behavior of continuing the update anyway.

In the future this will be extended with additional behaviors like
automatic rollback, and flags controlling parameters like how many tasks
need to fail for the update to stop proceeding. This is a minimal
solution for 1.12.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-25 08:51:19 -07:00
Sebastiaan van Stijn
3fa9d77bf3 make network errors less DRY
There's existing code to generate these
kind of errors, so make the errors added
in commit cc493a52a4
less DRY.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-25 16:22:08 +02:00
Vincent Demeester
e64f5f97fc Merge pull request #25002 from thaJeztah/add-new-errors-to-api-docs
Add new error to API docs
2016-07-25 16:00:36 +02:00
Brian Goff
11501fa60c Merge pull request #23908 from capkurmagati/fix-docker-stats
Fix high cpu usage caused by docker stats.
2016-07-25 09:54:00 -04:00
Sebastiaan van Stijn
b0089e4827
Add new error to API docs
Commit cc493a52a4 added
a constraint to network connect/disconnect operations
on "Swarm scoped" networks.

This adds those errors to the API documentation. Also
changes the error to lowercase for consistency.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-25 12:04:55 +02:00
Sebastiaan van Stijn
cc493a52a4 Merge pull request #24988 from mavenugo/snconnect
Prevent network connect/disconnect on swarm scoped networks
2016-07-25 10:46:45 +02:00
Vincent Demeester
40044cb18f Merge pull request #24963 from allencloud/fix-typos
fix typos
2016-07-25 09:39:48 +02:00
Madhu Venugopal
8f9066c468 Prevent network connect/disconnect on swarm scoped networks
Swarm handles service updates quite differently and also it doesnt
support worker driver network operations. Hence prevent containers from
connecting to swarm scoped networks

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-24 15:34:45 -07:00
Aaron Lehmann
fca0b18dcb Require listen address and advertise address to be an IP address or an interface name
Hostnames are not supported for now because libnetwork can't use them
for overlay networking yet.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-24 09:23:38 -07:00
Aaron Lehmann
a0ccd0d42f Split advertised address from listen address
There are currently problems with "swarm init" and "swarm join" when an
explicit --listen-addr flag is not provided. swarmkit defaults to
finding the IP address associated with the default route, and in cloud
setups this is often the wrong choice.

Introduce a notion of "advertised address", with the client flag
--advertise-addr, and the daemon flag --swarm-default-advertise-addr to
provide a default. The default listening address is now 0.0.0.0, but a
valid advertised address must be detected or specified.

If no explicit advertised address is specified, error out if there is
more than one usable candidate IP address on the system. This requires a
user to explicitly choose instead of letting swarmkit make the wrong
choice. For the purposes of this autodetection, we ignore certain
interfaces that are unlikely to be relevant (currently docker*).

The user is also required to choose a listen address on swarm init if
they specify an explicit advertise address that is a hostname or an IP
address that's not local to the system. This is a requirement for
overlay networking.

Also support specifying interface names to --listen-addr,
--advertise-addr, and the daemon flag --swarm-default-advertise-addr.
This will fail if the interface has multiple IP addresses (unless it has
a single IPv4 address and a single IPv6 address - then we resolve the
tie in favor of IPv4).

This change also exposes the node's externally-reachable address in
docker info, as requested by #24017.

Make corresponding API and CLI docs changes.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-24 09:23:07 -07:00
Vincent Demeester
ca663a400c Merge pull request #24957 from aluzzardi/default-history-retention
CLI: Change default Swarm task history retention limit.
2016-07-24 11:11:24 +02:00
Vincent Demeester
3742557ed4 Merge pull request #24932 from thaJeztah/change-to-camelBack-for-consistency
Change "rotate_worker_token" to "rotateWorkerToken"
2016-07-24 10:05:07 +02:00
Sebastiaan van Stijn
b8a08ddd69 Merge pull request #24872 from stevvooe/mount-aliases
api/client/service: mount option defaults and aliases
2016-07-23 14:02:31 +02:00
allencloud
4e959ef2f7 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-23 11:32:23 +08:00
Andrea Luzzardi
d97c0a1f25 CLI: Change default Swarm task history retention limit.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-07-22 18:09:54 -07:00
Stephen J Day
67246afd3d
api/client/service: default update parallelism to 1
When updates happen, the current behavior is to kill all running
instances and dispatch new tasks. Common use cases for container updates
involve small numbers of containers, meaning the app will go down on
most updates. Setting parallelism to 1 ensures that at most one task
will go down during the update. Services with higher replica counts can
increase this number accordingly to meet their needs.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-22 17:13:58 -07:00
Sebastiaan van Stijn
bd81df1278
Change "rotate_worker_token" to "rotateWorkerToken"
This renames the `rotate_xxx` flags to camelBack, for
consistency with other API query-params, such as
`detachKeys`, `noOverwriteDirNonDir`, and `fromImage`.

Also makes this flag accept a wider range of boolean
values ("0", "1", "true", "false"), and throw an error
if an invalid value is passed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-23 01:04:12 +02:00
Vincent Demeester
97039324c0 Merge pull request #24885 from vdemeester/24875-registrauth-with
Rename `--registry-auth` to `--with-registry-auth`
2016-07-22 19:05:49 +02:00
Vincent Demeester
8426f72107
Append --registry-auth with with
`--with-registry-auth` is more explicit.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-22 10:38:56 +02:00
Andrea Luzzardi
edd67fd4ad service tasks: Improve error reporting
- Tasks will display all tasks (`-a` is the default and was removed)
- Nest tasks to help display history
- Display task errors inline

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-07-21 19:19:11 -07:00
Aaron Lehmann
58ba4c313b Reorder swarm commands
This way "join-token" appears next to "join" in the help output.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-21 18:08:41 -07:00
Tibor Vass
f5e1f6f688 Merge pull request #24823 from aaronlehmann/join-tokens
Replace secrets with join tokens
2016-07-21 18:06:55 -07:00
Stephen J Day
634f54a047
api/client/service: mount option defaults and aliases
Simplifies the mount option usage by providing common aliases for
`source` and `target`. The default mount type is now volume.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-21 17:31:33 -07:00
Aaron Lehmann
2cc5bd33ee Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-21 15:23:03 -07:00
Sebastiaan van Stijn
0a8a6f2dd7 Merge pull request #24871 from thaJeztah/fix-wrong-case-mount-type
Change mount-types to lowercase
2016-07-22 00:03:55 +02:00
Vincent Demeester
22d020276c Merge pull request #24700 from nishanttotla/pass-registry-auth-on-deploy
Send registry auth token for service deploy
2016-07-21 12:33:33 +02:00
Sebastiaan van Stijn
8f93128cd6
Change mount-types to lowercase
these values were changed to lowercase in
690cb2d08c,
but not changed accordingly in docker/docker.

this changes the mounttypes to lowercase

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-21 11:25:42 +02:00
Stephen J Day
a40b5820c9
api/client/service: shorten to volume-opt
`volume-driver-opt` was too verbose for its own existence and the sanity
of those in the vicinity. The much better, sleeker `volume-opt` replaces
it. 7 bytes and a case of carpal tunnel syndrome are saved!

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-20 16:08:36 -07:00
Nishant Totla
a26bdd8607
Send registry auth token for service deploy
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2016-07-20 16:07:07 -07:00
Sebastiaan van Stijn
2a78789ad1 Merge pull request #24266 from allencloud/add_cmd_docker_stack_services_STACKNAME
add command `docker stack services STACKNAME`
2016-07-20 18:38:08 +02:00
Sebastiaan van Stijn
06f35262c4
Rename --bundle to --file
This renames the '--bundle' flag for docker (stack) deploy
to be consistent with 'docker build'.

Note that there's no shorthand '-f' added for now,
because this may be confusing on 'docker stack config',
which also takes a file, and for which we may want to
have a '--format' flag in future.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-20 16:03:27 +02:00
Doug Davis
3d4bde92b7 Merge pull request #24832 from npcode/fix-service-rm-usage
Fix the usage for `service rm` command
2016-07-20 06:44:34 -04:00
Yi EungJun
cf61cd3a92 Fix the usage for service rm command
Signed-off-by: Yi EungJun <eungjun.yi@navercorp.com>
2016-07-20 18:27:26 +09:00
Brian Goff
2ee828aac2 Merge pull request #24802 from vdemeester/stack-docs-and-flags
Add documentation for stack commands
2016-07-19 14:30:49 -04:00
Vincent Demeester
10919e8909
Add documentation for stack commands
Also removes the `-f` flags of bundle to follow the single-letter flags
evaluation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-19 18:32:44 +02:00
Daniel Nephin
47cca88c8c Dont run man generation as part of test-unit.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-19 12:00:35 -04:00
Daniel Nephin
25e9b06ac0 Set Long text for volume commands so they can be used to generate man pages.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-19 12:00:21 -04:00
Daniel Nephin
68e52febde Merge pull request #24722 from thaJeztah/update-usage-for-deprecated-flags
Don't automagically add "[OPTIONS]" to usage
2016-07-19 11:01:33 -04:00
allencloud
4b21b411ec add command docker stack services STACKNAME
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-19 14:21:58 +08:00
Sebastiaan van Stijn
dc0d6040e4 Merge pull request #24397 from dongluochen/nodelabels
support node label update
2016-07-19 07:55:24 +02:00
Tibor Vass
1796680381 Merge pull request #24476 from stevvooe/services-log-driver-support
swarm: add log driver support for services
2016-07-18 19:08:12 -07:00
Dong Chen
e1165cdfd1 Support node label update.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-07-18 18:39:52 -07:00
Tibor Vass
e6a97db2c9 Merge pull request #23878 from jstarks/fix_windows_console
Windows: Always enable VT emulation
2016-07-18 16:23:04 -07:00
Sebastiaan van Stijn
340964db1c Merge pull request #24692 from anusha-ragunathan/plugins-ux
Print plugin name on successful install, enable and disable.
2016-07-19 01:09:35 +02:00
Sebastiaan van Stijn
4f0b510552
Don't automagically add "[OPTIONS]" to usage
This removes the logic to automatically
add [OPTIONS] to the usage output.

The current logic was broken if a command
only has deprecated or hidden flags, and
in many cases put the [OPTIONS] in the
wrong location.

Requiring the usage string to be set
manually gives more predictable results,
and shouldn't require much to maintain.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-19 00:07:19 +02:00
Anusha Ragunathan
6dca1e6d3f Print plugin name on successful install, enable and disable.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-18 09:47:12 -07:00
Arnaud Porterie
98a4b3e332 Merge pull request #24714 from allencloud/better-docker-network-create-help-output
better command `docker network create -h` output
2016-07-18 16:05:46 +00:00
allencloud
0d459f5ed3 fix typo creats into creates in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-16 17:55:18 +08:00
allencloud
d0081a0f47 better command docker network create -h output
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-16 15:32:17 +08:00
Stephen J Day
e778ba2d5b
swarm: add log driver support for services
Adds log driver support for service creation and update. Add flags
`--log-driver` and `--log-opt` to match `docker run`. Log drivers are
configured per service.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-15 21:39:27 -07:00
Josh Horwitz
456e039659 Fixes #24696 - fixes size showing 0 in format output
Signed-off-by: Josh Horwitz <horwitz@addthis.com>
2016-07-15 18:37:42 -04:00
Daniel Nephin
909c596fa5 Only show port name if set.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-15 16:02:04 -04:00
Vincent Demeester
83f232e186 Merge pull request #23773 from dnephin/allow-remove-during-update
Add remove flags for service update
2016-07-14 11:10:30 +02:00
Sebastiaan van Stijn
ffd03708e9 Merge pull request #24615 from aaronlehmann/spaces-not-tabs
Use spaces, not tabs, to format sample "swarm join" command
2016-07-14 11:07:12 +02:00
Dong Chen
08ae4e544d Fix service inspect --pretty.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-07-14 00:11:29 -07:00
Aaron Lehmann
6de8fcb2f2 Use spaces, not tabs, to format sample "swarm join" command
Using tabs here seems to cause copy/paste problems in some terminals.
Using spaces is safer.

Fixes #24609

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-13 19:31:05 -06:00
Tibor Vass
1c6a8715ab Merge pull request #24592 from thaJeztah/remove-dead-code
Remove dead code for "inspect --pretty"
2016-07-13 14:46:42 -07:00
Daniel Nephin
3249c1d0e7 Fix multi-remove during service update.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 16:11:08 -04:00
Daniel Nephin
4c6faa4340 Change the add/update flags to include 'add'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 16:06:25 -04:00
Daniel Nephin
ead1f62aba PR feedback
improve help text for service update remove flags
implement proper merge update of placement flag
more code re-use in update functions using a toRemove set.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 16:06:25 -04:00
Daniel Nephin
dc33fc1ff4 Add remove flags for service update
with unit tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 16:06:25 -04:00
Tibor Vass
fd8269b8f6 Merge pull request #24195 from dnephin/service-update-better-args-and-command
Update service `args` with a single flag (shlex)
2016-07-13 13:02:19 -07:00
Sebastiaan van Stijn
4d87f9083b
Remove dead code for "inspect --pretty"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-13 18:56:02 +02:00
Sebastiaan van Stijn
7bf0faf423
Remove shorthand flags for "mount", "pretty", and "no-resolve"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-13 18:47:29 +02:00
Daniel Nephin
674d227445 Merge service command and args as a string.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-13 12:31:16 -04:00
Arnaud Porterie
58624acf11 Merge pull request #24525 from vdemeester/24196-remove-command-flag-on-service-update
Remove --command flag for service update
2016-07-13 16:01:11 +00:00
Vincent Demeester
e4a024d590
Remove --command flag for service update
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-13 16:19:21 +02:00
Vincent Demeester
92b1577871 Merge pull request #24562 from thaJeztah/carry-24499-swarm-info-consistency
[carry 24499] Remove "Yes"/"No" and use "true"/"false" consistently in `docker info`
2016-07-13 15:13:58 +02:00
Sebastiaan van Stijn
ea365e4cb3
Make labels human readable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-13 01:08:54 +02:00
Sebastiaan van Stijn
7da11b1afd Merge pull request #24146 from johnharris85/fix-swarm-update-auto-accept
Add comma-separated --auto-accept support.
2016-07-12 16:29:21 +02:00
Tibor Vass
880484992c Merge pull request #24501 from hqhq/remove_exec_driver
Remove execution driver
2016-07-11 16:54:36 -07:00
johnharris85
8e14882773 Add support for comma-separated --auto-accept syntax.
Signed-off-by: John Harris <john@johnharris.io>
2016-07-11 15:47:04 -07:00
Vincent Demeester
46649755f8 Merge pull request #24051 from allencloud/return-err-when-stack-name-nonexist
output some details when stack name does not exist
2016-07-11 20:43:09 +02:00
allencloud
416613f2e5 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-12 00:59:30 +08:00
Akihiro Suda
c6b7bd1aa6 Remove "Yes"/"No" and use "true"/"false" consistently in docker info
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-07-11 06:55:30 +00:00
Qiang Huang
1fb1136fec Remove execution driver
We use containerd and there is no execution driver anymore.

Addresses: https://github.com/docker/docker/issues/24461

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-11 14:52:27 +08:00
Sebastiaan van Stijn
db435560b3 Merge pull request #24389 from Microsoft/jjh/silentsecurity
Windows: No security warning on quiet
2016-07-08 11:06:33 -07:00
John Howard
a9b3c1d720 Windows: No security warning on quiet
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-07-07 16:00:08 -07:00
Sebastiaan van Stijn
b98ba9a1d6 Merge pull request #24291 from vdemeester/docs-cli-reference-updates
Updates on cli reference documentation
2016-07-07 14:28:54 -07:00
Vincent Demeester
f4cfc6b983
Updates on cli reference documentation
- Update ps with `--last` flag
- Update commands with current output
- Make sure hugo does not detect the wrong language
- Update usage for `tag` command to be more coherent with the other ones

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-07 20:43:18 +02:00
Tõnis Tiigi
db67db98d8 Merge pull request #24349 from aaronlehmann/swarm-secrets-by-default
Generate a swarm joining secret if none is specified
2016-07-07 11:43:08 -07:00
Vincent Demeester
a859a33647
Use "on-failure" for both containers and services
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-07 11:32:19 +02:00
Vincent Demeester
50674ec107 Merge pull request #24053 from cpuguy83/mounts_default_writable
Change defaults for mount writable and volume copying
2016-07-07 11:18:14 +02:00
Brian Goff
56f3422468 Use newer default values for mounts CLI
In the API:
`Writable` changed to `ReadOnly`
`Populate` changed to `NoCopy`

Corresponding CLI options updated to:
`volume-writable` changed to `volume-readonly`
`volume-populate` changed to `volume-nocopy`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-06 22:34:39 -04:00
Brian Goff
140ec59db6 re-vendor engine-api
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-06 21:14:14 -04:00
Aaron Lehmann
7342e42fce Generate a swarm joining secret if none is specified
The current behavior of `docker swarm init` is to set up a swarm that
has no secret for joining, and does not require manual acceptance for
workers. Since workers may sometimes receive sensitive data such as pull
credentials, it makes sense to harden the defaults.

This change makes `docker swarm init` generate a random secret if none
is provided, and print it to the terminal. This secret will be needed to
join workers or managers to the swarm. In addition to improving access
control to the cluster, this setup removes an avenue for
denial-of-service attacks, since the secret is necessary to even create
an entry in the node list.

`docker swarm init --secret ""` will set up a swarm without a secret,
matching the old behavior. `docker swarm update --secret ""` removes the
automatically generated secret after `docker swarm init`.

Closes #23785

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-06 13:04:50 -07:00
Anil Madhavapeddy
2de9585f5e make docker service --help text for --endpoint-mode more consistent
Previously:

```
      --constraint value             Placement constraints (default [])
      --endpoint-mode string         Endpoint mode(Valid values: vip, dnsrr)
<snip>
      --restart-condition string     Restart when condition is met (none, on_failure, or any)
```

Now:

```
      --constraint value             Placement constraints (default [])
      --endpoint-mode string         Endpoint mode (vip or dnsrr)
<snip>
      --restart-condition string     Restart when condition is met (none, on_failure, or any)
```

Signed-off-by: Anil Madhavapeddy <anil@docker.com>
2016-07-06 12:10:28 +01:00
xianlubird
5b681c96b0 Change buildEndpointResource params avoid repeat visits resource
Signed-off-by: Xianlu <xianlu.cxl@alibaba-inc.com>
2016-07-06 17:55:02 +08:00
Vincent Demeester
6daf3d2a78
Validate hostname starting from 1.24 API.
In order to keep a little bit of "sanity" on the API side, validate
hostname only starting from v1.24 API version.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-06 09:13:59 +02:00
Alexander Morozov
ad44f49470 Merge pull request #24351 from allencloud/add-file-close-in-loadBundlefile
fix severe fd leak in stack
2016-07-05 17:45:34 -07:00
allencloud
0af04b6132 fix severe fd leak in stack
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-06 07:00:39 +08:00
Arnaud Porterie
5b41316815 Merge pull request #24158 from mavenugo/smissues
Fixed a few network UI issues in swarm-mode
2016-07-05 20:28:20 +00:00
Brian Goff
97aebe9a6c Merge pull request #24013 from dmcgowan/atomic-libtrust-key-file-write
Atomically save libtrust key file
2016-07-05 15:28:41 -04:00
Alexander Morozov
db75aa029d Merge pull request #24173 from vdemeester/tasks-filter-service-node-by-name
Allow service and node filter to be name in `tasks` subcommands
2016-07-05 12:16:57 -07:00
Alexander Morozov
a44e0fedc2 Merge pull request #24298 from allencloud/fix-stdout-and-stderr-in-api-client
fix stdout and stderr in api client
2016-07-05 09:58:25 -07:00
Alexander Morozov
55b8216279 Merge pull request #24191 from tonistiigi/mask-secrets
Mask swarm secrets from daemon logs
2016-07-05 08:56:33 -07:00
allencloud
533bd82e41 fix stdout and stderr in api client
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-05 23:07:40 +08:00