Compare commits

...

1050 commits

Author SHA1 Message Date
Sebastiaan van Stijn
175f182937 Merge pull request #30142 from aduermael/1.12.x
[1.12.x] fixed a few links that are broken in the docs
2017-01-13 21:33:05 +01:00
Adrien Duermael
915f6046bc fixed broken links in docs
I need this to be merge to solve that issue: https://github.com/docker/docker.github.io/issues/1068, and merge new CI tests for the docs: https://github.com/docker/docker.github.io/pull/1052

Signed-off-by: Adrien Duermael <adrien@duermael.com>
2017-01-13 11:52:09 -08:00
Adrien Duermael
c529d3d7ee docs: removed links to stack_tasks & stack_ls
`docsreference/commandline/stack_tasks.md ` &  `docsreference/commandline/stack_ls.md` do not exist.

I need this to be merge to solve that issue: https://github.com/docker/docker.github.io/issues/1068, and merge new CI tests for the docs: https://github.com/docker/docker.github.io/pull/1052

Signed-off-by: Adrien Duermael <adrien@duermael.com>
2017-01-13 11:44:11 -08:00
Kenfe-Mickaël Laventure
78d18021ec Merge pull request #71 from mlaventure/bump-1.12.6
Bump version to 1.12.6
2017-01-10 11:32:34 -08:00
Kenfe-Mickael Laventure
94dfa20066 Bump version to 1.12.6
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-01-10 11:32:16 -08:00
Kenfe-Mickaël Laventure
7779ca4a98 Merge pull request #70 from mlaventure/fk-1.12.x
Update runc to 50a19c6ff828c58e5dab13830bd3dacde268afe5
2017-01-10 11:30:00 -08:00
Kenfe-Mickael Laventure
85c245a239 Update runc to 50a19c6ff828c58e5dab13830bd3dacde268afe5
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-01-10 11:17:27 -08:00
Brian Goff
97cd32a6a9 Merge pull request #29643 from tonistiigi/fix-restore-112
Fix liverestore/restartmanager conflict in v1.12
2017-01-05 11:47:02 -05:00
Tonis Tiigi
36900f1d03 Fix liverestore/restartmanager panic in v1.12
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-04 13:21:27 -08:00
Tibor Vass
7392c3b0ce Merge pull request #29466 from vieux/bump_1.12.5
bump to 1.12.5
2016-12-15 17:57:48 -08:00
Tibor Vass
e81486637e Merge pull request #29464 from andrewhsu/revert-selinux
[1.12.x] Revert depend on docker-selinux for centos-7.3+
2016-12-15 17:56:32 -08:00
Victor Vieux
5e7229d32d bump to 1.12.5
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 17:31:22 -08:00
Andrew Hsu
6646fc318f Revert "change dep for docker-selinux in centos-7+"
This reverts commit c80d82a98d.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-15 16:30:14 -08:00
Andrew Hsu
1606fe0c04 Revert "only build selinux rpm if we have policy dir"
This reverts commit f9bc32067d.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-15 16:29:58 -08:00
Victor Vieux
e9e3ab6b6a Merge pull request #29424 from tonistiigi/fix-sdin-close
Fix race on sending stdin close event
2016-12-14 15:23:14 -08:00
Kenfe-Mickaël Laventure
eb6bab3338 Merge pull request #29425 from tophj-ibm/fix-ppc64le-gopath
[1.12.x] ppc64le, update gopath to include vendor
2016-12-14 14:17:38 -08:00
Christopher Jones
1b8209bf6d
[1.12.x] ppc64le, update gopath to include vendor
The vendor change doesn't happen until 1.13.0, so revert
back to old gopath. Fixes building on ppc64le.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-12-14 16:43:35 -05:00
Tonis Tiigi
fea72090a7 Fix race on sending stdin close event
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 4e262f6387)
2016-12-14 13:26:18 -08:00
Victor Vieux
58a51648bd Merge pull request #29416 from aboch/c1.12.x
[1.12.5] Fix buildIpamResources()
2016-12-14 11:22:12 -08:00
Alessandro Boch
660154fafa Fix buildIpamResources()
- Can no longer assume IPv6 operational data to be present

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-12-14 09:34:03 -08:00
Victor Vieux
0e5346df32 update changelog
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 23:06:12 -08:00
Victor Vieux
02394deb34 Merge pull request #29379 from vieux/1.12.5-rc1_bump
1.12.5-rc1 bump
2016-12-13 22:27:18 -08:00
Victor Vieux
5fb9e4926a Merge pull request #29377 from andrewhsu/require-docker-selinux
[1.12.x] depend on docker-selinux for centos-7.3+
2016-12-13 22:25:21 -08:00
Victor Vieux
f6fbe58fbe add networking fox to changelog
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 20:08:39 -08:00
Victor Vieux
00ca3caed8 bump 1.12.5-rc1
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 17:31:18 -08:00
Andrew Hsu
f9bc32067d only build selinux rpm if we have policy dir
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-13 17:01:48 -08:00
Andrew Hsu
c80d82a98d change dep for docker-selinux in centos-7+
Use the policy files provided by CentOS for docker by depending on
docker-selinux.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-13 17:01:48 -08:00
Victor Vieux
55d7080ee6 Merge pull request #29370 from cpuguy83/move_streamconfig_112
[1.12.x] Move `StreamConfig` out of `runconfig`
2016-12-13 16:47:51 -08:00
Brian Goff
286f44240c Move StreamConfig out of runconfig
`StreamConfig` carries with it a dep on libcontainerd, which is used by
other projects, but libcontainerd doesn't compile on all platforms, so
move it to `github.com/docker/docker/container/stream`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-12-13 16:57:21 -05:00
Vincent Demeester
0eb8e727af Merge pull request #29332 from thaJeztah/docs-cherry-picks-1.12.4
[1.12.x] docs cherry picks
2016-12-13 12:20:56 +01:00
Victor Vieux
1564f02e33 Merge pull request #29338 from vieux/bump_1.12.4_version
bump version to 1.12.4
2016-12-12 15:00:06 -08:00
Victor Vieux
fbc5f05beb bump version to 1.12.4
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 14:48:17 -08:00
Victor Vieux
1a184cf700 Merge pull request #29297 from vieux/plugins_cherry-picks
Make `docker pull` detect plugin content and error out.
2016-12-12 14:44:54 -08:00
Anusha Ragunathan
39fbd603e9 Make docker pull detect plugin content and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 9b6dcc8b9d)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 12:57:28 -08:00
Qinglan Peng
10b636ce03 fix some broken contents links
Signed-off-by: Qinglan Peng <qinglanpeng@zju.edu.cn>

fix-contents-links

Signed-off-by: Qinglan Peng <qinglanpeng@zju.edu.cn>
(cherry picked from commit bac792c163)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:17:46 +01:00
Chris Gavin
b37fda12fb Fix a spelling mistake in the docs.
Signed-off-by: Chris Gavin <chris@chrisgavin.me>
(cherry picked from commit 35c82f422d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:15:56 +01:00
Yanqiang Miao
63b4965387
Fix some format errors
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 71f1205269)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:11:45 +01:00
Misty Stanley-Jones
1f6bda6d20 Document publishing a UDP port
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 2178c840ba)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:11:25 +01:00
Misty Stanley-Jones
bf1a4d88bc
Fix copypaste error 'is-automated'
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 2333657e1b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:03:16 +01:00
lixiaobing10051267
60ff6c6b98 modify invalid url in plugins_network.md
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

(cherry picked from commit fc7c235f84)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:35 +01:00
John Howard
c00b451d46 Windows: Note about volumes in run
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit b9e65f40cf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:35 +01:00
bbayani
bff68bc605 Clarify that ipmasq rules are not added when iptables is false
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit db3f06fd97)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:34 +01:00
dattatrayakumbhar04
09b09c34b3 28600: Docs: network connect for container in Created/Stopped state
Signed-off-by: dattatrayakumbhar04 <dattatraya.kumbhar@gslab.com>
(cherry picked from commit 16c9cdad6f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:34 +01:00
Sean McIntyre
955c0bde09 Add HostConfig.Tmpfs to docs for container creation remote API
Signed-off-by: Sean McIntyre <s.mcintyre@xverba.ca>
(cherry picked from commit 2c38d43eb5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:34 +01:00
Leo Gallucci
a43b40b0d4 Typo --ti and missing my_strace_docker_image
Signed-off-by: Leo Gallucci <leo.gallucci@zalando.de>
(cherry picked from commit a5b69faafb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:34 +01:00
Sebastiaan van Stijn
ec8c61ee22 Update cURL example for cURL 7.40 differences
cURL 7.50 changed the validation for URL's
when using socket connections. cURL 7.4x
did not expect a hostname, whereas cURL
7.5x and above _requires_ a hostname.

See https://github.com/curl/curl/issues/936

This updates the example to take both
versions into account, because cURL 7.4x
is still widely used by distros.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2e0d6e6be2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:34 +01:00
Gerwim
9b63991d16 Update docker_remote_api.md
See https://github.com/docker/docker/issues/26099#issuecomment-245007539

Signed-off-by: Gerwim Feiken <g.feiken@tfe.nl>
(cherry picked from commit 587b186f85)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:34 +01:00
Misty Stanley-Jones
6f3ad4cfc7 Rewrites to Developing Plugins topic
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit b39e65e937)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 20:01:25 +01:00
Victor Vieux
fa791da12c Merge pull request #29299 from andrewhsu/cherry-pick-release-deb
[1.12.x] cherry pick release deb
2016-12-12 10:47:03 -08:00
yuexiao-wang
1b01e2f1df Update the subtitle for stack ps
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 98fb1644c2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 19:10:55 +01:00
Akihiro Suda
fb0b19aa2e
update docs/reference/commandline/network_inspect.md
The following sentences (introduced in v1.11 via #21160) were misleading for Swarm mode services (>= v1.12)

  For networks backed by multi-host network driver, such as Overlay,
  this command also shows the container endpoints in other hosts in the
  cluster. These endpoints are represented as "ep-{endpoint-id}" in the output.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit 2c288e60db)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 19:09:53 +01:00
Ding Fei
05f08f771e
Fix code block fences and typo.
Signed-off-by: Ding Fei <dingfei@stars.org.cn>
(cherry picked from commit 08fe24c2d5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 19:09:44 +01:00
Ding Fei
46cc5c05aa
Fix typos in docs/reference/builder.md.
Signed-off-by: Ding Fei <dingfei@stars.org.cn>
(cherry picked from commit 9ccb1f159e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 19:09:19 +01:00
Sebastiaan van Stijn
06b34e507d
Improve API format examples
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8e02b29d24)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 19:09:08 +01:00
Sebastiaan van Stijn
554400b75b
Add KernelMemory to API changelog
Commit 9bd8a9b66b
added KernelMemory to the API, but forgot
to include this in the API changelog.

This adds the missing entry in the API
changelog.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f988a9ce5e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 19:08:58 +01:00
Sebastiaan van Stijn
6d972ff0f7
Improve example for env vars in API docs
This was added in e41de3e631,
but can be a bit confusing due to the "outer" brackets
being for JSON, and the "inner" brackets to indicate
optional values.

During review of that change, this alternative
format was suggested.

Updating the example to use the format that was discussed
during review :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 441c9411e3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 19:08:48 +01:00
Alicia Lauerman
39466e3144 add documentation for docker stack ps
also updates related stack docs and removes stack_tasks.md

Signed-off-by: Alicia Lauerman <allydevour@me.com>
(cherry picked from commit 970ab9a224)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 19:07:57 +01:00
milindchawre
073515574d
Fixes #27095 : Removing registrytoken field from doc as it is deprecated by identitytoken field
Signed-off-by: milindchawre <milindchawre@gmail.com>
(cherry picked from commit 72dd684c88)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 18:55:40 +01:00
Yong Tang
3707a30459 Update docs for node filter of docker service ps
As is specified in 26964, it is possible to specify
a filter based on the node name or node ID.

This fix updates the related docs for that.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit c326e0afe3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 18:55:03 +01:00
Sebastiaan van Stijn
5dab892618
docs: add missing IPAM options to API docs
Commit dd28ded711
brought in new networking features and API, but
did not document the available IPAM options.

This adds a description of those options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d69fce79f9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-12 18:48:36 +01:00
Derek McGowan
a3cadca8e5 Use sha512 when gpg signing builds
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-12-09 17:57:23 -08:00
Dieter Reuter
7679e0bdfc Include distro name into .deb filename
Right now we do have a problem to store the .debs for raspbian-jessie and
debian-jessie distro version for armhf arch. Both .debs have the same filename
so we have to include the distro version, too.

Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
2016-12-09 17:57:19 -08:00
Victor Vieux
f29c255b2c Merge pull request #29262 from tophj-ibm/update-1.12.x-go-bin
[1.12.x] ppc64le, use official go 1.6.4 binaries
2016-12-09 13:50:43 -08:00
Brian Goff
89da30c482 Merge pull request #29261 from andrewhsu/revert-pr-29188
Revert PR 29188 add selinux policy for centos-7 on 1.12.x branch
2016-12-08 20:36:33 -05:00
Christopher Jones
146400425e
[1.12.x] ppc64le, use official go 1.6.4 binaries
Use official go 1.6.4. binaries instead of downloading and building
from src

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-12-08 19:03:52 -05:00
Andrew Hsu
fe995bdfad Revert "add selinux policy for centos-7"
This reverts commit 7e30cb6e52.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-08 15:49:13 -08:00
Andrew Hsu
4b2b2c0af6 Revert "add extra docker.te lines from rhel7.3 docker.spec"
This reverts commit 5455138728.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-08 15:49:09 -08:00
Andrew Hsu
85aa678ad8 Revert "get rhel7.3 selinux-policy-devel pkg for centos-7"
This reverts commit 97b6626138.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-08 15:49:05 -08:00
Victor Vieux
0d5bc84d06 update changelog
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 13:47:58 -08:00
Victor Vieux
dbbcc8f549 Merge pull request #29141 from mlaventure/1.12.x-containerd-fifo
[1.12.x] Updated containerd to 751172f160d15c234ec4a92d43105326e1195d7e
2016-12-07 13:31:17 -08:00
Victor Vieux
c808ae8c5b Merge pull request #29220 from justincormack/go-up
[1.12] Update Go to 1.6.4
2016-12-07 13:28:02 -08:00
Justin Cormack
b7fe9bf7f5 [1.12] Update Go to 1.6.4
Golang security fix release

Note we still patch for darwin as this has not been merged in 1.6.4.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-12-07 11:42:29 -08:00
Victor Vieux
4a13581d57 Merge pull request #29204 from andrewhsu/changelog-date
[1.12.x] added date after version number in changelog
2016-12-07 11:19:17 -08:00
Andrew Hsu
86ef3fcbbb added date after version number in changelog
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-07 00:52:13 -08:00
Victor Vieux
caa6b86f38 Merge pull request #29187 from vieux/1.12.4-changelog
bump version and changelog for 1.12.4-rc1
2016-12-06 17:40:11 -08:00
Victor Vieux
b5e9291a70 Merge pull request #29188 from andrewhsu/fix-rhel73-for-1-12
add selinux policy for centos-7 on 1.12.x branch
2016-12-06 17:39:57 -08:00
Victor Vieux
bbe7ec7a0a bump version and changelog
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-06 17:37:58 -08:00
Andrew Hsu
97b6626138 get rhel7.3 selinux-policy-devel pkg for centos-7
Resolved conflict of bringing in this patch originally committed
to the 1.13.x branch. For this patch applied to the 1.12.x branch,
did not keep the photon case statement in generate.sh and did not
update to golang 1.7 in the centos-7/Dockerfile.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-06 11:18:21 -08:00
Andrew Hsu
5455138728 add extra docker.te lines from rhel7.3 docker.spec
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-06 11:14:53 -08:00
Andrew Hsu
7e30cb6e52 add selinux policy for centos-7
This policy is from commit
583a67ffdf

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-06 11:14:35 -08:00
Vincent Demeester
f966aae6ae Merge pull request #29150 from vieux/cherry_28026
[1.12.x]  a few cherry-picks
2016-12-06 10:17:23 +01:00
Victor Vieux
cce6065906 Merge pull request #29152 from aaronlehmann/cluster-object-1.12.x
[1.12.x] cluster: Refuse swarm spec not named "default"
2016-12-05 16:36:42 -08:00
Antonio Murdaca
e2b0adeb5c hack/make.sh: fix BUILDTIME
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 7b1f77dcbc)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 16:34:02 -08:00
Victor Vieux
9b70991d10 Merge pull request #29151 from cpuguy83/backport_volume_store_lock_fix
[1.12.x] backport fixes for volume store locking
2016-12-05 16:16:37 -08:00
Victor Vieux
c084bcd5fd Merge pull request #29146 from aboch/c1.12.x
[1.12.x] Porting libnetwork patch
2016-12-05 14:56:55 -08:00
Aaron Lehmann
e374126ed1 cluster: Refuse swarm spec not named "default"
If, using the API, a user submits an init request with a spec that has a
name other than "default", the engine will rename the "default" cluster
object. Some parts of swarmkit depend on having a cluster object named
"default". Reject any specs that use other names.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-05 14:54:51 -08:00
Andrew Hsu
9d7bae7c5d run dnf upgrade before installing in fedora
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit ebd804bfb6)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 14:54:45 -08:00
Stephen J Day
ed6b8d61c6 api/server/httputils: ensure consistent status code
Error code resolution is powered by string matching. Not the greatest
thing in the world and I hope no one is proud of this code, but it
works. However, because a map is used, the iteration order of the map is
random, such that if an error matches two of the snippets, it may return
a different error code depending on the seed of the hashmap. This change
converts it to use a slice instead.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 3484e02590)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 14:30:39 -08:00
Brian Goff
4da9f49339 re-vendor syslog log driver
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 00caf03132)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 14:24:39 -08:00
Brian Goff
0237ba30b6 backport fixes for volume store locking
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-12-05 17:23:53 -05:00
Boaz Shuster
d99532f55d Return an empty stats if the container is restarting
In case, a container is restarting indefinitely running
"docker stats --no-stream <restarting_container>" is suspended.

To fix this, the daemon makes sure the container is either not
running or restarting if `--no-stream` is set to true and if so
returns an empty stats.

Should fix #27772.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
(cherry picked from commit 786a95493d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 14:19:06 -08:00
Victor Vieux
560d0d25c1 Merge pull request #29093 from dmcgowan/backport-fix-27298
[1.12.x] Ensure opaque directory permissions respected
2016-12-05 13:46:44 -08:00
Victor Vieux
7613b23a58 Merge pull request #29083 from cpuguy83/fix_volume_rm_metadata
[1.12.x] Fix issue where volume metadata was not removed
2016-12-05 13:46:20 -08:00
Alessandro Boch
f54df35bc0 [1.12.x] Porting libnetwork patch
- Honor ICC setting for internal network

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-12-05 13:06:30 -08:00
Brian Goff
04825beac4 Fix issue where volume metadata was not removed
Basically, we create some on-disk metadata about the volume to store
things like volume labels.
This was never being cleaned up when the volume is removed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-12-05 13:46:55 -05:00
Kenfe-Mickael Laventure
b01949b19a Updated containerd to 751172f160d15c234ec4a92d43105326e1195d7e
This adds the use of tonistiigi/fifo

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-12-05 09:53:18 -08:00
Victor Vieux
7b9deca3e0 Merge pull request #29095 from tonistiigi/1.12-io-fixes
[v1.12] backported IO fixes for v1.12
2016-12-05 00:45:03 -08:00
Vincent Demeester
a751f94ca0 Small log formatting fixes
… and clise to close 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 2f7e907846)
2016-12-02 18:10:25 -08:00
Tonis Tiigi
a2a983c770 Don’t warn on missing fifo
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit ee9d28bd3f)
2016-12-02 18:10:25 -08:00
Tonis Tiigi
06092267aa vendor: update fifo to fe870ccf2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-12-02 18:10:16 -08:00
Tonis Tiigi
1e69caad8c Fix logging formatting
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit aa01ee4ac5)
2016-12-02 18:09:13 -08:00
Tonis Tiigi
e136d3ef93 Move stdio attach from libcontainerd backend to callback
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 37a3be2449)
2016-12-02 18:09:10 -08:00
Tonis Tiigi
7e98d12157 Refactor stdin closing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 6f2658fb8c)
2016-12-02 18:09:06 -08:00
Alexander Morozov
c17155fbc3 libcontainerd: attach streams before create
Fix #26371

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 02d1934279)
2016-12-02 18:09:00 -08:00
Tonis Tiigi
6781d1912d Fix issues with fifos blocking on open
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 6d26464502)
2016-12-02 18:08:57 -08:00
Victor Vieux
0c3e2e1556 Merge pull request #29089 from vieux/fix_plugin_tests
[1.12.x] "fix" plugin tests
2016-12-02 16:57:41 -08:00
Victor Vieux
f25e197379 Merge pull request #29004 from aboch/c1.12.x
[1.12.x] Porting libnetwork fixes
2016-12-02 16:28:26 -08:00
Derek McGowan
50841b16fe
Ensure opaque directory permissions respected
When converting an opaque directory always keep the original
directory tar entry to ensure directory is created with correct
permissions on restore.

Closes #27298

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-12-02 16:16:59 -08:00
Victor Vieux
6756f1d160 Merge pull request #29047 from aaronlehmann/vendor-1.12-swarmkit
[1.12.x] Vendor swarmkit
2016-12-02 15:26:48 -08:00
Victor Vieux
f90c1625e9 Merge pull request #28990 from vdemeester/28985-dont-validate-hostname-on-1_12
[1.12.x] Remove hostname validation as it seems to break users
2016-12-02 15:10:59 -08:00
Victor Vieux
c54e23e38a Merge pull request #29050 from cpuguy83/1.12.4-cherrypicks
[1.12.x] backport 2 fixes
2016-12-02 15:10:30 -08:00
Victor Vieux
e3034309b3 "fix" plugin tests in 1.12.x
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 15:00:59 -08:00
Dan Walsh
403c9b9676 We need to relabel newly created container volumes
This will add a label to any volume that is shared into a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
(cherry picked from commit 5a277c8a4a)
2016-12-01 21:41:46 -05:00
Darren Stahl
7e902398f9 Stop holding container lock while waiting on streams
Signed-off-by: Darren Stahl <darst@microsoft.com>
(cherry picked from commit 07cd19655b)
2016-12-01 21:40:04 -05:00
Aaron Lehmann
020915ca30 Vendor swarmkit
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-01 16:39:14 -08:00
Tom Denham
76d2f1f29b Update tests to handle bug fix from libnetwork
Signed-off-by: Tom Denham <tom@tomdee.co.uk>
2016-11-30 16:16:34 -08:00
Alessandro Boch
d619f3d669 Porting libnetwork fixes to 1.12.x
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-30 14:40:39 -08:00
Vincent Demeester
bfd123b2a9
Remove hostname validation as it seems to break users
Validation is still done by swarmkit on the service side.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-30 19:21:28 +01:00
Vincent Demeester
d77269a802 Merge pull request #28652 from gjtempleton/Fix-Inspect-docs
Add missing quote mark and fix grammar in inspect docs
2016-11-21 11:02:21 +01:00
GuyTempleton
1d7418f212 Add missing quote mark and fix grammar in inspect docs
Signed-off-by: GuyTempleton <Guy.Templeton@skyscanner.net>
2016-11-21 09:10:28 +00:00
Misty Stanley-Jones
6a0ce4924f Merge pull request #28262 from mstanleyjones/more_metadata_fixes
Change metadata for plugin ref docs and deprecation doc
2016-11-10 13:50:34 -08:00
Misty Stanley-Jones
438d8fa3db Change metadata for plugin ref docs and deprecation doc
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-11-10 13:49:13 -08:00
Misty Stanley-Jones
5025b97c1d Merge pull request #28174 from mstanleyjones/112x_metadata_change
Formatting changes to make 1.12.x ref docs buildable in Jekyll
2016-11-09 13:55:06 -08:00
Misty Stanley-Jones
cf60af87f9 Formatting changes to make 1.12.x ref docs buildable in Jekyll
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-11-09 13:07:24 -08:00
Victor Vieux
6b644ecc19 Bump VERSION to v1.12.3
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-26 10:48:43 -07:00
Sebastiaan van Stijn
bad4d1299e Merge pull request #27704 from andrewhsu/fix-changelog
added date to version number in changelog
2016-10-24 17:13:21 -07:00
Andrew Hsu
e64bf8c3cd added date to version number in changelog
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-10-24 17:00:02 -07:00
Victor Vieux
ebe2e9cf85 update CHANGELOG.md
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-21 21:18:23 -07:00
Michael Crosby
ca151de73c Merge pull request #27693 from mlaventure/update-containerd-fix-json-compat
Update containerd to b818e749726ba18e430bb825396c85408dfaf2a4
2016-10-24 13:29:24 -07:00
Kenfe-Mickael Laventure
ec98dcb56d Update containerd to b818e749726ba18e430bb825396c85408dfaf2a4
This add backward compatibility with the event logs format prior to
1.12.2.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-24 11:33:26 -07:00
Victor Vieux
a154321efc Bump VERSION to v1.12.3-rc1
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-21 18:13:30 -07:00
Victor Vieux
190a96131c Merge pull request #27634 from justincormack/user-cap-test
Test that non root user cannot use default capabilities
2016-10-24 01:26:02 -07:00
Victor Vieux
c5ac1fcc29 Merge pull request #27611 from vieux/changelog-1.12.3
1.12.3 Changelog
2016-10-24 01:24:56 -07:00
Justin Cormack
5c0c9e4587 Test that non root user cannot use default capabilities
Test for #27590

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-10-22 12:18:43 +01:00
Victor Vieux
548f8f0895 1.12.3 Changelog
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-21 17:15:59 -07:00
Victor Vieux
d1a1b9692a Merge pull request #27595 from vieux/cherry-picks-1.12.3
cherry-picks 1.12.3
2016-10-21 16:59:01 -07:00
Tonis Tiigi
a8ffa0128c chroot: remount everything as private in new mntns
If parent of the destination path is shared, this
path will be unmounted from the parent ns even if
the path itself is private.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit b511d1f0ca)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-21 14:59:58 -07:00
Tonis Tiigi
3f21a28ec0 chroot: let root be cleaned up by kernel
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 70dfea63ba)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-21 14:59:50 -07:00
Victor Vieux
ed879071ec Merge pull request #27610 from crosbymichael/update-runc
Bump runc to f59ba3cdd76fdc08c004f42aa915996f6f420899
2016-10-21 14:23:43 -07:00
Michael Crosby
d60a3418d0 Bump runc to f59ba3cdd76fdc08c004f42aa915996f6f420899
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-10-21 12:49:30 -07:00
Kay Yan
3b9269760c Fix conversion of restart-policy from GRPC
restart-condition for services from "on_failure" to "on-failure".

Since GRPC does not support dashes in properties, this change
added a conversion when _setting_ the restart-condition.

However, when inspecting a service, no conversion took place
from the internal GRPC value, resulting in "on_failure" to
be shown.

This change updates the conversion to fix this, and removes
a "hack" that was previously used for this, now using a
Switch to compare to actual types.

Before this change:

    docker service create --name web --restart-condition=on-failure nginx:alpine

    docker service inspect --format '{{ json .Spec.TaskTemplate.RestartPolicy }}' web
    {"Condition":"on_failure","MaxAttempts":0}

Afer this change:

    docker service create --name web --restart-condition=on-failure nginx:alpine

    docker service inspect --format '{{ json .Spec.TaskTemplate.RestartPolicy }}' web
    {"Condition":"on-failure","MaxAttempts":0}

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
(cherry picked from commit bc32fcabeb)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 13:24:32 -07:00
allencloud
defb41068c add \n in engine labels display in docker node inspect xxx --pretty
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit ddec4c3ee4)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 13:24:23 -07:00
Victor Vieux
8bc5f43b14 Merge pull request #27559 from aboch/c1.12.x
Vendoring libnetwork for 1.12.3
2016-10-20 12:06:27 -07:00
Tonis Tiigi
16f11aef3c Fix error reporting in CopyFileWithTar
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 57e12037ac)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 11:38:58 -07:00
allencloud
7ae3379a64 add lock in libcontainerd client AddProcess of Windows
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 5143be0ccf)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 11:38:36 -07:00
Felix Ruess
1552aa3d9a builder: update deb armhf ubuntu-trusty buildtags
Signed-off-by: Felix Ruess <felix.ruess@gmail.com>
(cherry picked from commit 63515bc59e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 11:37:01 -07:00
Thomas Leonard
351799f4f0 Reset health status to starting when a container is restarted
Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
(cherry picked from commit b8793cff48)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 11:36:43 -07:00
Jean-Christophe Berthon
72875b0d01 builder: Add AppArmor to runc buildtags for armhf
On Raspbian and Debian Jessie for ARMv7 (aka armhf), the builtags for runc
were missing. These buildtags should include 'apparmor' and 'selinux'.

Signed-off-by: Jean-Christophe Berthon <huygens@berthon.eu>
(cherry picked from commit e0c7300e3b)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 11:36:29 -07:00
Satoshi Tagomori
659509e40b Update fluent-logger-golang to v1.2.1
This fixes a regression bug not to connect the destination node twice or more.
That regression was brought by v1.2.0, and it also makes many goroutines for
first reconnection (these will finish after first reconnection established).

Signed-off-by: Satoshi Tagomori <tagomoris@gmail.com>
(cherry picked from commit 53ed17449e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-20 11:36:10 -07:00
Victor Vieux
30a4d7e3db Merge pull request #27554 from aaronlehmann/vendor-swarmkit-1.12.3
Vendor swarmkit for 1.12.3
2016-10-20 11:23:11 -07:00
Alessandro Boch
882e8d5d75 Vendoring libnetwork for 1.12.3
- It includes few fixes which prevent a
  deadlock, a panic, a couple of races,
  and a regression.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-10-19 13:01:50 -07:00
Aaron Lehmann
109b53d882 Vendor swarmkit for 1.12.3
This updates swarmkit to include a few important bug fixes, including
some fixes for regressions.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-19 10:23:27 -07:00
Victor Vieux
bb80604a0b Bump VERSION to v1.12.2
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-11 05:23:52 +00:00
Kenfe-Mickaël Laventure
91d8560fc0 Merge pull request #27216 from andrewhsu/add-missing-changelog
add changelog lines for swarmkit and libnetwork
2016-10-10 07:32:00 -07:00
Andrew Hsu
feb59d32d7 add changelog lines for swarmkit and libnetwork
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-10-07 13:10:44 -07:00
Victor Vieux
cb0ca64a34 Bump VERSION to v1.12.2-rc3
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-06 21:27:01 +00:00
Victor Vieux
841c5f9166 update changelog
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-06 14:26:27 -07:00
Tibor Vass
026f385aa3 install: fix debian stretch
Apparently, Debian stretch does not come with gpg installed by
default. This patch ensures that gpg is installed.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 047264763a)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-06 14:24:36 -07:00
Victor Vieux
1863675001 Merge pull request #27196 from mlaventure/update-containerd-1.12.x
[1.12.2] Update containerd and runc
2016-10-06 11:46:20 -07:00
Kenfe-Mickael Laventure
3377b4b9b7 Update containerd and runc
containerd: 0366d7e9693c930cf18c0f50cc16acec064e96c5
runc: 02f8fa7863dd3f82909a73e2061897828460d52f

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-06 09:28:08 -07:00
Brian Goff
d82e3bf952 Merge pull request #27180 from aboch/c1.12.x
Vendoring libnetwork & swarmkit to address #27147
2016-10-06 15:50:53 +02:00
Alessandro Boch
cb58783630 Vendoring libnetwork & swarmkit to address #27147
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-10-05 21:16:04 -07:00
Victor Vieux
d72629e18f add awscli to arm Dockerfile
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit dbec45fa7a)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-04 18:46:58 -07:00
Victor Vieux
ad9538afc2 Bump VERSION to v1.12.2-rc2
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-04 05:37:23 +00:00
Victor Vieux
545d909aac Merge pull request #27079 from vieux/cherry-picks-and-changelog-1.12.2
Cherry-picks and Changelog 1.12.2-rc2
2016-10-03 22:34:24 -07:00
Victor Vieux
0e7c6b8496 Merge pull request #27120 from mavenugo/vin_ln
Vendoring libnetwork 9fc9609b
2016-10-03 15:42:24 -07:00
Madhu Venugopal
d11648696f Vendoring libnetwork 9fc9609b
Cherry-picking fix for #27109

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-10-03 12:09:45 -07:00
Kenfe-Mickael Laventure
5d04e28d9e Remove amd64 assumption in release.sh, cross and tgz scripts
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 61335bcb03)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-01 02:47:49 -07:00
alexchen
1767966502 add check flag for CONFIG_NETFILTER_XT_MATCH_IPVS CONFIG_IP_VS_NFCT CONFIG_IP_VS_RR in contrib/check-config.sh
Signed-off-by: alexchen <alexchenunix@gmail.com>
(cherry picked from commit 4c74469d30)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-10-01 02:15:25 -07:00
Vincent Demeester
5aa44019b0 Merge pull request #27077 from LK4D4/update_swarmkit
vendor: update swarmkit for 1.12.2
2016-10-01 10:39:54 +02:00
allencloud
180d122c5b make remove network return 204
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit ea07ef7a7c)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-30 22:49:20 -07:00
allencloud
9975fcbe1c add lock in libcontainerd client AddProcess
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 278273bc16)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-30 21:47:33 -07:00
Victor Vieux
1c0d9a4a90 Update date for 1.12.2-rc2
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-30 14:57:34 -07:00
Daniel Nephin
458bd3663b Use ListOpt for labels.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 6c3b44f755)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-30 14:56:13 -07:00
Justin Cormack
64ae81609c Run seccomp tests in series not parallel
Fix #24803 as this had been failing sometimes.

As the parallel tests are probably genuine failures, and
had already been cut down, I will re-create these specifically
as a parallel execution test with no seccomp to make the
cause clearer.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 84ec04306c)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-30 14:30:47 -07:00
Alexander Morozov
d29db3a55a vendor: update swarmkit for 1.12.2
This includes:
docker/swarmkit#1588
docker/swarmkit#1592
docker/swarmkit#1594

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-30 14:18:45 -07:00
Sebastiaan van Stijn
0a6b4c2d9c Merge pull request #27048 from thaJeztah/disable-api-1.25
[1.12.x] Hide API v1.25 docs
2016-09-29 23:33:35 +02:00
Sebastiaan van Stijn
d49c31e3c1
Hide API v1.25 docs
API v1.25 is for Docker 1.13. Commit
4da24ca1e3 was meant
to put it in draft mode, but added this
option in the "menu" section.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 23:18:12 +02:00
Misty Stanley-Jones
3134c23b55 Merge pull request #27040 from mstanleyjones/fix_labels_nav_pick
Merge pull request #27036 from mstanleyjones/fix_labels_nav
2016-09-29 11:12:42 -07:00
Misty Stanley-Jones
a114655b56 Merge pull request #27036 from mstanleyjones/fix_labels_nav
Fix menu position of the labels-custom-metadata.md topic
(cherry picked from commit a3286783bc)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-29 11:05:34 -07:00
Sebastiaan van Stijn
88ce3d60b9 Merge pull request #27032 from mstanleyjones/fix_image_link_pick
Merge pull request #27031 from mstanleyjones/fix_broken_image_link
2016-09-29 19:27:49 +02:00
Sebastiaan van Stijn
ed69445474 Merge pull request #27031 from mstanleyjones/fix_broken_image_link
Revert "Add direct link to event chart image"
(cherry picked from commit 6f07a4a69b)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-29 10:23:10 -07:00
Sebastiaan van Stijn
cd15b2b300 Merge pull request #27022 from thaJeztah/docs-cherry-picks-1.12.2
Docs cherry picks 1.12.2
2016-09-29 17:58:12 +02:00
Misty Stanley-Jones
68aca71637
Fix link to non-existent file
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit ca04f02d76)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:29:07 +02:00
Victoria Bialas
735622fdf4
added better Docker Machine links to Swarm tutorial d4mac, d4win, copyedits
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
(cherry picked from commit 0a76a4cb5b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:29:00 +02:00
Sebastiaan van Stijn
ca474f7808
Fix incorrect aux-address examples and test
The (host)name for aux-addresses should
be unique, otherwise later values overwrite
earlier values.

Before this change, the example command
would send this API request;

    {
      "Attachable": false,
      "CheckDuplicate": true,
      "Driver": "overlay",
      "EnableIPv6": false,
      "IPAM": {
        "Config": [
          {
            "Gateway": "192.168.0.100",
            "IPRange": "192.168.1.0/24",
            "Subnet": "192.168.0.0/16"
          },
          {
            "AuxiliaryAddresses": {
              "a": "192.170.1.5",
              "b": "192.170.1.6"
            },
            "Gateway": "192.170.0.100",
            "Subnet": "192.170.0.0/16"
          }
        ],
        "Driver": "default",
        "Options": {
        }
      },
      "Internal": false,
      "Labels": {
      },
      "Name": "my-multihost-network",
      "Options": {
      }
    }

After this change, the request looks
like this (all aux-addresses preserved);

    {
      "Attachable": false,
      "CheckDuplicate": true,
      "Driver": "overlay",
      "EnableIPv6": false,
      "IPAM": {
        "Config": [
          {
            "AuxiliaryAddresses": {
              "my-router": "192.168.1.5",
              "my-switch": "192.168.1.6"
            },
            "Gateway": "192.168.0.100",
            "IPRange": "192.168.1.0/24",
            "Subnet": "192.168.0.0/16"
          },
          {
            "AuxiliaryAddresses": {
              "my-printer": "192.170.1.5",
              "my-nas": "192.170.1.6"
            },
            "Gateway": "192.170.0.100",
            "Subnet": "192.170.0.0/16"
          }
        ],
        "Driver": "default",
        "Options": {
        }
      },
      "Internal": false,
      "Labels": {
      },
      "Name": "my-multihost-network",
      "Options": {
      }
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fd7161bb30)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:28:52 +02:00
allencloud
c93303b8d7
move mcvlan out of experimental docs
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 6e4ec046f4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:28:35 +02:00
yuexiao-wang
96b5ec8f50
Fix the broken link
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit cfb07e642d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:28:29 +02:00
yuexiao-wang
394ce0c9c1
Fix typo for how pki works
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit bf9c6d3115)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:28:22 +02:00
lixiaobing10051267
729717568b
the network id is not consistant with the real id created
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit 392aae44fd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:28:16 +02:00
Sebastiaan van Stijn
fc884da817
Add missing API docs for "privileged" and "user" exec
The "user" feature was added in docker 1.7.0, and
"privileged" feature was added in docker 1.9.0
only contained CLI docs.

This adds the missing API docs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c53efdf4c1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:28:09 +02:00
Hans Kristian Flaatten
9363b42e59
docs: add missing 'on' in Oracle installation guide
Signed-off-by: Hans Kristian Flaatten <hans.flaatten@evry.com>
(cherry picked from commit 838fe65e53)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:28:02 +02:00
Jeff Silberman
2659333a27
Add Portworx Volume Plugin Description
Signed-off-by: Jeff Silberman <jsilberm@gmail.com>
(cherry picked from commit da2159ea1c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:27:55 +02:00
Misty Stanley-Jones
67610e9dea
Restructure content about Docker object labels
A few points of work:

- Took the topic out of the left-hand nav and made it
  reachable from the User guide intro

- Condensed the topic's contents, presenting only conceptual
  info and pointing instead to the command-line references
  for each type of object

- Added brief information about the `LABELS` keyword to the
  Dockerfile reference

A big part of the point is to establish a pattern of
thinking and use around how Docker uses labels and what they
mean in different contexts.

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 5c4c062ffc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:27:48 +02:00
Sebastiaan van Stijn
121cd6f9e6
Fix incorrectly named API options
This renames `MaximumIOps` to `IOMaximumBandwidth`,
and `MaximumIOBps` to `IOMaximumIOps` to match
the actual code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 36a25bdbe4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:27:41 +02:00
yuexiao-wang
d4288a3212
Update on index refernce documentation
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 0483d77613)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:27:34 +02:00
Sebastiaan van Stijn
cdda81146b
Update API docs for "HostConfig.Binds"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 708892c403)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:27:27 +02:00
Steven Erenst
ddc58225f3
Fix regex for the json-file logger opts in overview.md
The regex used to describe the max-file and max-size logging options for
the json-file logger were incorrect. The regexes would only match a
single character (a digit or a literal +). Instead the regexes should
match 1 or more digits.

The character class for the units of the max-size also included a pipe
which meant that the regex would match 1| instead of only matching 1m,
1k, and 1g.

Signed-off-by: Steven Erenst <stevenerenst@gmail.com>
(cherry picked from commit e9a9015e38)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:27:21 +02:00
Sebastiaan van Stijn
22a3332325
Cleanup / sync RHEL, CentOS, Fedora installation docs
These installation procedures are very similar, so
synchronized these docs and removed some differences.

Also;

- updated markdown, added language-hints where possible
- replaced "service docker start" with "systemctl start"
- replaced "chkconfig docker on" with "systemctl enable"
- added "systemctl enable" to the list of steps for
  installation, because most people want to have docker
  started automatically (and overlooked this step).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b2bb4e11aa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:27:14 +02:00
Alex Olshansky
7df1b6a962
Fix typos in installation doc for Mac
Signed-off-by: Alex Olshansky <i@creagenics.com>
(cherry picked from commit f7af5cc780)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:27:06 +02:00
Sebastiaan van Stijn
7da3e5d0b2
Fix Markdown formatting and missing prompt in service create
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 533b00da8b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:26:59 +02:00
Sebastiaan van Stijn
03a4e9a397
Update sshd example to use ubuntu 16.04
Although the example is just for illustrational
purposes, many users are now switching to
Ubuntu 16.04 as the "default" version for Ubuntu,
so updating the example for those that use
this example as a starting point.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b81d12e7a1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:26:52 +02:00
yuexiao-wang
5508a82cac
fix typo for docs reference
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 0f0b0db842)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:26:45 +02:00
Misty Stanley-Jones
0e29518469 Misty's edits and additions
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 3de7d725137ee1620ae2050e65ace4990a3af87e)
(cherry picked from commit 5880d62953)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:26:28 +02:00
Sebastiaan van Stijn
3bd4612aaf
Add --mount syntax documentation to CLI reference
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit eb3a01eb43)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:25:31 +02:00
YuPengZTE
f81e4e8d57
The hit is missed
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
(cherry picked from commit ced2729841)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:25:24 +02:00
pestophagous
1edf705917
Fix typo in docs. s/methodoligies/methodologies/
Signed-off-by: K Heller <pestophagous@gmail.com>
(cherry picked from commit 191adcfb63)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:25:15 +02:00
Sebastiaan van Stijn
9a207a7eb7
Synchronize API docs
This synchronizes changes between API versions, and:

- applies e0a552504e to
  older versions of the documentation
- applies a2a0a03e2b to
  API version 1.25
- syncs some minor differences

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 53b1dcb25c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:25:09 +02:00
Sebastiaan van Stijn
ac1eb9edd0
Fix service and tasks API documentation
The documentation contained some outdated information
on these endpoints.

This change fixes those parts of the documentation

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d69409fd43)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:25:02 +02:00
lixiaobing10051267
f9f6145003
add bash symbol for docker network inspect
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit 7c3a26db16)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:24:55 +02:00
Alessandro Boch
e289fc155a
Fix mtu option in documentation
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit e74a937b00)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:24:46 +02:00
YuPengZTE
8ae21d6d4d
The etc and dot is seprated
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
(cherry picked from commit bd914ff5a3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:24:38 +02:00
Josh Bodah
bcc70e52eb
Remove extra paren in run --link docs
Signed-off-by: Josh Bodah <jb3689@yahoo.com>
(cherry picked from commit 484fbe236d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:24:29 +02:00
Sebastiaan van Stijn
c84d8b8360 Use "sudo" for dockerd examples
Because we standardize on using a non-privileged
prompt (`$`) instead of `#`, replacing the
examples to use `sudo` instead to indicate
this has to be run as root.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 87b174080b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:23:30 +02:00
Sebastiaan van Stijn
ae9b46dbd0
Add link to logging drivers reference
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7ca02f86de)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:17:53 +02:00
Antonio Murdaca
7fad9da9f2
docs: reference: api: clarify pull all tags
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 03a8b6798d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:17:45 +02:00
Sebastiaan van Stijn
a8aaf5bfad
Synchronize push reference with man page
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit dddea689ab)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:17:37 +02:00
Sebastiaan van Stijn
c6ba6498b3
Restore missing "format" example
The "format" example got lost during the
rewrite of the documentation for Cobra. This
restores the missing example.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit edbb8fb86d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:17:29 +02:00
Yong Tang
af46f0242e
Fix a couple of issues in Get Started docs
This fix fixes a couple of issues in Get Started docs' Step Four:
1. `Sending build context to Docker daemon 158.8 MB` should be
`Sending build context to Docker daemon 2.048 kB` as there is only
one Dockerfile for context.

2. There are only 3 steps altogether in stead of 4 steps as
`RUN apt-get -y update && apt-get install -y fortunes` is one step.
So `Step 3 : RUN apt-get install -y fortunes` should be removed and
`Step 4 : CMD /usr/games/fortune -a | cowsay` should be changed to
`Step 3 : CMD /usr/games/fortune -a | cowsay`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 1cd06fdd1a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:17:22 +02:00
Sebastiaan van Stijn
c9ce561ac0
Add direct link to event chart image
This adds a direct link to the event chart image
so that the full-resolution image can be "zoomed"
in to.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 86de72fef2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:17:14 +02:00
Sebastiaan van Stijn
792c545f52
Remove Frugalware installation docs
These docs were outdated, and not actively
maintained. Also, there are no official packages
available for this distribution, so better to
remove it from the documentation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9b8b6aa224)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:17:06 +02:00
Victor Vieux
cd589e16c8
add some plugin manifest reference doc
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 44a16acff1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:16:57 +02:00
lixiaobing10051267
bc97dc1e50
remove some incorrect bash symbols
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit 2d1d4684f0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-29 14:16:46 +02:00
Victor Vieux
45bed2cc80 Bump VERSION to v1.12.2-rc1
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-27 20:37:47 +00:00
Victor Vieux
1ec9ca1ca6 Merge pull request #26866 from docker/cherry-picks-1.12.2
Cherry picks 1.12.2
2016-09-27 13:33:29 -07:00
Brian Goff
707163c38c Merge pull request #26949 from thaJeztah/revert-docker-create-rm
1.12 Revert "Merge pull request #26030 from yongtang/08252016-doc-doc…
2016-09-27 16:20:32 -04:00
Sebastiaan van Stijn
8f598d9027 Merge pull request #26956 from vieux/changelog-1.12.2
Update CHANGELOG for 1.12.2
2016-09-27 21:00:48 +02:00
Victor Vieux
3d8e9bfcda Merge pull request #26953 from mavenugo/gossip_retry
Vendor libnetwork#1473
2016-09-27 11:37:29 -07:00
Madhu Venugopal
2d183336ec Vendor libnetwork#1473
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-09-27 09:23:59 -07:00
Sebastiaan van Stijn
e9c655442a
1.12 Revert "Merge pull request #26030 from yongtang/08252016-doc-docker-create-rm"
This reverts commit 44180a48e9,
as `docker create --rm` is part of docker 1.13, so should
not be in the 1.12 branch

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-27 16:33:53 +02:00
Victor Vieux
f25dffe56a Update CHANGELOG for 1.12.2
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 23:56:07 -07:00
Aaron Lehmann
b6943c50f1 cluster: Do not autodetect advertise address on join
On join, remote addresses are supposed to be detected by the manager
that receives the join request. However, the daemon is interfering with
this by automatically detecting an advertise address and specifying that
to the remote manager. Fix this so that an advertise address is only
specified while joining a cluster if one was given by the user.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit b1d2b08853)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 21:02:54 -07:00
Ji.Zhilong
d5aaaa7ea3 devmapper: prevent libdevmapper from deleting device symlinks in RemoveDeviceDeferred
if there is no cookie set in dm task, or flag DM_UDEV_DISABLE_LIBRARY_FALLBACK
is cleared for a DM_DEV_REMOVE task, libdevmapper will fallback to clean up the
symlink under /dev/mapper by itself, no matter the device removal is executed
immediately or deferred by the kernel.In some cases, the removal is deferred by the
kernel, while the symlink is deleted directly by libdevmapper, when docker tries to
activate the device again, the deferred removal will be canceld, but the symlink will
not show up again, so docker's attempt to mount the device by the symlink will fail,
and it will eventually leads to a `docker start/diff` error.

Fixes #24671

Signed-off-by: Ji.Zhilong <zhilongji@gmail.com>
(cherry picked from commit 5e505d101f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:35:43 -07:00
Yong Tang
f2a48d2ff3 Fix AuthZ plugins headers change issue
This fix tries to address the issue raised in 25927 where
the HTTP headers have been chaged when AUthZ plugin is in
place.

This issue is that in `FlushAll` (`pkg/authorization/response.go`),
the headers have been written (with `WriteHeader`) before all the
headers have bee copied.

This fix fixes the issue by placing `WriteHeader` after.

A test has been added to cover the changes.`

This fix fixes 25927

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 9cb8fb6ea0)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:35:37 -07:00
Satoshi Tagomori
32b0633f65 Update fluent-logger-golang to v1.2.0.
Fix race condition issue to solve an issue about "panic: runtime error: invalid memory address or nil pointer dereference".
This fix stabilize Docker daemon under the situation of communication problem with Fluentd processes.

Signed-off-by: Satoshi Tagomori <tagomoris@gmail.com>
(cherry picked from commit 87124b9d62)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:35:31 -07:00
Thomas Leonard
5592ee4d07 Fix exec form of HEALTHCHECK CMD
We attached the JSON flag to the wrong AST node, causing Docker to treat
the exec form ["binary", "arg"] as if the shell form "binary arg" had
been used. This failed if "ls" was not present.

Added a test to detect this.

Fixes #26174

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
(cherry picked from commit e95b6b51da)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:35:24 -07:00
Ron Williams
f4650e2eb8 Force input stream ANSI emulation for ConEmu.
Signed-off-by: Ron Williams <ron.a.williams@gmail.com>
(cherry picked from commit 0fd4bbda2d)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:35:18 -07:00
Anusha Ragunathan
5619e72a34 Add retry logic during aufs unmount.
Treat EBUSY as a transient error and retry. Also stop ignoring unmount errors.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 0e539fec33)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:35:12 -07:00
Brian Goff
a1d191d91e re-vendor syslog package
Fixes #26394

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit f528690674)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:34:59 -07:00
Misty Stanley-Jones
708a93a800 'docker node inspect <node> --pretty' needs an extra newline at the end
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 341489f150)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:34:11 -07:00
Alessandro Boch
2be91b121b Vendoring boltdb @fff57c100
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit 5cfbdceafe)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:34:04 -07:00
Yanqiang Miao
0dcd2e1a5d Remove the support of setting host configuration options when the container starts
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 26b6b47420)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:33:58 -07:00
Yong Tang
e892a54fa1 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>
(cherry picked from commit b9e46235fa)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:33:52 -07:00
Misty Stanley-Jones
24df982128 Clarify usage of --force when used on a swarm manager
Fixes #26125

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 7b5c3d935a)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:33:45 -07:00
Liam Macgillavry
fd7e763e7c missed DOCKER->DOCKERD change in 1ac1b78b3a for 'status'
Signed-off-by: Liam Macgillavry <liam@kumina.nl>
(cherry picked from commit 11eda60848)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:33:36 -07:00
Christopher Jones
132a8e7963 ppc64le: remove go SHA check
Makes it consistent with other Dockerfiles.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit d9e12cba5a)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:33:30 -07:00
Michael Crosby
aaaeb84ac6 Check for non-nil container after match
There can be a race between getting the container ids for matches and
getting the actual container.  This makes sure that we check that the
container returned by `Get` is non-nil before adding it to the list of
matches.

Fixes #25991

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit a020ec4c8b)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-09-26 19:33:23 -07:00
Victor Vieux
667c02ce8c Merge pull request #26765 from aaronlehmann/swarmkit-1.12.2
Vendor SwarmKit for 1.12.2
2016-09-26 13:05:52 -07:00
Victor Vieux
38aa258343 Merge pull request #26874 from mlaventure/1.12.2-vendor-containerd
Vendor in containerd
2016-09-26 12:55:57 -07:00
Kenfe-Mickael Laventure
727402135d Vendor in containerd
This brings in the exec's children handling fixes

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-25 05:23:22 -07:00
Victor Vieux
03da508273 Merge pull request #26875 from justincormack/1.12.x-sierra-go
Patch Go with fix for OSX Sierra
2016-09-25 00:17:00 -07:00
Victor Vieux
e4040acb01 Merge pull request #26879 from mavenugo/ln_1.12.2
Vendoring libnetwork e282a91b294ab413a172b3c4e37d15fa92d79ef5
2016-09-25 00:10:50 -07:00
Jana Radhakrishnan
df3209b4d6 Add GetListenAddress in ClusterProvider
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-23 17:30:36 -07:00
Madhu Venugopal
0ce34bdb12 Vendoring libnetwork e282a91b294ab413a172b3c4e37d15fa92d79ef5
Carries a bunch of patches to resolve routing-mesh and swarm-mode
networking issues.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-09-23 17:26:40 -07:00
Justin Cormack
ef634b95f4 Patch Go with fix for OSX Sierra
Backport this patch to the Go 1.6.3 runtime needed for OSX Sierra.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-09-23 23:30:25 +01:00
Aaron Lehmann
33e855f8ae Vendor swarmkit for 1.12.2
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-09-23 09:58:27 -07:00
Sebastiaan van Stijn
07fcfd0c28 Merge pull request #26777 from vdemeester/1.12.x
Fixing Regression in exit codes in 1.12
2016-09-23 17:26:55 +02:00
Vincent Demeester
1bcc2d9ab7 Fixing Regression in exit codes in 1.12
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-09-21 20:43:02 +02:00
Sebastiaan van Stijn
e646e927ee Merge pull request #26707 from thaJeztah/revert-26320
[1.12.x] Revert "Merge pull request #26320 from yongtang/09052016-man-docker-c…
2016-09-21 19:49:06 +02:00
Sebastiaan van Stijn
f885d8ed5c
Revert "Merge pull request #26320 from yongtang/09052016-man-docker-create"
This reverts commit f1d590c45b, which does
not apply to 1.12.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-21 19:48:43 +02:00
Sebastiaan van Stijn
bb45417c91 Merge pull request #26603 from mstanleyjones/2016.09.13_cherry_picks
2016.09.13 cherry picks
2016-09-16 23:08:02 +02:00
Misty Stanley-Jones
4da24ca1e3 Set docker_remote_api_v1.25.md to draft in 1.12.x branch
It does not apply to 1.12.x but we are leaving the file in place
to make future cherry-picks easier.

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-16 10:03:13 -07:00
Sebastiaan van Stijn
99ed95cb57 Merge pull request #26526 from lixiaobing10051267/masterSymble
fix some incorrect symbols before executing command
(cherry picked from commit 9e9ba1e1c1)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-16 10:03:13 -07:00
Justin Cormack
787ed27c32 Merge pull request #26496 from riyazdf/trust-sandbox-fix
Use latest version of notary server in trust sandbox docs
(cherry picked from commit 6fafd07282)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-16 10:03:12 -07:00
Brian Goff
9ec857ad5a Merge pull request #26472 from yongtang/09112016-docker-build-step-0
Fix documentation for `Step 0` to `Step 1` in `docker build`
(cherry picked from commit e41839e8a1)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-16 10:03:12 -07:00
Sven Dowideit
f784166e8a Merge pull request #26458 from sfsmithcha/fix_vip_diagram
updates swarm overlay network diagram
(cherry picked from commit ae4582dc28)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-16 10:03:12 -07:00
Vincent Demeester
0183b3bf8c Merge pull request #26426 from sfsmithcha/carry_pry_25414
Carry pr 25414
(cherry picked from commit e6f76800f5)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-16 10:03:12 -07:00
Sven Dowideit
8f264db3f1 Merge pull request #26306 from deployable/patch-1
Remote API documentation consistancy
(cherry picked from commit 2cce7bf33a)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-16 10:03:12 -07:00
Michael Crosby
b23bff1d9f Merge pull request #26224 from q384566678/test-zhou
Modify rename function use tips
(cherry picked from commit 061cc41759)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-16 10:03:12 -07:00
Sebastiaan van Stijn
7c8dc9e6d5 Merge pull request #25817 from sfsmithcha/update_glossary
add swarm mode terms to the glossary
(cherry picked from commit 027e7be348)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-14 09:48:29 -07:00
Vincent Demeester
c6e7fececb Merge pull request #25719 from eskaaren/master
You can force leave swarm
(cherry picked from commit daf454d8cd)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-14 09:48:23 -07:00
Charles Smith
73f256760c Merge pull request #26549 from mstanleyjones/2016.09.13_cherry_picks
Merge pull request #26547 from londoncalling/fix-links-in-overview
2016-09-13 16:47:12 -07:00
Misty Stanley-Jones
01855d37be Merge pull request #26547 from londoncalling/fix-links-in-overview
fixed on-page links
(cherry picked from commit e08b2f7a08)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-13 16:34:32 -07:00
Brian Goff
9366ba2434 Merge pull request #26507 from drakenator/26384-healthcheck-race
Prevent stdout / stderr race condition in limitedBuffer
2016-09-12 18:57:55 -04:00
Stephen Drake
49dc97dbc2 Prevent stdout / stderr race condition in limitedBuffer.
Signed-off-by: Stephen Drake <stephen@xenolith.net>
2016-09-12 21:49:32 +02:00
Misty Stanley-Jones
7e9c951813 Merge pull request #26501 from mstanleyjones/revert_26455
Revert commit of #26236 to 1.12.x branch
2016-09-12 11:16:34 -07:00
Misty Stanley-Jones
bf637439e7 Revert "Merge pull request #26236 from yuexiao-wang/remove-h-option"
This reverts commit eea99cd001.

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-12 11:02:09 -07:00
Sven Dowideit
2a1197037c Merge pull request #26455 from mstanleyjones/2016.09.09-docs-cherry-picks
2016.09.09 docs cherry picks
2016-09-12 09:45:49 +10:00
Antonio Murdaca
61c0a019fc Merge pull request #26264 from q384566678/test-two
Modify docker-restart.1.md
(cherry picked from commit b98e918248)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:45:22 -07:00
Vincent Demeester
2eb9e80547 Merge pull request #26252 from leslau/master
Fixed custom daemon options on systemd docs still using -H fd://
(cherry picked from commit 7baa09faa0)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:45:14 -07:00
Vincent Demeester
4cf193bac5 Merge pull request #26242 from YuPengZTE/devEG
"eg." should be "e.g."
(cherry picked from commit baf2108baf)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:45:07 -07:00
Vincent Demeester
eea99cd001 Merge pull request #26236 from yuexiao-wang/remove-h-option
Remove -h option for docker cli
(cherry picked from commit 01fe5639bc)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:44:58 -07:00
Vincent Demeester
d95bffff5f Merge pull request #26233 from yuexiao-wang/fix-readme
Fix readme doc for dockerd
(cherry picked from commit 1145c9b0d5)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:44:46 -07:00
Brian Goff
8a56561528 Merge pull request #26228 from lixiaobing10051267/masterPluginRm
check inconsistant command in docs/reference/commandline
(cherry picked from commit e96c0fafa0)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:44:37 -07:00
Charles Smith
dc98c76772 Merge pull request #26156 from mstanleyjones/24905_swarm_noun_usage
Sanitize uses of Swarm as a proper and improper noun (Fixes #24905)
(cherry picked from commit 6f0502b89b)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:44:29 -07:00
Vincent Demeester
9710d3d9e9 Merge pull request #25896 from raksonibs/fix/docs_step_6
Email deprecation for step 6 of tutorial
(cherry picked from commit 4e4ebbe340)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:44:22 -07:00
yuexiao-wang
0d800e9a37 clean up the run.md in reference
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit dd02815a26)
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-09 14:44:09 -07:00
Sven Dowideit
be71b62acf Merge pull request #26431 from mstanleyjones/2016.09.08-engine-docs-updates
2016.09.08 engine docs updates
2016-09-09 21:43:38 +10:00
Vincent Demeester
c63cdcd948 Merge pull request #26362 from lixiaobing10051267/masterIfconfig
rectify some response information while execute ifconfig in container
(cherry picked from commit 0ebb18102f)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-08 14:34:00 -07:00
Vincent Demeester
f1d590c45b Merge pull request #26320 from yongtang/09052016-man-docker-create
Update man page for `docker create` to add `--rm` flag
(cherry picked from commit d7594d23c8)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-08 14:34:00 -07:00
Charles Smith
a8c297c254 Merge pull request #26256 from mstanleyjones/rewrite_understanding_docker
Rewrites to Understanding Docker topic for clarity
(cherry picked from commit 426a0af075)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-08 14:34:00 -07:00
Sven Dowideit
bf7d335513 Merge pull request #26218 from frosforever/fix_run_reference_typo
Correct typo in run reference docs that use the create command
(cherry picked from commit e73e37f112)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2016-09-08 14:34:00 -07:00
Sven Dowideit
359f8fe426 Merge pull request #26343 from sfsmithcha/2016-09-06-1.12.1-engine-docs-updates
2016 09 06 1.12.1 engine docs updates
2016-09-07 22:15:21 +10:00
Vincent Demeester
11330bf048 Merge pull request #26307 from AkihiroSuda/fix-doc-26291
fix docs about `sudo docker login`
(cherry picked from commit da763602af)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:31:59 -07:00
Vincent Demeester
bbf49348e2 Merge pull request #26293 from lixiaobing10051267/masterDockerAttach
fix the wrong option info while specifying the command with the "--help"
(cherry picked from commit d8e1515350)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:31:03 -07:00
Vincent Demeester
55f95dd7e8 Merge pull request #26292 from lixiaobing10051267/masterDockerPull
modify output info for docker pull centos
(cherry picked from commit 175188d8b0)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:30:10 -07:00
Vincent Demeester
95bc4519d2 Merge pull request #26241 from YuPengZTE/devNote
The first letter of “docker“ is small
(cherry picked from commit b14f29dfbd)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:28:39 -07:00
Vincent Demeester
a42e2a0e42 Merge pull request #26192 from lixiaobing10051267/masterPluginInspect
make command "docker plugin inspect" complete
(cherry picked from commit cf699ad427)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:18:44 -07:00
Vincent Demeester
1e9fb2f18e Merge pull request #26190 from lixiaobing10051267/masterNetworkCreate
provide actual command format for docker network create
(cherry picked from commit 37fd1416da)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:17:10 -07:00
Vincent Demeester
5e4e13e31c Merge pull request #26187 from albers/docs-volume-create-fix
Fix argument order for docker create in tutorial
(cherry picked from commit 670eaa71a0)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:15:08 -07:00
Vincent Demeester
748f3ef8e3 Merge pull request #26185 from yuexiao-wang/update-docs
Update description for docker plugin inspect
(cherry picked from commit 0414a2c1a9)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:11:34 -07:00
Doug Davis
e3197e1dfa Merge pull request #26171 from CrimsonGlory/patch-2
typo
(cherry picked from commit 6705d68c89)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:09:20 -07:00
Michael Crosby
01de2e76b4 Merge pull request #26294 from petrsvihlik/updated-windows-mounting-example
Updated Windows mounting example
(cherry picked from commit 368a27a8d8)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:06:44 -07:00
Sven Dowideit
1a57e1b1f5 Merge pull request #26314 from unclejack/docs_contiv_nfs
docs: mention NFS support for Contiv volume plugin
(cherry picked from commit 8f424f7774)
Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:05:02 -07:00
Sven Dowideit
5c34d579dc Merge pull request #26302 from vdemeester/health_status-in-event-docs
Add health status as action on events documentations
(cherry picked from commit b468df9eac)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:04:23 -07:00
Charles Smith
931418603e Merge pull request #26288 from sfsmithcha/add_tls
author merge: addressed @diogomonica ' remark: add how pki works topic
(cherry picked from commit 75c36bcc64)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:03:44 -07:00
Vincent Demeester
7e2259bb63 Merge pull request #26271 from AkihiroSuda/fix-service-create-doc
update docs/reference/commandline/service_create.md
(cherry picked from commit 1a04d7b1e1)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:03:07 -07:00
Vincent Demeester
b7e9344365 Merge pull request #26258 from mstanleyjones/25625_swarm_init_return_value
Add response to swarm/init example (fixes #25625
(cherry picked from commit d4e173fc34)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 12:02:00 -07:00
Sven Dowideit
dc0d2166d5 Merge pull request #26245 from dbdd4us/master
add volumes, networks, nodes and services into label doc
(cherry picked from commit 384de833c0)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:38:02 -07:00
Justin Cormack
e773b059d1 Merge pull request #26139 from yuexiao-wang/fix-link
Modify link for hub and registry
(cherry picked from commit ad6f5a49d5)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:37:03 -07:00
Vincent Demeester
934d7b83ef Merge pull request #26135 from kmkr/master
Fix typo in builder.md
(cherry picked from commit 20869b5650)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:36:27 -07:00
Brian Goff
755addd56f Merge pull request #26127 from lixiaobing10051267/masterDockerDeploy
usage description of docker deploy in md not consistant with go file
(cherry picked from commit afd54a1a86)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:36:03 -07:00
Vincent Demeester
9c2b789caf Merge pull request #26122 from sfsmithcha/updates_for_new_plugin_docs
some fixes to clean up new plugin system docs
(cherry picked from commit c1b82df740)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:35:22 -07:00
Charles Smith
abe05f4a29 Merge pull request #26114 from londoncalling/fix-linespacing-swarmtut
fixed line spacing in Swarm tutorial bullets
(cherry picked from commit 6221592087)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:34:16 -07:00
Justin Cormack
9bef12dcfd Merge pull request #26096 from ohmystack/fix/docs-dockerd
Add docs for "--containerd" in dockerd
(cherry picked from commit 644cb53b41)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:31:55 -07:00
Vincent Demeester
aaa7a58c63 Merge pull request #26080 from sw-double/patch-1
[docs] Fix volume binding in fluentd container example
(cherry picked from commit ad73e8f169)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:31:19 -07:00
Vincent Demeester
49e863f6d0 Merge pull request #26036 from yuexiao-wang/add-gcplog
Add the content for Google Cloud Loging driver in index
(cherry picked from commit 48659599cb)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:30:46 -07:00
Doug Davis
44180a48e9 Merge pull request #26030 from yongtang/08252016-doc-docker-create-rm
Update docs for `docker create` to include `--rm` flag
(cherry picked from commit 91ec7fa811)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:29:55 -07:00
Antonio Murdaca
8f0254da41 Merge pull request #26029 from WhisperingChaos/25918-permissive-to-privileged
Fixes #25918 - Changed --permissive to --privileged.
(cherry picked from commit 91fdafb79f)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:26:13 -07:00
Charles Smith
2aa780abe4 Merge pull request #26028 from londoncalling/docs-pinata-for-swarm
Clarify how to use d4mac, d4win with swarm mode
(cherry picked from commit 6072e6bfd2)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:11:13 -07:00
Vincent Demeester
af9378f713 Merge pull request #25996 from yuexiao-wang/fix-docker-daemon
Replace docker command from 'docker daemon' to 'dockerd'
(cherry picked from commit aff33055ac)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:06:57 -07:00
Justin Cormack
a3098657c3 Merge pull request #25963 from yuexiao-wang/fix-repo
Modify incorrect repository URL
(cherry picked from commit a110512e38)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:06:21 -07:00
Vincent Demeester
6e9dd212b9 Merge pull request #25948 from lixiaobing10051267/masterImages
get a redis-cli image while using docker pull
(cherry picked from commit 602b238136)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:05:44 -07:00
Tõnis Tiigi
9234cc38e2 Merge pull request #25946 from lixiaobing10051267/masterDockerImages
Incorrect response field name for command "docker images"
(cherry picked from commit 0b2ff0ccde)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:05:22 -07:00
Doug Davis
d649ae0370 Merge pull request #25931 from fj/patch-1
Fix minor typo in "Getting Started" documentation
(cherry picked from commit a949a79a58)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:04:23 -07:00
Vincent Demeester
af2a9ba322 Merge pull request #25919 from yuexiao-wang/fix-refer
Remove the redundant words in reference for swarm
(cherry picked from commit 72e7cd75c1)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:03:48 -07:00
Aaron Lehmann
72f1556f62 Merge pull request #25914 from lixiaobing10051267/masterSwarmJoinManager
Remove option "--manager" description for swarm_join.md
(cherry picked from commit 7cd88e5ec4)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:03:16 -07:00
Sebastiaan van Stijn
909f9f5ea8 Merge pull request #25726 from vieux/new_plugin_system_doc
adding some documentation about the new plugin system
(cherry picked from commit 88a6a7763b)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-09-06 11:02:11 -07:00
Sven Dowideit
e98eafcc3c Merge pull request #26168 from sfsmithcha/fix_swarm_tutorial_note
Merge pull request #26114 from londoncalling/fix-linespacing-swarmtut
2016-08-31 12:23:09 +10:00
Charles Smith
69d3aaa2e2 Merge pull request #26114 from londoncalling/fix-linespacing-swarmtut
fixed line spacing in Swarm tutorial bullets
(cherry picked from commit 6221592087)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-30 15:12:02 -07:00
Charles Smith
1f563dd224 Merge pull request #26117 from sfsmithcha/2016_08_29_engine_docs_updates
author merge: Merge pull request #26114 from londoncalling/fix-linespacing-swarmtut
2016-08-30 11:02:05 -07:00
Charles Smith
5d2e3ad0c9 Merge pull request #26114 from londoncalling/fix-linespacing-swarmtut
fixed line spacing in Swarm tutorial bullets
(cherry picked from commit 6221592087)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-29 12:30:00 -07:00
Charles Smith
f1bcb5f10e Merge pull request #26064 from sfsmithcha/updates_to_v1.12.1_docs
author merge: Updates to v1.12.1 docs
2016-08-29 10:02:01 -07:00
Sebastiaan van Stijn
080891bb11 Merge pull request #25902 from MihaiB/docs-link-fragment
docs: fix typo in url fragment
(cherry picked from commit ab533a98dc)
Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:08:02 -07:00
Sven Dowideit
be94e07b6d Merge pull request #25901 from yuexiao-wang/add-content
Add the content for how services work
(cherry picked from commit abd08f4784)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:07:35 -07:00
Vincent Demeester
ca9bb6e445 Merge pull request #25899 from yuexiao-wang/fix-overview
Optimize description for Feature highlights
(cherry picked from commit d2fa978d4d)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:06:55 -07:00
Sven Dowideit
7e956837f2 Merge pull request #25835 from decoursin/patch-1
Update apparmor error message
(cherry picked from commit e168f0b4ad)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:06:10 -07:00
Vincent Demeester
069aa4e11a Merge pull request #25815 from justincormack/capdoc
Split list of capabilities into those added by default and those not
(cherry picked from commit d854c4fcc6)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:05:32 -07:00
Sebastiaan van Stijn
e097320c92 Merge pull request #25792 from lixiaobing10051267/masterSwarmLeave
Specify woker node for docker swarm leave command
(cherry picked from commit 90308fd783)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:04:20 -07:00
Charles Smith
fdb5140893 Merge pull request #25781 from sfsmithcha/add_ingress_guide
author merge: add ingress / publish port guide
(cherry picked from commit dee3044336)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:03:47 -07:00
Vincent Demeester
63fb3077cc Merge pull request #25775 from ddgenome/entrypoint-env
Remove erroneous ENTRYPOINT note
(cherry picked from commit c1bdda0be8)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:03:07 -07:00
Vincent Demeester
3d4813ffd2 Merge pull request #25751 from yuexiao-wang/clean-docs
Remove mess words in installation doc
(cherry picked from commit bbd5396955)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 16:01:14 -07:00
Arnaud Porterie
330486c45f Merge pull request #25750 from talex5/spec
Document Healthcheck in image spec
(cherry picked from commit 46cb1f2601)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 15:47:08 -07:00
Sebastiaan van Stijn
dc49ed96cb Merge pull request #25743 from lixiaobing10051267/masterInspect
Check the return message of docker service inspect
(cherry picked from commit 6fa69d2d06)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 15:44:58 -07:00
Sebastiaan van Stijn
21e168053f Merge pull request #25709 from thaJeztah/fix-missing-docs-for-binary-remote-context
Add missing docs about binary remote contexts
(cherry picked from commit b4abe38d43)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 15:44:11 -07:00
Sebastiaan van Stijn
88bd4cb0ea Merge pull request #25704 from thaJeztah/cleanup-api-markdown
Cleanup API docs Markdown formatting and wording
(cherry picked from commit 45cb33e65c)

Signed-off-by: Charles Smith <charles.smith@docker.com>
2016-08-26 15:41:54 -07:00
Tibor Vass
23cf638307 Bump VERSION to v1.12.1
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-17 21:40:58 -07:00
Tibor Vass
3e4c33365f Merge pull request #25830 from tiborvass/cherry-pick-25825
[1.12] Fix volume not working after daemon restart
2016-08-17 21:05:32 -07:00
Brian Goff
e8ed523480 Fix volume not working after daemon restart
When the daemon is started, it looks at all the volumes and checks to
see if any of them have mount options persisted to disk, and loads them
from disk if it does.

In some cases a volume will be created with an empty map causing the
options file to be persisted and volume options set to a non-nil value
on daemon restart... this causes problems later when the driver checks
for a non-nil value to determine if it should try and mount with the
persisted volume options.

Ensures 2 things:

1. Instead of only checking nilness for the opts map, use `len` to make
sure it is not an empty map, which we don't really need to persit.

2. An empty (or nulled) opts.json will not inadvertnatly set volume
options on daemon restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 246d1eb58e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-17 20:17:09 -07:00
Tibor Vass
5d29b79241 Merge pull request #25780 from thaJeztah/1.12.1-docs-cherry-picks
1.12.1 docs cherry picks
2016-08-17 20:01:46 -07:00
Tibor Vass
6e7b8f41ca Merge pull request #25787 from tiborvass/cherry-pick-23790
[1.12] Skip always pulling images on integration tests
2016-08-17 20:00:56 -07:00
Tibor Vass
bd8d47e028 Merge pull request #25811 from aaronlehmann/swarm-changelog
Add swarm section to 1.12.1 changelog
2016-08-17 17:14:55 -07:00
Eivin Giske Skaaren
c745f4db98 "Annotations" not a parameter
Signed-off-by: Eivin Giske Skaaren <eivin@sysmystic.com>
(cherry picked from commit 69e481af4e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:22:00 +02:00
Eivin Giske Skaaren
b313230fa8 Capital D in "ID" returned when creating service
Signed-off-by: Eivin Giske Skaaren <eivin@sysmystic.com>
(cherry picked from commit 9eb2ec799e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:22:00 +02:00
Eivin Giske Skaaren
a193f2995e Add doc for inspect swarm
Signed-off-by: Eivin Giske Skaaren <eivin@sysmystic.com>
(cherry picked from commit c59bc53727)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:22:00 +02:00
Sebastiaan van Stijn
0f63ddb03d Fix capitalization
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 75e60fbe09)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:22:00 +02:00
Sebastiaan van Stijn
2875711fe7 Restore missing ps example for killed containers
This example was added in b0b2f979c7,
but got lost during splitting up the cli.md docs into separate files;
561bfb268d

This restores the missing example.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8d5818a693)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
Sebastiaan van Stijn
e24421a6ef Move sysctls to correct API version
Commit 067b510dfc move the
sysctls feature to the right API version, but
missed this one.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7cdd693d5d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
Sebastiaan van Stijn
e2c8597c8f Add X-Registry-Auth header to service API docs
The service create/update endpoints support
passing registry-authentication information,
but this was not documented.

This adds the missing information about passing
a X-Registry-Auth header.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit bde35ef18a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
Akihiro Suda
f436a41d0c Add a note about the open(2) and rename(2) on AUFS and OverlayFS
Close #25409
Update #10180

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit aab101a770)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
lixiaobing10051267
fc8a0f4786 command "docker service remove" not insistant
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit 078e2aa157)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
Sven Dowideit
9bc8e7858c James' site has been dead for a while - removing links
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit a9b08f3102)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
David Lechner
a30a0b07a4 Move export from image commands to container commands
The export command operates on containers, not images, so it should be listed under the container commands, not the image commands.

Signed-off-by: David Lechner <david@lechnology.com>
(cherry picked from commit 43c8cc7bb4)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
Matt Bentley
05e1e65ca7 Add install of virtual kernel extras for AUFS
Signed-off-by: Matt Bentley <matt.bentley@docker.com>
(cherry picked from commit e715ca506f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
Charles Smith
4534b9e6c3 add overlay networking guide
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit e56dd0e0e7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
Charles Smith
3da4ac64af add overlay networking security model node
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit cc5debcb2e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-17 23:21:59 +02:00
Tonis Tiigi
13e82f23c8 Skip always pulling images on integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit e2226223e6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-17 14:19:31 -07:00
Aaron Lehmann
74cdda0333 Add swarm section to 1.12.1 changelog
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-08-17 14:10:42 -07:00
Tibor Vass
236317fa56 Bump VERSION to v1.12.1-rc2
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 21:30:11 -07:00
Tibor Vass
f806ae4838 Merge pull request #25767 from tiborvass/1.12.1-rc2-cherrypicks
1.12.1 rc2 cherrypicks
2016-08-16 21:26:03 -07:00
Tibor Vass
a544fe4b38 Vendor swarmkit to change root key to P-256
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 16:11:10 -07:00
Anusha Ragunathan
09dc9a2a9e Debugging issue #25511
Volumes and other content created under a bind mount should be
recursively propagated using rshared, not shared. This could be
the reason for EBUSY during removal. Override options with rbind,
rshared and see if CI errors are fixed.

May fix #25511

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit e58028d078)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 16:11:10 -07:00
Tonis Tiigi
f21cdf48f9 Add retry checks to TestSwarmPublishAdd
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 7bd1c11959)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 16:11:10 -07:00
Jana Radhakrishnan
651c53f020 Vendoring libnetwork @82fb373e3eaa4e
- Fixes a SNAT issue in loadbalancer when multiple networks are involved
  - Fixes an issue with SRV query forwarding in DNS
  - Fixes a map race

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 56c9822695)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 15:37:43 -07:00
Dieter Reuter
64f62a6703 Improve systemd config for Raspbian
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
(cherry picked from commit 3c7ae431e0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 15:37:43 -07:00
Tibor Vass
460d8d80ca release-rpm: fix bad destination paths for rpms
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit e1c7ad871f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 15:37:43 -07:00
Sebastiaan van Stijn
dd08342103 Add note about new binaries to changelog
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 32b8a6e735)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 15:37:42 -07:00
Dieter Reuter
07e0380379 Fix build deb for ARMv6
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
(cherry picked from commit 5907e4a872)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-16 15:37:42 -07:00
Sebastiaan van Stijn
0c369b1a5c Merge pull request #25761 from thaJeztah/update-changelog
Update 1.12.1 changelog for networking fixes
2016-08-16 21:51:27 +02:00
Sebastiaan van Stijn
6927a7b263
Update networking section in changelog
- Add 25550 to 1.12.1 changelog
- Add 25739 to 1.12.1 changelog

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-16 17:18:10 +02:00
Tibor Vass
8dae3ecff0 Merge pull request #25713 from thaJeztah/update-changelog
[1.12.1] Add removal of "--network-add" / "--network-rm" to changelog
2016-08-15 10:34:16 -07:00
Sebastiaan van Stijn
12ab1ca5eb
Add removal of "--network-add" / "--network-rm" to changelog
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-15 14:31:39 +02:00
Tibor Vass
7889dc71a2 Bump VERSION to v1.12.1-rc1
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-12 10:59:21 -07:00
Tibor Vass
705ebd6fac Merge pull request #25659 from thaJeztah/update-1.12.1-changelog
rewording and changes in 1.12.1 changelog for 1.12.1-GA
2016-08-12 10:58:41 -07:00
Sebastiaan van Stijn
eae4ba51e5
Minor rewording and changes in 1.12.1 changelog
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-12 18:15:14 +02:00
Tibor Vass
e005053797 Merge pull request #25653 from tiborvass/i-hate-rpm
Changelog: Add placeholder date for 1.12.1
2016-08-12 01:36:22 -07:00
Tibor Vass
7646aba651 Changelog: Add placeholder date for 1.12.1
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-12 01:29:09 -07:00
Tibor Vass
c4428f84d0 Merge pull request #25651 from tiborvass/changelog-1.12.1
Update CHANGELOG for 1.12.1
2016-08-12 00:14:37 -07:00
Tibor Vass
5680192346 Merge pull request #25632 from SvenDowideit/more-docs-1.12.1-cherry-picks
More docs 1.12.1 cherry picks
2016-08-12 00:14:30 -07:00
Tibor Vass
a019407d3e Update CHANGELOG for 1.12.1
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 22:48:24 -07:00
Tibor Vass
5dc0715cd2 Merge pull request #25637 from tiborvass/cherry-picks-1.12.1
Cherry picks 1.12.1
2016-08-11 22:27:32 -07:00
Tibor Vass
235d897aaf Merge pull request #25647 from tiborvass/fix-network-flag-on-service-update-1.12.1
[1.12.1] Remove --network-add and --network-rm flags from service update
2016-08-11 21:08:40 -07:00
Santhosh Manohar
42fed93a89 Vendoring libnetwork for 1.12.1-rc1
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
(cherry picked from commit b9c9fa2855)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 20:26:04 -07:00
Anusha Ragunathan
a3f2c03ef0 Fix deadlock on plugin shutdown.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 4d009084de)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 19:40:06 -07:00
Yong Tang
af0f7ad792 Fix flaky TestSwarmNodeTaskListFilter by waiting for task fully deployed
This is an attempt to fix the flaky test of TestSwarmNodeTaskListFilter in 25029.

Basically this fix adds a check to wait until 3 containers has already up,
before processing `node tasks ...`.

This might fix 25029.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 63c0366bc9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 19:39:52 -07:00
John Howard
16a0c1c374 Windows: Fix RO test cases
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 03816ad5b5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 19:39:52 -07:00
Tibor Vass
9623f45fce 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>
(cherry picked from commit 3a7e90c743)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 19:37:41 -07:00
Davanum Srinivas
3048098843 Adding /proc/timer_list to the masked paths list
/proc/timer_list seems to leak information about the host. Here is
an example from a busybox container running on docker+kubernetes.

 # cat /proc/timer_list | grep -i -e kube
 <ffff8800b8cc3db0>, hrtimer_wakeup, S:01, futex_wait_queue_me, kubelet/2497
 <ffff880129ac3db0>, hrtimer_wakeup, S:01, futex_wait_queue_me, kube-proxy/3478
 <ffff8800b1b77db0>, hrtimer_wakeup, S:01, futex_wait_queue_me, kube-proxy/3470
 <ffff8800bb6abdb0>, hrtimer_wakeup, S:01, futex_wait_queue_me, kubelet/2499

Signed-Off-By: Davanum Srinivas <davanum@gmail.com>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
(cherry picked from commit 03bd00b68f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:51 -07:00
Thomas Tanaka
7b95154474 Add Oracle Linux distro specific selinux policy
With the latest OL7.2, selinux policy that is shipped
might not be the latest for it to work or build with
selinux policy for docker-1.12.

To be able to achieve that here is what is done:
1. Added systemd_machined policy which is part of systemd.
2. Temporarily comment out unconfined_typebounds because the
current OL7's selinux doesn't have unconfineduser selinux policy,
to include this will be too much. Will revisit this once we have
updated the selinux policy.

Fixes: #24612

Signed-off-by: Thomas Tanaka <thomas.tanaka@oracle.com>
(cherry picked from commit d6cae872c7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:51 -07:00
Tibor Vass
dab3fc3955 Make release scripts architecture-agnostic and add ARM support
This patch allows to only release the packages that were built and are
present under the bundles/ directory instead of assuming packages exist
for all distros enumerated in the contrib/builder/ directory.

It also now adds support for armhf architecture for apt repositories.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 2ff2e9a730)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:51 -07:00
Yong Tang
f99fd5a3f9 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>
(cherry picked from commit b487497cd2)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:51 -07:00
Sebastiaan van Stijn
bdf7a55cfe Add warning about systemd socket activation to changelog
Docker 1.12 ships with an updated unit file on RPM
based distros. Users that have local modifications
to the unit file, or have a drop-in file installed
may not automatically get the updated unit file,
or get an error when starting docker.

This adds a warning to the changelog, and instructions
on how to resolve the issue.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 66b656684e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:50 -07:00
Madhu Venugopal
46afae5372 Vendoring libnetwork for 1.12.1-rc1
* Fixes https://github.com/docker/docker/issues/25236
* Fixes https://github.com/docker/docker/issues/24789
* Fixes https://github.com/docker/docker/issues/25340
* Fixes https://github.com/docker/docker/issues/25130
* Fixes https://github.com/docker/libnetwork/issues/1387
* Fix external DNS responses > 512 bytes getting dropped
* Fix crash when remote plugin returns empty address string
* Make service LB work from self
* Fixed a few race-conditions

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 6645ff8ac1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:50 -07:00
Justin Cormack
265f7a37bd Gate name_to_handle_at by CAP_SYS_ADMIN not CAP_DAC_READ_SEARCH
Only open_by_handle_at requires CAP_DAC_READ_SEARCH.

This allows systemd to run with only `--cap-add SYS_ADMIN`
rather than having to also add `--cap-add DAC_READ_SEARCH`
as well which it does not really need.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit c1ca124682)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:50 -07:00
Jana Radhakrishnan
769c25c416 Retry creating dynamic networks if not found
In cases there are failures in task start, swarmkit might be trying to
restart the task again in the same node which might keep failing. This
creates a race where when a failed task is getting removed it might
remove the associated network while another task for the same service
or a different service but connected to the same network is proceeding
with starting the container knowing that the network is still
present. Fix this by reacting to `ErrNoSuchNetwork` error during
container start by trying to recreate the managed networks. If they
have been removed it will be recreated. If they are already present
nothing bad will happen.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 117cef5e97)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:50 -07:00
Michael Crosby
2f6ca79080 Add selinux policy per distro
This adds the ability to have different profiles for individual distros
and versions of the distro because they all ship with and depend on
different versions of policy packages.

The `selinux` dir contains the unmodified policy that is being used
today.  The `selinux-fedora` dir contains the new policy for fedora 24
with the changes for it to compile and work on the system.

The fedora policy is from commit
4a6ce94da5

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 32b1f26c51)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:50 -07:00
Dieter Reuter
147f1ad348 Fix typo in comment
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
(cherry picked from commit 430bf992d9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:49 -07:00
Dieter Reuter
dff3faf04e Add a Raspbian specific systemd unit file, use overlay by default
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
(cherry picked from commit 84ff895a06)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:49 -07:00
Dieter Reuter
25a629574c Add support to install Docker on raspbian/jessie
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
(cherry picked from commit 6e76b7a7e5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:49 -07:00
Victor Vieux
5cc103e9e9 fix plugin restart on docker restart
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit ab12ed4a56)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:49 -07:00
Yong Tang
fdf513e99d 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>
(cherry picked from commit c6de8add5f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:49 -07:00
Diogo Monica
e5a4047a62 Adding Joined at to node inspect
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
(cherry picked from commit d1244abc5c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:48 -07:00
Sebastiaan van Stijn
a345cc11c9 fix validation of non-existing bind-mount source
Unlike `docker run -v..`, `docker service create --mount`
does not allow bind-mounting non-existing host paths.

This adds validation for the specified `source`, and
produces an error if the path is not found on the
host.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 84d5ab96ef)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:48 -07:00
Harald Albers
98bbe72549 Fix bash completion for docker service {create,update} {-e,--env}
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 197f23da49)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:48 -07:00
Dave Tucker
aaadc511d8 cli: service inspect - Null check for UpdateConfig
Fixes #25453

Signed-off-by: Dave Tucker <dt@docker.com>
(cherry picked from commit 0e1fe4516f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:48 -07:00
Kenfe-Mickael Laventure
8ef01f724b Handle out-of-sync libcontainerd client on restore
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 51f21a1674)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:48 -07:00
Harald Albers
af77d47c1f Fix bash completion for docker swarm join --advertise-addr
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit fa1b82e5eb)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:47 -07:00
Tonis Tiigi
c473d14d45 libcontainerd: mark container exited after failed restart
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 9be0fb45c2)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:47 -07:00
Tonis Tiigi
f6d388f5b1 libcontainerd: wait for restart after state change
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 495448b290)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:47 -07:00
Yong Tang
8b9d96d208 Sort output of docker ps --filter with order by creation time
This fix tries to address the issue raised in 25374 where the
output of `docker ps --filter` is in random order and
not deterministic.

This fix sorts the list of containers by creation time so that the
output is deterministic.

An integration test has been added.

This fix fixes 25374.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3f97133546)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:47 -07:00
Steve Durrheimer
c573ad30b9 Add zsh completion for 'docker node rm --force'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit b58ef479a6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:47 -07:00
Victor Vieux
23b79424c0 fix deadlock when more than 1 plugin is installed
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 42360d164b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:46 -07:00
Brian Goff
2422b48ffb Validate mount paths on task create
This is intended as a minor fix for 1.12.1 so that task creation doesn't
do unexpected things when the user supplies erroneous paths.

In particular, because we're currently using hostConfig.Binds to setup
mounts, if a user uses an absolute path for a volume mount source, or a
non-absolute path for a bind mount source, the engine will do the
opposite of what the user requested since all absolute paths are
treated as binds and all non-absolute paths are treated as named
volumes.

Fixes #25253

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 38f8b0eb10)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:46 -07:00
Daniel Nephin
2ac7a9ca9e Fix the man/Dockerfile for arm
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit fcde27e6db)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:46 -07:00
Harald Albers
4dc1afc961 Add bash completion for docker node rm --force
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 46d3464362)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:46 -07:00
Tonis Tiigi
9b759e18b1 Mask join tokens in daemon logs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit e3917c76ce)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:46 -07:00
Drew Erny
b0bff4d8d2 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>
(cherry picked from commit 02ebaf364f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:45 -07:00
Diogo Monica
caaf53ad3e Add --force to node removal
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
(cherry picked from commit a327c231b5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:45 -07:00
Brian Goff
b32462e2a4 Fix missing mount ID on volume unmount
Fixes #25331

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 63983f3ffe)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:45 -07:00
Sebastiaan van Stijn
40baa97ab1 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>
(cherry picked from commit ebebd41769)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:45 -07:00
Brian Goff
70f0f7a20e Fix issue reloading mount options on restart
On daemon restart the local volume driver will read options that it
persisted to disk, however it was reading an incorrect path, causing
volume options to be silently ignored after a daemon restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit c560dd9686)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:45 -07:00
Yong Tang
aaf3a81086 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>
(cherry picked from commit 995128e9eb)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:44 -07:00
Anusha Ragunathan
828a2473c2 Remove plugin root from filesystem.
`docker plugin remove` didnt actually remove plugin from disk. Fix that.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 5690730a74)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:44 -07:00
Yong Tang
9ba749a497 Better error messages when IP address autodetection fails
This fix tries to improve error messages when IP address
autodetection fails, as is specified in 25141.

Previously, error messages only indicate that multiple IPs
exist when autodetection fails. In this fix, if one
interface consists of multiple addresses or multiple
interfaces consist of addresses, the error messages output
the address names and interface names so that end user could
take notice.

This fix is verified manually.
When multiple addresses exist on multiple interfaces:
```
$ sudo docker swarm init
Error response from daemon: could not choose an IP address
to advertise since this system has multiple addresses on different
interfaces (192.168.186.128 on ens33 and 192.168.100.199 on eth10)
 - specify one with --advertise-addr
```
When multiple addresses exist on single interface:
```
$ sudo docker swarm init
Error response from daemon: could not choose an IP address
to advertise since this system has multiple addresses
on interface ens33 (192.168.186.128 and 192.168.55.199)
- specify one with --advertise-addr
```

This fix fixes 25141.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 59db01049a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:44 -07:00
allencloud
e25a1ca19c update command description in CLI
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 6c5988ed8c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:44 -07:00
allencloud
cd0a4389e2 uppercase output in docker info related to swarm mode
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit ac13162464)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:44 -07:00
Steve Durrheimer
d00d9dbbfb Add zsh completion for 'docker service {create,update} --container-label{-add,-rm}'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit ab95ec3dd9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:43 -07:00
Steve Durrheimer
282dda382b Remove zsh completion for 'docker swarm inspect'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit f146f6127c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:43 -07:00
Sebastiaan van Stijn
798e0b07cb Update usage of "Swarm" for consistency
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f0230049f0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:43 -07:00
Anusha Ragunathan
4d529895f0 Make daemon events listen for plugin lifecycle events.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 42abccb841)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:43 -07:00
Akihiro Suda
49d9a425d5 Fix pkg/plugins TLSConfig panic
Fix #25046

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit b1e71bdd1d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:42 -07:00
Anusha Ragunathan
a577a06403 Check for plugin state before enable and disable.
This prevents unnecessary API call to containerd.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit b867f6c6e1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:42 -07:00
Tibor Vass
bdc0a24156 Vendor engine-api and swarmkit for 1.12.1
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 17:56:30 -07:00
Alexander Morozov
af4ff2541a integration: drain node before stop in TestApiSwarmForceNewCluster
It's too long to wait for reschedule.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 307b7b0d15)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:48:17 -07:00
Vincent Demeester
151b799147 Merge pull request #25604 from allencloud/add-missing-fields-in-volume-api
add fields in volume api for 1.24, 1.25
(cherry picked from commit a3432c2fdb)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 23:45:24 +00:00
Sebastiaan van Stijn
61fe5dabe3 Merge pull request #25611 from lixiaobing10051267/masterJoin
docker swarm join command has no flag '--swarm-token'
(cherry picked from commit f1101ebf3e)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-08-11 23:45:24 +00:00
Sebastiaan van Stijn
6e122d9bd5 Merge pull request #25610 from lixiaobing10051267/masterSwarm
optimize some descriptions for swarm nodes.md
(cherry picked from commit 81fca603a4)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-08-11 23:45:24 +00:00
Vincent Demeester
6a7d5dcf08 Merge pull request #25585 from yongtang/22311-log-opts-map
Update docs so that log-opts takes map (`{}`) instead of `[]`
(cherry picked from commit e42cc1f6c5)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-08-11 23:45:24 +00:00
Sebastiaan van Stijn
ec26e561b0 Merge pull request #25548 from thaJeztah/plugin-api-docs
Add API documentation for experimental plugin features
(cherry picked from commit 5b68177a6e)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 23:45:24 +00:00
Sebastiaan van Stijn
83e47c15ee Merge pull request #25573 from thaJeztah/improve-runmetrics-layout
docs: improve layout for runmetrics
(cherry picked from commit a19029a719)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-08-11 23:45:24 +00:00
Sebastiaan van Stijn
6811254691 Merge pull request #25588 from thaJeztah/fix-events-since-description
Fix events "since" query parameter description
(cherry picked from commit 960b7de456)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md

(cherry picked from commit 006f50ae27)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:36:34 -07:00
Sven Dowideit
8cc5797894 Merge pull request #25569 from friism/fix-typo-in-security-doc
update intro to say there are four things to consider
(cherry picked from commit ce2ca236db)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit 7cee444f8b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:36:34 -07:00
Sebastiaan van Stijn
7bd1512ad6 Merge pull request #25172 from vdemeester/25153-node-delete-update-api-docs
Add delete and update API documentation
(cherry picked from commit 2f167a7609)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md

(cherry picked from commit ee59531352)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:36:34 -07:00
Sebastiaan van Stijn
4e6e046035 Merge pull request #25532 from thaJeztah/docs-update-node-inspect-output
Update example output for node inspect
(cherry picked from commit 80c49d1e52)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit adf552821a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:36:34 -07:00
Vincent Demeester
1ad0903ea3 Merge pull request #25457 from sfsmithcha/add_force_remove_to_admin_guide
add force remove to admin guide, clean up usage of Raft, cluster -> s…
(cherry picked from commit 59b03240b1)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Conflicts:
	docs/swarm/admin_guide.md

(cherry picked from commit 0f65b6b137)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:36:34 -07:00
Vincent Demeester
74e965afd8 Merge pull request #25458 from sfsmithcha/fix_swarm_update_typo
fix typo, change sample cert expiry value
(cherry picked from commit e62b945013)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit f72a1eb6be)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:36:34 -07:00
Sebastiaan van Stijn
39d7e266de Merge pull request #25530 from thaJeztah/docs-update-image-load-response
docs: add missing "quiet" parameter for image/load and update response
(cherry picked from commit 06e3ea1417)
Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 16:32:25 -07:00
Sebastiaan van Stijn
f558e71cd2 Merge pull request #25527 from thaJeztah/fix-image-load-api-docs
docs: add missing content-type header for image load
(cherry picked from commit 5fd483695f)
Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 16:32:24 -07:00
Sebastiaan van Stijn
037ad1b174 Merge pull request #25506 from sfsmithcha/fix_network_name
fix overlay network example
(cherry picked from commit c51f639531)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:24 -07:00
Sebastiaan van Stijn
33cabf2658 Merge pull request #25422 from sfsmithcha/fix_tutorial_advisory
update D4M D4W advisory in swarm tutorial
(cherry picked from commit e4bca49356)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:23 -07:00
Sebastiaan van Stijn
c01379f52f Merge pull request #25441 from thaJeztah/sync-api-docs
Sync API docs to older API versions
(cherry picked from commit f4575970a7)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:23 -07:00
Sebastiaan van Stijn
d32508f2a1 Merge pull request #25435 from kfr2/fix-run-docs-typo
Fix typo in run command documentation
(cherry picked from commit 0af3ca6933)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:23 -07:00
Sebastiaan van Stijn
cfd105cd5b Merge pull request #25430 from padyx/doc_swarmjoin_conflictmarker
Remove git conflict markers in docs/reference/commandline/swarm_join.md
(cherry picked from commit 4981916546)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:22 -07:00
Sebastiaan van Stijn
4b9b07f281 Merge pull request #25425 from thaJeztah/remove-rc-suffix
Remove "-rc" from documentation
(cherry picked from commit 9513aa3a48)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:22 -07:00
Sebastiaan van Stijn
fff3dce95f Merge pull request #25421 from avaid96/patch-1
minor nit typo in opensl(openssl) genrsa -out delegation.key 2048
(cherry picked from commit 4191b786c5)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:21 -07:00
Sebastiaan van Stijn
bc967c6ea9 Merge pull request #25405 from thaJeztah/fix-api-markdown
Fix Markdown formatting in API docs
(cherry picked from commit 66671d4ec2)

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 16:32:21 -07:00
Brian Goff
0faacf1180 Merge pull request #25399 from ilkka/swarm-tutorial-service-ps-output
Update `service ps` output format in swarm tutorial to match 1.12.0
(cherry picked from commit e1b77bd69a)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:20 -07:00
Brian Goff
8e04d5a68c Merge pull request #25376 from sfsmithcha/fix_typo
add missing period
(cherry picked from commit f7d48d74a3)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:20 -07:00
Sebastiaan van Stijn
222e44179c Merge pull request #25194 from vdemeester/23597-swarm-api-ref-fixes
Update `/node/*` api reference documentation
(cherry picked from commit 0ab06816ea)

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	docs/reference/api/docker_remote_api_v1.24.md
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 16:32:19 -07:00
Sebastiaan van Stijn
85b9530e26 Merge pull request #25358 from lixiaobing10051267/masterBe
Remove reduntant word in device-mapper-driver.md
(cherry picked from commit 5c9bcaa942)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:19 -07:00
Sebastiaan van Stijn
9aabd9c3f4 Merge pull request #24736 from johnharris85/fix-sinatra-tutorial
Fix broken gem instructions.
(cherry picked from commit 29648795cd)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:18 -07:00
Sebastiaan van Stijn
60db5f060e Merge pull request #25350 from thaJeztah/carry-24314-mongodb-example-update
[Carry 24314] Make MongoDB sample Dockerfile working again
(cherry picked from commit 6e19e7b1d7)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:18 -07:00
Sebastiaan van Stijn
514c1da2bf Merge pull request #25349 from thaJeztah/carry-25174-api-docs-update
[carry 25174] 409 status code result to create service
(cherry picked from commit 2cb1281a4a)

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	docs/reference/api/docker_remote_api_v1.24.md
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 16:32:18 -07:00
Sebastiaan van Stijn
5cad6c1df8 Merge pull request #25318 from lixiaobing10051267/masterParentheses
A parenthesis omitted in Seccomp.md
(cherry picked from commit d7c9c85e30)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:17 -07:00
Sven Dowideit
d7a01cc60e Merge pull request #25282 from clhlc/clhlc-patch-1
Update swarm-mode.md
(cherry picked from commit 181f5ac627)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:17 -07:00
Sven Dowideit
7ab84e8daf Merge pull request #25241 from jhorwit2/jah/ps-doc-fix
Added shutdown to desired-state docs for filter node/service ps
(cherry picked from commit 1d8617a42b)

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 16:32:16 -07:00
Vincent Demeester
5f38d112fc Merge pull request #25269 from allencloud/update-remote-api-docs-about-409
add status code 409 in attach in docs
(cherry picked from commit 56cbfc587f)

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
2016-08-11 16:32:16 -07:00
Tõnis Tiigi
a4c8fe1cd4 Merge pull request #25265 from adamwalz/docs_swarm_cluster_fault_tolerance
Fix swarm manager node fault tolerance table
(cherry picked from commit ceb4126aa0)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:15 -07:00
Charles Smith
cdfde82612 Merge pull request #25205 from lixiaobing10051267/masterPath
Give the correct link of docker swarm init
(cherry picked from commit 93fea86d1d)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:15 -07:00
Vincent Demeester
e118034053 Merge pull request #25239 from dlech/patch-1
Make it clear which parmeter is the user
(cherry picked from commit c7fcf496af)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:15 -07:00
Sebastiaan van Stijn
9c2ba289dd Merge pull request #25020 from jfrazelle/update-non-events
update security non-events
(cherry picked from commit 14664beda9)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:14 -07:00
Charles Smith
5f3b3d651c Merge pull request #25182 from sfsmithcha/clarify_join_token
Author Merge add advertise address, clarify join token

CI errors expected.
(cherry picked from commit ee355e017d)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:14 -07:00
Charles Smith
1a5acb35e7 Merge pull request #25197 from sfsmithcha/add_services_guide
author merge: add services guide to manage a swarm
(cherry picked from commit 8b69d50c79)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:13 -07:00
Sven Dowideit
ddbc9c7d88 Merge pull request #25156 from londoncalling/docs-v112-getstarted-a
modifed d4mac and d4win download links to stable for v1.12
(cherry picked from commit 352c720d69)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-08-11 16:32:13 -07:00
Tibor Vass
8eab29edd8 Bump VERSION to v1.12.0
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-28 14:06:23 -07:00
Tibor Vass
3c292b6d92 Merge pull request #25191 from mavenugo/1.12.dl
Vendoring libnetwork to 1.12.0-bump branch to avoid a deadlock
2016-07-28 13:59:20 -07:00
Madhu Venugopal
4f369a74fa Vendoring libnetwork to avoid a deadlock
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-28 12:02:09 -07:00
Tibor Vass
cd22bb863c Merge pull request #25178 from crosbymichael/bump-restore
Check if the container is running if no event
2016-07-28 11:13:37 -07:00
Michael Crosby
eddee8e932 Check if the container is running if no event
When there is no event for the container it can happen because of a
crash and the container state on the persistent disk will have a
mismatch between what was in `/run` ( machine crash ).

This situation will create an unkillable container in docker because
containerd does not see it and it is not running but docker thinks it is
and you cannot tell it anything different.

This fixes the issue by checking if containerd has the container running
if we do not have an event instead of just returning.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-07-28 09:22:51 -07:00
Justin Cormack
664fcd9f28 Merge pull request #25142 from tiborvass/1.12.0-final-cherry-picks
1.12.0 final cherry picks
2016-07-28 00:21:36 +01:00
Tibor Vass
f399272f7b Merge pull request #25149 from tiborvass/1.12-changelog-fix
Add some ommissions to CHANGELOG and update some swarm commands
2016-07-27 15:28:46 -07:00
Madhu Venugopal
29f6886e48 Vendoring libnetwork to fix #25109
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit b1ae883d3f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:55:30 -07:00
Charles Smith
7f6a1d9fb7 update rolling update tutorial to reflect default parallelism and update on failure
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 6440cacd49)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:55:30 -07:00
Lei Jitang
c46db363d6 Fix daemon panic on restoring containers
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit c75de8e33c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:51:42 -07:00
John Howard
cda10d4d7f Move directive out of globals
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 755be795b4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:51:42 -07:00
Derek McGowan
3fba11f7c6 Fix files in subdirectories creating bad whiteout
Closes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 1c0f6653ba)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:51:42 -07:00
Derek McGowan
b49dd20939 Update diff apply test to check sub directories
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 5c05b8447d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:51:42 -07:00
Michael Crosby
0a4abdb0ac Remove the Require on the socket for the rpm
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 3cddda3bbb)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:51:42 -07:00
Brian Goff
d79bd3010a Fix issue with test ordering for TestParseWords
`TestParseWords` needs to use the `tokenEscape` for one of the test
cases, but `tokenEscape` was not being set unless tests ran in a
specific order.
This sets a default value for `tokenEscape`... `\`... so that tests that
rely on this global are not affected by test ordering.

This is the simplest fix for these cases. Ideally the token should not
be set as a global but rather passed down, which is a much larger
change.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit df167d3ff0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:51:42 -07:00
Harald Albers
486d5aa47f Remove bash completion for docker swarm inspect
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 34d9a82409)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:51:41 -07:00
Harald Albers
55b920c988 bash completion for container labels to service {create,update}
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 13c138ec2a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:51:41 -07:00
Tibor Vass
05073a911d Add some ommissions to CHANGELOG and update some swarm commands
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-27 14:46:01 -07:00
Tibor Vass
1f33c33fbe Merge pull request #25145 from aaronlehmann/remove-join-tokens-from-info
Carry #25134: Remove join-tokens from the /info API
2016-07-27 14:39:38 -07:00
Tibor Vass
7b7b9078cf Merge pull request #25140 from stevvooe/service-ps-over-tasks-bump_v1.12.0
[bump-1.12.0] cli: `docker service|node|stack ps` instead of tasks
2016-07-27 14:38:08 -07:00
Tibor Vass
c9b38547d5 Merge pull request #25144 from dnephin/remove-extraneous-aliases.bump
[bump_v1.12.0] Remove extraneous mount aliases
2016-07-27 14:13:49 -07:00
Tibor Vass
340ff060a8 Merge pull request #25103 from tiborvass/fix-bad-cherry-pick-info
Fix bad cherrypick from a91bc28e62
2016-07-27 12:45:31 -07:00
Aaron Lehmann
d8f3b3f006 Remove join-tokens from the /info API
join-tokens are not needed for this endpoint, and should not be as part
of /info

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-27 12:10:49 -07:00
Daniel Nephin
398bde913f Remove extraneous mount aliases.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-07-27 15:07:20 -04:00
Stephen J Day
2f736927a0 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>
(cherry picked from commit 0aa4e1e689)
2016-07-27 11:20:25 -07:00
Tibor Vass
69080f423d Merge pull request #25114 from SvenDowideit/bump_v1.12.0-docs
Bump v1.12.0 docs
2016-07-27 11:14:01 -07:00
Sebastiaan van Stijn
c62b19f1e3 Merge pull request #25126 from mlaventure/fix-weird-rpc-lock
Attach stdin after attach stdout/err to avoid an rpc lock
2016-07-27 18:53:07 +02:00
Sebastiaan van Stijn
441b660dd1 Add back links to 1.12 release in deprecated.md
These links were temporarily changed, because the
docs were published before the 1.12.0 tag was
available.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit cd69b94241)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-07-27 21:49:08 +10:00
Sebastiaan van Stijn
2e8165d503 Remove release-candidate advisories
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 053ac127ab)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
	docs/reference/commandline/service_create.md
2016-07-27 21:46:51 +10:00
Sebastiaan van Stijn
1717c76ff2 fix minor docs issues
this brings back the trailing whitespace in "runmetrics",
that were there intentially to force a line-break

also removes a duplicate redirect, that was present
on two pages

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d8434eba46)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-07-27 21:38:06 +10:00
mapk0y
b7e1ea51a0 fix the ipaddress of an explanation.
Signed-off-by: mapk0y <mapk0y@gmail.com>
(cherry picked from commit a94b48923e)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-07-27 20:40:26 +10:00
Charles Smith
b8333bfd5e add how services work to how swarm mode works guide
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit bef36fba40)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-07-27 20:40:17 +10:00
Charles Smith
ef19b22b85 add swarm manage nodes guide
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 704facbbab)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-07-27 20:40:07 +10:00
Charles Smith
0bd4111851 add doc for live-restore setting and daemonless containers, fix admin guide menu
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit cbd07495a3)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-07-27 20:39:57 +10:00
Sebastiaan van Stijn
81d31af68c Make archive links absolute
The archive is only available on docs.docker.com, and not
when doing a "make docs", so relative links will not resolve.

Making these links absolute, so that they always
point to the live "docs.docker.com" domain.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4b090ae5f2)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-07-27 20:39:43 +10:00
Mickaël FORTUNATO
9fa212ba59 Update docker_remote_api_v1.22.md
Update docker_remote_api_v1.23.md
Update docker_remote_api_v1.24.md
Update docker_remote_api_v1.25.md

look like ExecDriver is not return anymore

Signed-off-by: Mickaël Fortunato <morsi.morsicus@gmail.com>
(cherry picked from commit 166928a24b)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
2016-07-27 20:39:02 +10:00
Kenfe-Mickael Laventure
d6b53d91d7 Attach stdin after attach stdout/err to avoid an rpc lock
Reason of the lock is currently unknown

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-26 19:17:22 -07:00
Tibor Vass
e97e51d79c Fix bad cherrypick from a91bc28e62
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 18:15:37 -07:00
Tibor Vass
a3f206372f Bump VERSION to v1.12.0-rc5
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 06:04:00 -07:00
Tibor Vass
626b152944 Merge pull request #25063 from thaJeztah/man-page-cherry
cherry-pick manpages fix
2016-07-26 05:58:54 -07:00
Daniel Nephin
5b667c7c55
Require manpages for packages.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 1ea9c19ffe)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-26 14:43:35 +02:00
Daniel Nephin
c5531b033a
Make manpages in a conatiner.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 7004f219f5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-26 14:43:11 +02:00
Tibor Vass
4ed7f63f0d Merge pull request #25058 from tiborvass/additional-cherrypicks-for-1.12.0-rc5
[bump_v1.12.0] Additional cherrypicks for 1.12.0 rc5
2016-07-26 05:01:51 -07:00
Aaron Lehmann
e16a20d11a 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>
(cherry picked from commit f9c920a126)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 04:37:31 -07:00
Tibor Vass
0e2d7c996c Address some displaying issues in docker info
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8ad9438ede)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 04:37:31 -07:00
Vincent Demeester
a91bc28e62 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>
(cherry picked from commit e6923f6d75)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 04:37:31 -07:00
Tibor Vass
0ffa19daa8 vendor engine-api to a52656d77f09d394104c1639824eada038bfdb89
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit e3c150bd47)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 04:37:31 -07:00
Stephen J Day
c3574dd1ec container/controller: avoid cancellation with forked pull context
Context cancellations were previously causing `Prepare` to fail
completely on re-entrant calls. To prevent this, we filtered out cancels
and deadline errors. While this allowed the service to proceed without
errors, it had the possibility of interrupting long pulls, causing the
pull to happen twice.

This PR forks the context of the pull to match the lifetime of
`Controller`, ensuring that for each task, the pull is only performed
once. It also ensures that multiple calls to `Prepare` are re-entrant,
ensuring that the pull resumes from its original position.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit d8d71ad5b9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 04:37:26 -07:00
Madhu Venugopal
fe1d39cc96 Vendoring libnetwork to remove stale xfrm states
When using encrypted vxlan network, some of the xfrm states are left
stale. This fix also filters out self advertise-addr rules.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 6a754a4eef)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 03:51:44 -07:00
Tibor Vass
45c8a3ddd5 Prevent panic on update --container-label-add
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit e462b4507a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 03:51:43 -07:00
Vincent Demeester
8fe03baa41 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>
(cherry picked from commit 4031d70d1b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 03:51:43 -07:00
Tibor Vass
05444a56af Merge pull request #25045 from tiborvass/cherry-picks-1.12.0-rc5
Cherry picks for 1.12.0 rc5
2016-07-26 03:29:52 -07:00
Derek McGowan
86670cced9 Fix untag without force while container running
With digests being added by default, all images have multiple references.
The check for whether force is required to remove the reference should use the new check for single reference which accounts for digest references.
This change restores pre-1.12 behavior and ensures images are not accidentally left dangling while a container is running.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 1f7a9b1ab3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 01:53:17 -07:00
Aaron Lehmann
4b986851f7 Vendor swarmkit for 1.12.0-rc5
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 60496af711)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 01:52:07 -07:00
Derek McGowan
e111f0c7b2 Fix calculation of relative path for symlink on docker save
Relative paths are now calculated from a base path rather than from the file path, which gets treated like a directory.
Symlinks will now properly point to the file as "../<layer dir>/layer.tar" rather the incorrect "../../<layer dir>/layer.tar".

Fixes #24951

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 5487881e12)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 01:49:29 -07:00
Nishant Totla
25cf7999fa Using map to list plugins in node description
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit feedb7ab5a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 01:49:29 -07:00
Madhu Venugopal
678a19ef6b improve error message when using ineligible network with service create
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 40c88b8c54)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:27:41 -07:00
Stephen J Day
027de801a8 swarm/controller: allow cancellation to propagate
Ensure that cancellation of a pull propagates rather than continuing to
container creation. This ensures that the `Prepare` method is properly
re-entrant.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit d99c6b837f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:26:42 -07:00
Brian Goff
07735b4f0c fix panic on --label-add
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 85bc3194aa)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:47 -07:00
runshenzhu
84eae5d69f extend health check to start service
Signed-off-by: runshenzhu <runshen.zhu@gmail.com>
Signed-off-by: Runshen Zhu <runshen.zhu@gmail.com>
(cherry picked from commit a99db84b4a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:47 -07:00
Tibor Vass
0df31ff193 healthcheck: do not interpret exit code 2 as "starting"
Instead reserve exit code 2 to be future proof, document that it should
not be used. Implementation-wise, it is considered as unhealthy, but
users should not rely on this as it may change in the future.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 91e9f38313)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:47 -07:00
Nishant Totla
bf024205b7 Sort plugin names in node description
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit 227c7e4e8d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:47 -07:00
Alexandre Beslic
365d16ed6d swarm docs: add administration guide for Managers and Raft
This adds a guide with recommendations on how to setup
Managers and keep the Swarm cluster healthy.

Signed-off-by: Alexandre Beslic <alexandre.beslic@gmail.com>
(cherry picked from commit 24f87f26e7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:46 -07:00
Charles Smith
bd31863ba7 add run swarm mode guide
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit c406711cc0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:46 -07:00
Aaron Lehmann
a3639e6ac6 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>
(cherry picked from commit 57ae29aa74)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:43 -07:00
Aaron Lehmann
92cbdfece9 Revendor engine-api
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 3585026c3a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:37 -07:00
Josh Horwitz
c166b2c9da Treat HEALTHCHECK NONE the same as not setting a healthcheck
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
(cherry picked from commit 4016038bd3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:37 -07:00
Aanand Prasad
a688a0ae9d Add note about --entrypoint overriding default command
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
(cherry picked from commit 2b7548f972)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:37 -07:00
Anusha Ragunathan
52b078fb37 Handle plugin shutdown when liveRestore is set.
When daemon has liveRestore set, daemon shutdown should not shutdown
plugins. Fixes #24759

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 4a44cf1d4c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:37 -07:00
Kenfe-Mickael Laventure
47b7cf5ceb Fix missing unlock in libcontainerd.Restore()
This was preventing the "exit" event to be correctly processed during
the restore process without live-restore enabled.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit ac068a1f9d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:37 -07:00
Kenfe-Mickael Laventure
6142557cba Prepend libcontainerd log message with "libcontainerd:"
This will make it easier to pinpoint error messages in the daemon
logs.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 5231c55346)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:21:14 -07:00
Andrea Luzzardi
42e97d23e2 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>
(cherry picked from commit edd67fd4ad)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:29 -07:00
Sebastiaan van Stijn
ec241bfeaf 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>
(cherry picked from commit 3fa9d77bf3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:28 -07:00
Zhang Wei
861fa09131 small nit: fix unmeaningful log
Truncated dir name can't give any useful information, print whole dir
name will.

Bad debug log is like this:

```
DEBU[2449] aufs error unmounting /var/lib/doc: no such file or directory
```

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
(cherry picked from commit af8359562c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:28 -07:00
Sebastiaan van Stijn
e9190e0764 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>
(cherry picked from commit b0089e4827)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:23 -07:00
Tianyi Wang
14038215d3 Fix high cpu usage caused by docker stats.
Signed-off-by: Tianyi Wang <capkurmagati@gmail.com>
(cherry picked from commit 54e8beec9b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:16 -07:00
Tadej Janež
82219c7727 Expand instructions on using systemd to manage containers
Signed-off-by: Tadej Janež <tadej.j@nez.si>
(cherry picked from commit c8a99a5054)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:16 -07:00
Madhu Venugopal
c6ff464d43 Vendoring libnetwork for rc5
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 56b78ab2f2)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:15 -07:00
Madhu Venugopal
71d54a4bd3 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>
(cherry picked from commit 8f9066c468)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:15 -07:00
Everett Toews
beffc3e8c0 Fix AuthzPlugin URL fragment in docs
These docs have AuthzPlugin with a lower case 'z'. What the plugin
api is actually looking for is AuthZPlugin with an upper case 'Z'.

See 46e3a249a1/pkg/authorization/api.go (L5-L8)

Signed-off-by: Everett Toews <everett.toews@rackspace.com>
(cherry picked from commit c42fbc6b09)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:15 -07:00
John Starks
43193233f8 Windows: Restore console mode on set mode failure
SetConsoleMode() on input handles appears to remember invalid bits that
were set, causing problems for other programs (such as xcopy.exe) trying
to set the console mode after docker.exe has exited. Always restore
the input console mode on set failure.

Signed-off-by: John Starks <jostarks@microsoft.com>
(cherry picked from commit 83c186fdd4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:15 -07:00
allencloud
4cd455a8d9 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 4e959ef2f7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:15 -07:00
Steve Durrheimer
5aef7cc12d Add zsh completion for 'docker swarm join-token' command
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit a04bba8b89)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:14 -07:00
Madhu Venugopal
1cc85c1726 Daemon changes to pass exec-root to libnetwork
This is required to make the libnetwork's namespace mgmt
directory configurable

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit d3af5e3d4b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:14 -07:00
Aaron Lehmann
a0d1201e02 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>
(cherry picked from commit fca0b18dcb)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:12 -07:00
Aaron Lehmann
762a73bf7f 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>
(cherry picked from commit a0ccd0d42f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:03 -07:00
Aaron Lehmann
38beb3d9ab Vendor libnetwork and github.com/vishvananda/netlink
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 24d2d53f5d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:35 -07:00
Aaron Lehmann
ea9d74b755 Revendor swarmkit
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit d626875a94)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:34 -07:00
Vincent Demeester
6db1c73da7 Update swarm init task-history-limit docs
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 180f8c61bb)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:34 -07:00
Andrea Luzzardi
e6464aa5ab CLI: Change default Swarm task history retention limit.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
(cherry picked from commit d97c0a1f25)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:34 -07:00
Sebastiaan van Stijn
723073bccb bump engine-api to ebb728a1346926edc2ad9418f9b6045901810b20
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9a3e47511a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:34 -07:00
Sebastiaan van Stijn
b7a38b19b3 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>
(cherry picked from commit bd81df1278)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:26 -07:00
Stephen J Day
986a968044 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>
(cherry picked from commit 634f54a047)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:08 -07:00
Alessandro Boch
9e006577f4 Fix regression on --link on bridge network
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit 3a3f800ff4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:08 -07:00
Aaron Lehmann
1bb38f1a2b Update --update-parallelism docs
Update documentation to account for the changes in #24952.

docs/swarm/swarm-tutorial/rolling-update.md doesn't need any changes,
but the CLI reference pages should show the current help text.
drain-node.md no longer needs to specify --update-parallelism 1 in its
example.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 933ba8d7f7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:08 -07:00
Stephen J Day
16744cb970 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>
(cherry picked from commit 67246afd3d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:08 -07:00
Sebastiaan van Stijn
98f1c30e8c Remove "secrets" leftovers from docs
f5e1f6f688 replaced "secrets"
with "join tokens", which also removed the "auto-accept"
policy.

This removes some remaining references to those features.

Note that there are other references, but those
are already addressed in another pull request.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 987511712f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:06 -07:00
Harald Albers
ac6d5a01c1 bash completion for docker swarm join-token
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 42b4d6ebe4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:02 -07:00
Charles Smith
fa89f32b13 updates get started with swarm to use join-token
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 9ac145d736)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Vincent Demeester
9ec67fd8d1 Append --registry-auth with with
`--with-registry-auth` is more explicit.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 8426f72107)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Aaron Lehmann
7836221015 Reorder swarm commands
This way "join-token" appears next to "join" in the help output.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 58ba4c313b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Sebastiaan van Stijn
83e40c5025 remove "secrets" from completion scripts
Swarm join has been changed in f5e1f6f688,
removing various options and the "node accept" command.

This removes the removed options from the completion
scripts.

NOTE: a new command ("docker swarm join-token") was
also added, but is not part of this commit.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c4ab20c5f8)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Yong Tang
c6cd4b37c7 Update the errNoManager() to conform to swarm join-token
In 24823, `swarm join` has been updated to take a `--token`
flag and flag `--manager` has been removed. Though in errNoManager()
the error message still use the old description.

This fix update the error message in errNoManager() and conforms
to the current available flags.

This fix is related to 24823.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3d30155735)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Justin Cormack
adeba99c7f Make README less scabious
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit b2ad59e7bd)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Aaron Lehmann
b738f3f3e5 Revendor swarmkit
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit aaa0f0b246)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:00 -07:00
Aaron Lehmann
05b1803b13 Revendor engine-api
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 852091ad41)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:00 -07:00
Aaron Lehmann
5d7a3f7b5f 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>
(cherry picked from commit 2cc5bd33ee)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:59 -07:00
Sebastiaan van Stijn
4d7d354cff 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>
(cherry picked from commit 8f93128cd6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:28 -07:00
Kenfe-Mickael Laventure
33a8310bc8 Harmonize containerd commit used by all Dockerfile
When #24648 was merged, only the main Dockerfile was updated with the
new containerd commit, this commit brings the other Dockerfile up to
speed.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit d5cbc57eff)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:17 -07:00
Yong Tang
acfbf72906 Extend deprecation cycle to 3 releases by default
At the moment docker's deprecation policy is 2 release cycles by
default, which is around 5 months. This may not be enough for
production environment and there is a need to extend the
deprecation cycle to 3 releases (see #24494).

This fix updates the docs/deprecated.md and extend the deprecation
cycle to 3 releases.

This fix is related to #24494 and #24534.

This fix fixes #24534.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 9414955c60)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:16 -07:00
Alexandre Beslic
51b749e659 update libkv, fix wrong error check on zookeeper list
Signed-off-by: Alexandre Beslic <alexandre.beslic@gmail.com>
(cherry picked from commit 5189e3d50d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:16 -07:00
Sebastiaan van Stijn
f001601c09 docs: improve formatting and highlighting of docker ps reference
this improves the formatting, and code-highlighting
of the `docker ps` reference page, and wraps sentences
to 80 chars

also adds single quotes around the formatting
example for labels.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 07ef0a37f8)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:16 -07:00
Nishant Totla
5d56800537 Send registry auth token for service deploy
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit a26bdd8607)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:16 -07:00
fonglh
9f5465d4e6 Clarify API behavior when older versions are called.
Signed-off-by: fonglh <fonglh@gmail.com>
(cherry picked from commit f62e24f697)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:16 -07:00
Stephen J Day
6a06d8d94c 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>
(cherry picked from commit a40b5820c9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:16 -07:00
Harald Albers
8e0e7644d8 Add manual support for macvlan networks to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 6c98d5bfac)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:15 -07:00
Sebastiaan van Stijn
7876fa1c2d docs: fix copy/pasta error
Looks like I copied from the line below, not
from the output :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 83b12c0c11)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:15 -07:00
Drew Erny
fd231567dc Added leader election test
Signed-off-by: Drew Erny <drew.erny@docker.com>
(cherry picked from commit 3489e76513)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:14 -07:00
Sebastiaan van Stijn
178b6874a1 docs: add code-hints to builder page
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b5503ef0a5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:52 -07:00
Sebastiaan van Stijn
84e78fe955 Add missing --log-driver and --log-opt docs
Adds documentation for "--log-driver" and "--log-opt"
for services.

Also updated the API docs to include the new
options, and generated a more complete JSON
example.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5ece2a6e0d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:50 -07:00
Sebastiaan van Stijn
8f0ec20157 docs: update reference docs for plugins
the output/response slightly changed in
340964db1c,
and `:latest` is no longer required for
various actions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9d532b5e2d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:46 -07:00
Charles Smith
6dfb916abf add how nodes work to how swarm works guide
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 137261f97c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:45 -07:00
Harald Albers
2d5716544d Update completions for syslog log driver options
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 492fdf1f57)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:45 -07:00
Yong Tang
9ce976f4f6 Vendor swarmkit to 9ee5fc3b8db5de8c8593a57bc45fc178f74ceee1
This commit update swarmkit to 9ee5fc3b8db5de8c8593a57bc45fc178f74ceee1.

This is part of step to fix #24270.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 467107cd40)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:45 -07:00
Yong Tang
06f8cd5f31 Allow partial name match for node ls, and node tasks
This fix is an extension to last commit to expand the partial
filter to node and task searches.

Additional integration tests have been added to cover the changes.

This fix fixes 24270.
This fix fixes 24112.

Note: A separate pull request will be opened on swarmkit.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit e734fa58ea)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:45 -07:00
Yong Tang
7ebba69c43 Allow partial name match for service ls --filter
This fix tries to address the issue raised in 24270 where it was
not possible to have a partial name match when list services
with name filter.

This fix updates swarmkit and allows prefix search when name is
provided as the filter for listing services.

An additional integration test is added to cover the changes.

This fix fixes 24270.

Note: A separate pull request will be opened on swarmkit.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 1d600ebcb5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:45 -07:00
Charles Smith
14835b6834 clarify update-delay and rolling update behavior
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 68a9224bd4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:45 -07:00
Sebastiaan van Stijn
ece06aee06 docs: add initial reference for "stack services"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f49dc528ed)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:44 -07:00
Sebastiaan van Stijn
33ff331ad7 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>
(cherry picked from commit 06f35262c4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:44 -07:00
Harry Zhang
fd7cabed36 Fix nits in deprecated
Signed-off-by: Harry Zhang <harryz@hyper.sh>
(cherry picked from commit 78a5480dfd)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:44 -07:00
Sebastiaan van Stijn
c3a114d4d4 fix duplicated usage in docs
this removes a copy/pasta whoopsie on my side,
introduced in de64324109

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit effbd2b76d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:44 -07:00
Yi EungJun
a3d9a99c0e Fix the usage for service rm command
Signed-off-by: Yi EungJun <eungjun.yi@navercorp.com>
(cherry picked from commit cf61cd3a92)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:44 -07:00
Steve Durrheimer
80463d8000 Add zsh completion for 'docker node update --label-{add,rm}'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit cdb8383d7f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:44 -07:00
Steve Durrheimer
b29a9fdc4b Add zsh completion for 'docker service {create,update} --log-{driver,opt}'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 45484f5458)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:43 -07:00
Charles Smith
05e6d5f5db add ref docs for node label
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 9594ac97ce)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:43 -07:00
Dong Chen
61936227d0 Test rolling update.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit d327765a62)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:43 -07:00
Anusha Ragunathan
05b7fe4170 Remove extra map lookup for volume drivers.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 5d4627331e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:43 -07:00
Vincent Demeester
1b131678da 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>
(cherry picked from commit 10919e8909)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:43 -07:00
Kenfe-Mickael Laventure
afc64c2d71 Update libcontainerd.AddProcess to accept a context
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit c02f82756e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:43 -07:00
Kenfe-Mickael Laventure
b7687cc673 Do not rely on "live" event anymore
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 64483c3bda)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Kenfe-Mickael Laventure
6c717a5744 Vendor in new containerd
This version introduces the following:
 - uses nanosecond timestamps for event
 - ensure events are sent once their effect is "live"

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 29b2714580)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Daniel Nephin
0649299908 Dont run man generation as part of test-unit.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 47cca88c8c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Daniel Nephin
3430f2e756 Set Long text for volume commands so they can be used to generate man pages.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 25e9b06ac0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Daniel Nephin
ea0d7e5271 Add a script to generate man pages from cobra commands.
Use the generate.sh script instead of md2man directly.
Update Dockerfile for generating man pages.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 00a8a40398)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Michael Crosby
14aee340f8 Remove docker.socket from rpm based systems
Fixes #23981

The selinux issue we are seeing in the report is related to the socket
file for docker and nothing else. By removing the socket docker starts
up correctly.

However, there is another motivation for removing socket activation from
docker's systemd files and that is because when you have daemons running
with --restart always whenever you have a host reboot those daemons
will not be started again because the docker daemon is not started by
systemd until a request comes into the docker API.

Leave it for deb based systems because everything is working correctly
for both socket activation and starting normally at boot.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 04104c3a1e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Anusha Ragunathan
fee68def8f Add only legacy plugins to the legacy lookup map.
Legacy plugin model maintained a map of plugins. This is
not used by the new model. Using this map in the new model
causes incorrect lookup of plugins. This change uses adds
a plugin to the map only if its legacy.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 8fd779dc28)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Sebastiaan van Stijn
45920009cc 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>
(cherry picked from commit 4f0b510552)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:41 -07:00
Harald Albers
6c3019702e bash completion for docker node update --label-{add,rm}
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit bc6e3c0b5e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:41 -07:00
Harald Albers
4845b686b2 bash completion for docker service {create,update} --log-{driver,opt}
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 823e161de7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:41 -07:00
Damian Smyth
f370132a42 Create zfs directory if it doesn't exist at startup.
Signed-off-by: Damian Smyth <damian@dsau.co>
(cherry picked from commit 205bc6fc99)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:41 -07:00
Sebastiaan van Stijn
47a16dbe31 bump Go to 1.6.3
following the announcement;
https://groups.google.com/forum/m/#!topic/golang-announce/7JTsd70ZAT0

> [security] Go 1.6.3 and Go 1.7rc2 pre-announcement
>
> Hello gophers,
> We plan to issue Go 1.6.3 and Go 1.7rc2 on Monday July 18 at approximately 2am UTC.
> These are minor release to fix a security issue.
>
> Following our policy at https://golang.org/security, this is the pre-announcement of those releases.
>
> Because we are so late in the release cycle for Go 1.7, we will not issue a minor release of Go 1.5.
> Additionally, we plan to issue Go 1.7rc3 later next week, which will include any changes between 1.7rc1 and tip.
>
> Cheers,
> Chris on behalf of the Go team

**Note:**
the man/Dockerfile is not yet updated, because
the official image for Go 1.6.2 has not yet
been updated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 589bafddf3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:39 -07:00
Tonis Tiigi
2456150a52 Update docker load security docs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit f17469e890)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:26 -07:00
Dong Chen
f3fea0ea88 Support node label update.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit e1165cdfd1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:26 -07:00
Stephen J Day
71a8ee2f49 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>
(cherry picked from commit e778ba2d5b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
John Starks
4d0f6041ad Windows: Always enable VT emulation
Always enable VT output emulation when starting the process so that
non-attaching commands can still output VT codes.

Also remove the version block for using the native console and just rely
on supported flags being present.

Signed-off-by: John Starks <jostarks@microsoft.com>
(cherry picked from commit 4acc2c7499)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
Anusha Ragunathan
da773af885 Print plugin name on successful install, enable and disable.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 6dca1e6d3f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
Aaron Lehmann
3b20018dd0 Update vendored go-events
This is needed to suppress a log message about a harmless condition
which was previously logged at the WARNING log level with potentially
high frequency (https://github.com/docker/go-events/pull/11).

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit db9bc51cbe)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
Justyn Temme
fc22510aef suggested improvements for Debian install doc issue #23884
Signed-off-by: Justyn Temme <justyntemme@gmail.com>
(cherry picked from commit b74b46b26a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
Anusha Ragunathan
c04c127ce3 Remove use of exec-root in plugins due to socket pathname limits.
Unix sockets are limited to 108 bytes. As a result, we need to be
careful in not using exec-root as the parent directory for pluginID
(which is already 64 bytes), since it can result in socket path names
longer than 108 bytes. Use /tmp instead. Before this change, setting:
- dockerd --exec-root=/go/src/github.com/do passes
- dockerd --exec-root=/go/src/github.com/doc fails
After this change, there's no failure.

Also, write a volume plugins test to verify that the plugins socket
responds.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 21ecd5a93d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
Tonis Tiigi
abf9cfe22f Increase timeout for swarm requests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 85b1fdf15c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:24 -07:00
Sebastiaan van Stijn
4118e0c9ee Improve flag help consistency, and update docs
This adds the `--live-restore` option to the documentation.

Also synched usage description in the documentation
with the actual description, and re-phrased some
flag descriptions to be a bit more consistent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 64a8317a5a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:24 -07:00
allencloud
5fcac2cdfd better command docker network create -h output
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit d0081a0f47)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:24 -07:00
Yanqiang Miao
de2498db0b Fix link errors in 'docs/reference/api/docker_remote_api_v***.md'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update fix-link-err-in-docs

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update fix-link-err-in-docs

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update fix-link-err-in-docs

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit f9ef10f853)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:22 -07:00
Yong Tang
ebb3cca216 Fix inconsistent fields for resource settings on service for API docs
In API docs, `CPU` and `Memory` were used for resource settings on
services. The actual settings should be `NanoCPUs` and `MemoryBytes`.

This fix address the inconsistent fields between API docs and actual
settings.

This fix fixes #24058.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 0159ee1f5d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:17 -07:00
Sebastiaan van Stijn
da699d3207 docs: update Oracle support link
The none-https url results in a redirect
to https://support.oracle.com/epmos/faces/MosIndex.jspx?......
which our link-checker didn't like.

The https link looks to be a direct link,
and not resulting in a redirect, so updating the URL.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c15144c4ec)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:13 -07:00
Justin Cormack
91432080bf Document --oom-score-adj flag in docker run
This was only mentioned in docker create documentation.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 6ba6265d1a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:13 -07:00
Vincent Demeester
285bfa04ac Small zsh completion fix on --pretty & --no-resolve
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 698bd5ab65)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:13 -07:00
Daniel Nephin
cf2b19a72e Only show port name if set.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 909c596fa5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:13 -07:00
Victoria Bialas
2b7c285ddc fixed cut-and-paste error on description of Docker Toolbox
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
(cherry picked from commit 6f9e310831)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:13 -07:00
Charles Smith
f0c76fb8d5 update create swarm and add nodes to use the auto-generated join command
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit fec803f779)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:13 -07:00
Lei Jitang
3d0cd8442e Fix daemon panic use wrong graphdriver with --live-restore flag
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit d9e8cea1b6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:12 -07:00
Tonis Tiigi
09b01499b7 Wait for the reader fifo opening to block
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 0b2023130e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:12 -07:00
Yanqiang Miao
63084741f0 Delete redundant content of 'docs/extend/plugins.md'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

Update plugins.md

Update plugins.md

(cherry picked from commit cfe9d2ff1e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:12 -07:00
Steve Durrheimer
e4d263c99b Update zsh completion for 'docker service {create,update} {--endpoint-mode,--mode}'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 2e6922a6d3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:12 -07:00
Steve Durrheimer
f6dfc0394f Add zsh completion for 'dockerd --oom-score-adjust'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 5d29732bdf)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:12 -07:00
Qiang Huang
cf83ab8e6d Fix aufs docs
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
(cherry picked from commit 92dfbc1e2d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:12 -07:00
Tonis Tiigi
211f871092 Fix panic in stats test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit f5fb3c69fd)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:11 -07:00
Steve Durrheimer
5f8d7aa0f4 Add zsh completion for 'docker service {create,update} --registry-auth'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 64f08906a2)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:11 -07:00
Steve Durrheimer
e204600ee1 Rename zsh completion for 'docker {create,run} --net --net-alias' to '--network --network-alias'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit ba5d9f63a3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:11 -07:00
Paul Furtado
25caee39a7 Change $prog back to docker in sysvinit-redhat
(and set $exec to dockerd instead)

This ensures end users do not need to make any configuration changes
due to the rename from docker to dockerd in version 1.12.

Signed-off-by: Paul Furtado <pfurtado@hubspot.com>
(cherry picked from commit acb41ddc9d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:11 -07:00
Michael Crosby
4516769d50 State that docker supports fedora 24
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 6780bdcbad)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:11 -07:00
Michael Crosby
c8dec6c2dd Enable docker socket and service on fedora
Make sure that the users enable both the socket and service for docker
as part of the default install instructions.  If both are not enabled
docker will not start at boot and restart containers.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 7a93a87c1a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:11 -07:00
Anil Madhavapeddy
12e32363e9 docs: correct the placement constraints docker service example
- the constraint expression needs to be quoted
- add an actual redis container to run so the command line works

Signed-off-by: Anil Madhavapeddy <anil@docker.com>
(cherry picked from commit c37da1792d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:11 -07:00
Derek McGowan
e678d9fb7c Allow v1 search to use v2 auth with identity token
Updates the v1 search endpoint to also support v2 auth when an identity token is given.
Only search v1 endpoint is supported since there is not v2 search currently defined to replace it.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
(cherry picked from commit 19d48f0b8b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:10 -07:00
Derek McGowan
9deaa5cc1d Vendor distribution changes
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 1e0b7538fa)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:10 -07:00
Kenfe-Mickael Laventure
ec03307eb2 Fix data race in libcontainerd
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 8e9fbc8f5f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:10 -07:00
Eivin Giske Skaaren
5bb9640ab8 Status code 409 received when conflicting name when creating container
Signed-off-by: Eivin Giske Skaaren <eivin@sysmystic.com>
(cherry picked from commit 5bf46cc436)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:08 -07:00
Vincent Demeester
07bc1eecab Update service inspect --pretty reference docs
Update the output and fix wrong usage in a tutorial page.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit cc651bc642)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:00 -07:00
Vincent Demeester
e04733a67e Update service update commandline reference docs
Update with the new remove flags

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit dbe310eff0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Justin Cormack
a5584f5f41 Expand the documentation of "no-new-privileges"
The change to runc in https://github.com/opencontainers/runc/pull/789
was not documented previously. Also say what this affects and clean
up layout of initial table as there was some miscolouration of the
continuation lines.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 3050d9af9b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Daniel Nephin
fc3d339109 Fix multi-remove during service update.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 3249c1d0e7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Daniel Nephin
fad55b0ea1 Change the add/update flags to include 'add'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 4c6faa4340)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Daniel Nephin
1cf4bd4df7 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>
(cherry picked from commit ead1f62aba)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Daniel Nephin
b5f1b77a23 Add remove flags for service update
with unit tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit dc33fc1ff4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Aaron Lehmann
32b12ed57a 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>
(cherry picked from commit 6de8fcb2f2)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Dong Chen
a769e22b70 Fix service inspect --pretty.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit 08ae4e544d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Sebastiaan van Stijn
a89bd71433 Remove dead code for "inspect --pretty"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4d87f9083b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Harald Albers
3bd6c0b8dd bash completion for docker daemon --oom-score-adjust
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e1e310ea1f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Daniel Nephin
9f86a9712d Merge service command and args as a string.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 674d227445)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Daniel Nephin
d8e9dbf628 Vendor go-shlex.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 3464589c2a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Sebastiaan van Stijn
7491ebe00a Remove shorthand flags for "mount", "pretty", and "no-resolve"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7bf0faf423)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Michael Crosby
89986cbff4 Add --oom-score-adjust to daemon
This adds an `--oom-score-adjust` flag to the daemon so that the value
provided can be set for the docker daemon's process.  The default value
for the flag is -500.  This will allow the docker daemon to have a
less chance of being killed before containers do.  The default value for
processes is 0 with a min/max of -1000/1000.

-500 is a good middle ground because it is less than the default for
most processes and still not -1000 which basically means never kill this
process in an OOM condition on the host machine.  The only processes on
my machine that have a score less than -500 are dbus at -900 and sshd
and xfce( my window manager ) at -1000.  I don't think docker should be
set lower, by default, than dbus or sshd so that is why I chose -500.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit a894aec8d8)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:57 -07:00
Sebastiaan van Stijn
0ce4630533 docs: fix output of node inspect
The output uses tabs, but those don't
translate well to the rendered output in
the docs, so replacing the tabs with spaces.

Also updates the output, because REPLICATED,
and SPREAD are no longer all-caps in the
actual output.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 477a5f8fb0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:57 -07:00
Vincent Demeester
cda05164ba Remove --command flag for service update
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit e4a024d590)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:57 -07:00
Alessandro Boch
dc5f28f4b5 Handle ingress sbox creation gracefully
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit ed6641ad61)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:57 -07:00
Alessandro Boch
8d7223d991 Vendoring libnetwork 905d374
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit cabc5b27c0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:57 -07:00
Sebastiaan van Stijn
ca9805f78d Make labels human readable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ea365e4cb3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:55 -07:00
Akihiro Suda
eb8bbea3d1 Remove "Yes"/"No" and use "true"/"false" consistently in docker info
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit c6b7bd1aa6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:21 -07:00
Harald Albers
8a810acb1e Change bash completion for docker run --net* to --network*
Ref: https://github.com/docker/docker/pull/23324

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit c4846f6972)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:13:49 -07:00
Lei Jitang
96247f4277 Add IPVLAN and DUMMY to check-config.sh
This commit add DUMMY and IPVLAN to check-config.sh
because they are need for ipvlan and macvlan network
driver.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit f5940ef725)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:13:48 -07:00
Harald Albers
9b0ebd26e8 Update bash completion for docker service {create,update} {--mode,--endpoint-mode}
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit a394490d38)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:13:48 -07:00
Harald Albers
fc4c8d927a bash completion for docker service {create,update} --registry-auth
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit a44e71c427)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:13:48 -07:00
Sebastiaan van Stijn
ccffaddb55 docs: remove executiondriver from API 1.24 docs
the executiondriver property was removed in
880484992c, but docs
were only updated for the 1.25 API, not for 1.24

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3c6ef4c29d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:13:48 -07:00
Mei ChunTao
b2334cc79d fix the docker run --readonly example. rename '/icanwrite here' to '/icanwrite/here'
Signed-off-by: Mei ChunTao <mei.chuntao@zte.com.cn>
(cherry picked from commit acbe38a3cc)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:13:48 -07:00
Alexander Morozov
926d66b50f all: fix usage of some variables
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 57e14714ee)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:13:48 -07:00
Neil Peterson
de6b73a1a8 Added daemon.json Windows example
Signed-off-by: Neil Peterson <neilpeterson@outlook.com>
(cherry picked from commit 8352089e8c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:13:47 -07:00
Tibor Vass
e4a0dbc472 Bump VERSION to v1.12.0-rc4
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 20:27:22 -07:00
Tibor Vass
8ab73b58e7 Merge pull request #24571 from tiborvass/buildid-docker-proxy-cherrypick
[bump_v1.12.0] docker-proxy: Force external linking to add BuildID information to pl…
2016-07-12 20:23:40 -07:00
Tibor Vass
3cad13f679 docker-proxy: Force external linking to add BuildID information to please rpm
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 9a690d3544)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 20:01:51 -07:00
Tibor Vass
e4c35bd74c Merge pull request #24467 from tiborvass/cherry-picks-1.12.0-rc4
[WIP] Cherry picks 1.12.0 rc4
2016-07-12 17:47:32 -07:00
Tibor Vass
ff7c84b867 Merge pull request #24567 from tiborvass/bump_v1.12.0
Bump VERSION to v1.12.0-rc3
2016-07-12 17:46:52 -07:00
Christy Perez
f00c098bf7 Uncomment the TasksMax val later in the deb build
The original sed placement was creating packages with an
"unsupported" tag in the package name.

Fixes #24197

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
(cherry picked from commit dab287819a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 16:09:58 -07:00
Arnaud Porterie (icecrime)
c61fa33c23 Rename --net to --network
Add a `--network` flag which replaces `--net` without deprecating it
yet. The `--net` flag remains hidden and supported.

Add a `--network-alias` flag which replaces `--net-alias` without deprecating
it yet. The `--net-alias` flag remains hidden and supported.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
(cherry picked from commit c0c7d5e715)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:38 -07:00
Arnaud Porterie (icecrime)
e3ed7f8c7b Organize run flags into categories
Flatten the list of `docker run` flags and group them loosely by
category (general purpose, security, networking, ...).

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
(cherry picked from commit 5b21c8a408)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:38 -07:00
Brian Goff
31d24fa6a9 Fix panic while merging log configs to nil map
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 7dff310648)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:38 -07:00
Brian Goff
98b155379b Fix panic when meminfo couldn't be read
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 5f7b1b604c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:38 -07:00
Madhu Venugopal
9a0e0cccfe Fixing a stale endpoint issue that blocks ingress network cleanup
fixes #24400

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit a4926a4d92)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:38 -07:00
Madhu Venugopal
6ce4e9b50c Vendoring libnetwork
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 92c40f9bc0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:37 -07:00
Sebastiaan van Stijn
bc5eb28299 Fix some broken sourceforge.net links
Looks like there's issues with sourceforge project
pages. Given that sourceforge isn't really what
it used to be, trying to find alternative URLs
where possible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0e7a1079be)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:37 -07:00
Sebastiaan van Stijn
156495f3a6 Add "auto-accept=none" to documentation
The "none" option was not added to the documentation.
This adds an example, and adds additional information
on manually accepting or rejecting a node.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 06517753c1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:37 -07:00
Alexander Morozov
eaa8821a23 integration-cli: add test for restarting entire swarm cluster
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ae4137ae3c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:37 -07:00
Charles Smith
85bb54b988 add caveat for network plugins in swarm mode
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 9ae64de614)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:37 -07:00
Ralf Sippl
909e7a2ca5 Add API test for empty services list
Signed-off-by: Ralf Sippl <ralf.sippl@gmail.com>
(cherry picked from commit 65e72133a1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:37 -07:00
Ralf Sippl
18f1fc8349 Return an empty services list if no services are running
Signed-off-by: Ralf Sippl <ralf.sippl@gmail.com>
(cherry picked from commit c8e4e95db9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:36 -07:00
Derek McGowan
adfeccf06f Allow option to override kernel check in overlay2
Add option to skip kernel check for older kernels which have been patched to support multiple lower directories in overlayfs.

Fixes #24023

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit ff98da0607)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:36 -07:00
Aaron Lehmann
72274de26e Don't retry push on an unknown repository
If the remote registry responds with a NAME_UNKNOWN error, treat this as
a fatal error and don't retry the push.

Tested against an ECR registry.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit a12ab28e0a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:36 -07:00
johnharris85
c0a787db2b Add support for comma-separated --auto-accept syntax.
Signed-off-by: John Harris <john@johnharris.io>

(cherry picked from commit 8e14882773)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:36 -07:00
Yong Tang
209f6e27e0 Fix a minor typo in swarm tutorial docs
This fix fixes a minor typo in swarm tutorial's delete service docs.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 93fa7e7555)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:36 -07:00
Sebastiaan van Stijn
d16f04942f Add missing API docs for HostConfig.PidMode
The `--pid` flag was added in Docker 1.5.0, but the
API changes were not documented. In Docker 1.12.0,
`--pid=container:<name|id>` was added as an additional
option, but also undocumented.

This adds the missing API documentation for this
option.

Also see commits
47e3da848f (for 1.5.0), and
ebeb5a0422 (for 1.12.0).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2c9b5addc5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:33 -07:00
Dave Henderson
5dafcf2170 Clarify warning against using build-time variables for secrets
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
(cherry picked from commit 9af24ba3ac)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:21 -07:00
Tonis Tiigi
56ab840f37 Use waitAndAssert to test node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit f02ec39e99)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:21 -07:00
Anusha Ragunathan
db94be5084 Shutdown plugins during daemon shutdown.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 863ab9ab13)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:21 -07:00
Qiang Huang
88d82eee4b 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>
(cherry picked from commit 1fb1136fec)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:18 -07:00
Mansi Nahar
c164011a4e Change content-trust doc to not point to images that don't exist #22730
Signed-off-by: Mansi Nahar <mmn4185@rit.edu>
(cherry picked from commit 82d70f4409)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:40 -07:00
Madhu Venugopal
e7dd82fab0 swarmkit expects network-id for as target
For any operation that involves netwoks (other than network create),
swarmkit expects the target as network-id. Service upate was using
network-name as the target and that caused the issue.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit b32cfb32a3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
allencloud
25b235a1b1 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 416613f2e5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
Joao Fernandes
e07a1af84b Fixes broken link in docs.
Fixes #24428

Signed-off-by: Joao Fernandes <joao.fernandes@docker.com>
(cherry picked from commit 6c9b5da5a1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
Kara Alexandra
e0960bd8e7 Add blanks lines in docs for clarity
Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
(cherry picked from commit d0737e9ac0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
Lucas Chi
f17d02c992 Fix grammar in docker volumes tutorial
Signed-off-by: Lucas Chi <lucas@teacherspayteachers.com>
(cherry picked from commit 7b3ac47fa4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
runshenzhu
2e37061278 add health check in docker cluster
Signed-off-by: runshenzhu <runshen.zhu@gmail.com>
(cherry picked from commit 1ded1f26e1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
Antonio Murdaca
e76138c35f integration-cli: fix --net=none tests
Example:

21:28:01 [d68573521] waiting for daemon to start
21:28:01 [d68573521] daemon started
21:28:01 docker_api_swarm_test.go:163:
21:28:01     c.Assert(d1.Init(map[string]bool{"worker": true}, ""),
checker.IsNil)
21:28:01 ... value *errors.errorString =
&errors.errorString{s:"initializing swarm: invalid statuscode 500,
\"{\\\"message\\\":\\\"could not determine local IP address: dial udp
8.8.8.8:53: connect: network is unreachable\\\"}\\n\"} ("initializing
swarm: invalid statuscode 500, \"{\\\"message\\\":\\\"could not
determine local IP address: dial udp 8.8.8.8:53: connect: network is
unreachable\\\"}\\n\"")
21:28:01
21:28:01 [d68573521] exiting daemon"}

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 9fadb8fd6a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:38 -07:00
Yong Tang
adbb169463 Fix seccomp output in docker info
This fix tries to address the issue raised in #24374 where
`docker info` outputs seccomp support in Ubuntu 14.04 but
the seccomp wass not actually supported.

The issue is that in the current docker implementation, seccomp
support is only checked against the kernel by inspect CONFIG_SECCOMP
and CONFIG_SECCOMP_FILTER. However, seccomp might not be enabled
when building docker (through golang build flag).

This fix adds a supportSeccomp boolean variable. The supportSeccomp
is only set to true when seccomp is enabled when building docker.

This fix fixes #24374.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit a3b9dd89a1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:38 -07:00
Tonis Tiigi
b008283a7f Add more complicated demotion testcases
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit a3f1577365)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:38 -07:00
Tonis Tiigi
82603c3abe Add logdrivers to executor from swarmkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 8a50315f3c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:38 -07:00
Tonis Tiigi
df6581abab Update executor volumes from swarmkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 6586f4f071)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:38 -07:00
Tonis Tiigi
0450069179 vendor: update swarmkit to 6478bc19
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 4d12e64cd4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:38 -07:00
Yong Tang
9b5d507804 Add release tag reference links in deprecated.md
This fix adds a couple of missed release tag reference links in deprecated.md

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit bc20354b09)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:37 -07:00
Justin Cormack
92b4422572 Add ltdl dependencies for aarch64
Fixes `make test` and fix #24380 on aarch64

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit d37a7394ac)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 16:04:34 -07:00
Harald Albers
d8d1573b0d bash completion for default port on docker swarm {init,join}
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 009d50e2d8)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:30 -07:00
Harald Albers
00a988c2ad bash completion can be configured to show node and service IDs
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 715754ee61)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:30 -07:00
Harald Albers
89bb424ce2 bash completion for docker {service,node} filters
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 2b34fa0511)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:30 -07:00
Akihiro Suda
1a45978a2d Validate arguments for ps in docker top
Fix #24357

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit 2539332209)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:30 -07:00
Brian Goff
2bb603aafd Fix daemon not cleaned up w/ live restore enabled
This patch makes sure daemon resources are cleaned up on shutdown if
there are no running containers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 2d5dc94b9b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:30 -07:00
Madhu Venugopal
b74b71ecb3 fixes #23983
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 6a4b21bd86)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:29 -07:00
Madhu Venugopal
65a256f7a8 Revert "Fixed a few network UI issues in swarm-mode"
This reverts commit 0ce5158a2a.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 4623276886)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:29 -07:00
Justin Cormack
b1819cb61b Add missing docker-proxy into managed files in rpm spec
This was missed in #23312 even though the other parts of
this were fixed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 47ace5cd98)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:29 -07:00
Antonio Murdaca
52ca6cb63a daemon: ensure we set default options to stock runtime
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 59162641cc)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:29 -07:00
Justin Cormack
234861710f Update binary install docs with new contents of tgz
This is now up to date with contents of 1.12 tgz

Also change usage to `dockerd` not `docker daemon`

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 7102e09f29)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:29 -07:00
Charles Smith
e90025aa76 add constraint to service create ref
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 093817031a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:29 -07:00
Sebastiaan van Stijn
7a09cd2772 add iptables=false to docs for multiple daemons
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1255e53e28)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:28 -07:00
Justin Cormack
a654ab1e89 Fix test case for docker_api_swarm_test.go
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 6dfba780cc)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:28 -07:00
Justin Cormack
3c338c7d8a Update swarmkit vendoring
Needed for libnetwork vendoring

Update Secret API name change correspondingly

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit d428a7a425)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:28 -07:00
Justin Cormack
bf2efa3332 Update libnetwork vendoring
Update now that the changes in https://github.com/docker/libnetwork/pull/1230
have been merged

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 3ae0c66450)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:28 -07:00
Justin Cormack
d28a8673b5 Make the docker proxy a standalone binary not a re-exec
This reduces memory usage with a lot of docker proxy processes.
On Docker for Mac we are currently carrying a patch to replace
the binary as we modify it to forward ports to the Mac rather
than the Linux VM, this allows us to simply replace this binary
in our packaging with one that has a compatible interface. This
patch does not provide an easy way to substitute a binary as
the interface is complex and there are few use cases, but where
needed this can be done.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 0682468431)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:28 -07:00
John Howard
0a861141fa Windows: Ensure VolumePath is not set for Hyper-V containers
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit fd4f5c2365)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:28 -07:00
Vincent Demeester
f831be849b 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>
(cherry picked from commit f4cfc6b983)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:27 -07:00
Aaron Lehmann
a00d12a8dd 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>
(cherry picked from commit 7342e42fce)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:27 -07:00
Vincent Demeester
23be238414 Use "on-failure" for both containers and services
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit a859a33647)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:21 -07:00
Vincent Demeester
3b8f724a96 Vendor engine-api 1d247454d4307fb1ddf10d09fd2996394b085904
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 6ec4a640de)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:34 -07:00
Anusha Ragunathan
61dc82f423 Detect non-plugin content during install and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit d32df6d934)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:34 -07:00
Brian Goff
843b4a93fe 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>
(cherry picked from commit 56f3422468)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:30 -07:00
Brian Goff
272e75f9a0 re-vendor swarmkit
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit db271b8833)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:23 -07:00
Brian Goff
f331f05f9a re-vendor engine-api
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 140ec59db6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:23 -07:00
Anil Madhavapeddy
0a21d2b8d0 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>
(cherry picked from commit 2de9585f5e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:23 -07:00
Yong Tang
ee1fa5b464 Change NAME to HOSTNAME in docs for docker node ls
In #24159, the title field of `docker node ls` has been
changed from NAME to HOSTNAME. However, in the docs the
NAMEs are still used for the output of `docker node ls`.

This fix updates docs so that NAME field is changed to
HOSTNAME for all `docker node ls`.

This fix is related to #24159 and #24090.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 668b8a998f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Jonathan Lomas
6b30370210 Remove unmatched bracket from _docker for zsh
Signed-off-by: Jonathan Lomas <jonathan@floatinglomas.ca>
(cherry picked from commit 7631dc80a6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Brian Goff
85aefec45a Implement service integration tests
This is done in a hacky way as currently there is no better way.
Uses known implementation details about how tasks are scheduled to be
able to operate on the underlying container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e5ec575b32)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Antonio Murdaca
3bf23479cf integration-cli: ensure digest is the same after cross-repo push
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit a0c8970df1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Antonio Murdaca
f7a8a315e7 vendor docker/distribution 4e17ab5d319ac5b70b2769442947567a83386fbc
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 8aa37bdbb7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Anil Madhavapeddy
b18cea6d0f Improve the warning messages when leaving a Swarm cluster
Signed-off-by: Anil Madhavapeddy <anil@docker.com>
(cherry picked from commit 22a3d1fa20)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Vincent Demeester
6966df5de7 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>
(cherry picked from commit 6daf3d2a78)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:19 -07:00
allencloud
e8c136169d fix severe fd leak in stack
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 0af04b6132)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:15 -07:00
Aaron Lehmann
da2ad48b92 image spec: Correct set of acceptable characters in tags
The image spec did not match the regexp that validates tags. It
neglected to mention that period and dash characters are allowed in
tags, as long as they are not the first character. It also did not
mention the length limit for tags.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 2f19e910bd)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:15 -07:00
Madhu Venugopal
b6349ac163 Fixed a few network UI issues in swarm-mode
* Detect name conflicts on network creation
* Detect and prevent network connect/disconnect for managed containers

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 0ce5158a2a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:15 -07:00
Aleksa Sarai
65c03f1013 contrib: systemd: set Limit* to infinity
There is a not-insignificant performance overhead for all containers (if
containerd is a child of Docker, which is the current setup) if systemd
sets rlimits on the main Docker daemon process (because the limits
propogate to all children).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
(cherry picked from commit 8db61095a3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:15 -07:00
Derek McGowan
fcdaa2d6b3 Atomically save libtrust key file
The libtrust keyfile which is used to set the "ID" property of a daemon must be generated or loaded on every startup.
If the process crashes during startup this could cause the file to be incomplete causing future startup errors.
Ensure that the file is written atomically to ensure the file is never in an incomplete state.

Fixes #23985

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 9836162446)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:15 -07:00
Vincent Demeester
bbc85af0bd Allow service and node filter to be name…
… on `docker node tasks` and `docker service tasks` commands.
This changes is mainly server-side (between engine api and
swarmkit). There is just a check in `api/client/service/tasks.go` to
handle the special *self* meaning.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit b0fc5a21f1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:15 -07:00
allencloud
58eb74778b fix stdout and stderr in api client
Signed-off-by: allencloud <allen.sun@daocloud.io>

(cherry picked from commit 533bd82e41)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:14 -07:00
Derek McGowan
dd7fe47136 Treat digest only images as dangling
Add test for dangling digest images

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 8906f8307c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:14 -07:00
Derek McGowan
d81ed3eb4c Always store the image digest when pulling and pushing an image.
Always attempt to add digest even when tag already exists.
Ensure digest does not currently exist.
When image id is mismatched, output an error log.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 33984f256b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:14 -07:00
Tonis Tiigi
ef62360342 Mask swarm secrets from daemon logs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 8b8f86aec9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:14 -07:00
allencloud
3eb83b5b2d fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit edc307cb92)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:14 -07:00
Francis Chuang
e54d291989 Fix a grammatical error in errClusterNetworkOnRun()'s error message.
Signed-off-by: Francis Chuang <francis.chuang@boostport.com>
(cherry picked from commit 1205a55846)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:14 -07:00
Lei Jitang
9d4117ae18 Add NoArm64 testRequires and skip Schema1RegistrySuite on arm64
schema1 manifests is not working on ARM64, we should skip integration-cli
tests for schema1 manifests on ARM64.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 9c1566a1df)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:13 -07:00
skaasten
aa89297297 Fix typo - stacks being managed, not tasks?
(cherry picked from commit 88da491cd9)

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:13 -07:00
Steve Durrheimer
4cedd8fc23 Add zsh completion for 'docker service' commands
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit f5d768e2c5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:09 -07:00
Steve Durrheimer
65e339bed1 Add zsh completion for 'docker daemon --runtimes' and 'docker run --runtime'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit a5c7eb607e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:45 -07:00
Lei Jitang
a8bd5c65cc Add fchmod and fchmodat to TestRunSeccompProfileDenyChmod
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 8c179348c3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:44 -07:00
allencloud
8b72a21977 add a whitespace in plugin's logging
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 97c77b7e0d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:44 -07:00
Steve Durrheimer
dbdd38e421 Add zsh completion for 'docker swarm' commands
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 2086663abd)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:44 -07:00
Steve Durrheimer
46a866ece9 Add zsh completion for 'docker node' commands
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 024698718f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:44 -07:00
Otto Kekäläinen
664c75ebba Fix spelling in comments, strings and documentation
Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
(cherry picked from commit 644a7426cc)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:42 -07:00
Sebastiaan van Stijn
be2bec4ead remove incorrect L3 recommendation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a26852223e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:24 -07:00
Shoubhik Bose
0e1d691b7f 23837 Added long flag to docker ps for checking latest n containers. Updated to "--last"
Signed-off-by: Shoubhik Bose <sbose78@gmail.com>
(cherry picked from commit 256edc24fc)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:24 -07:00
Antonio Murdaca
18d85f7db1 man: add missing --add-runtime
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 585332dfe0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:24 -07:00
Adolfo Ochagavía
98e4b0035a Fix typo
Signed-off-by: Adolfo Ochagavía <aochagavia92@gmail.com>
(cherry picked from commit 76b09be696)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:24 -07:00
Bilal Amarni
7dc8b036e1 [doc] add missing whitespace
Signed-off-by: Bilal Amarni <bilal.amarni@gmail.com>
(cherry picked from commit 0244174296)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:23 -07:00
Sebastiaan van Stijn
a4bc0cfecb fix typo in "readonly" flag in documentation
the flag is named '--read-only', not '--readonly'

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ac12696ff4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:23 -07:00
Alan Thompson
5c9db19be0 Update network_create.md
minor typos and punctuation.

Signed-off-by: Alan Thompson <cloojure@gmail.com>
(cherry picked from commit 68b8cc9735)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:23 -07:00
Sebastiaan van Stijn
15dee375d2 Improve timestamp formatting
lowercase the output, to prevent "About" halfway,
and add "ago" to the output, as timestamps are always
in the past.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 04c94a013c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:23 -07:00
Aaron Lehmann
7e086db901 Fix --auto-accept documentation
The --auto-accept documentation currently says that both worker and
manager nodes are automatically accepted by default. Correct it.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 9aed7d1a3d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:23 -07:00
Brian Goff
855dc5ba79 Volume mounts need to use "Binds" API field
Swarm was putting volume type mounts into the container config's
"Volumes" field, but really these need to go into "Binds".
"Volumes" is only for normal "-v /foo" volumes, not named volumes or
anything else.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 2bc2165cbf)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:23 -07:00
Charles Smith
bb41792de2 add menu.md, make index.md command line reference, update typos/minor errors in cli docs
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit f98f596c19)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:22 -07:00
Sebastiaan van Stijn
67f4f5d2c4 rename desired_state filter to desired-state
For consistency with other filters (such as
"is-official"), this renames the desired_state
filter to "desired-state".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d761719eb4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:22 -07:00
Vincent Demeester
76aed24192 Improve systemd service unit in *Automatically start containers*
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 48744e03e9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:22 -07:00
Nicola Kabar
6387822594 [Docs] clarified local volume driver docs
Signed-off-by: Nico <nicolaka@gmail.com>
(cherry picked from commit 841f985994)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:22 -07:00
Vincent Demeester
84aa074d18 Merge pull request #24325 from Anvil/plugins_volume.md-unqiue
Fixed typo: s/unqiue/unique/g
2016-07-05 11:27:42 +02:00
Damien Nadé
777c387f1e Fixed typo: s/unqiue/unique/g
Signed-off-by: Damien Nadé <github@livna.org>
2016-07-05 11:16:24 +02:00
Tibor Vass
91e29e815d Bump VERSION to v1.12.0-rc3
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-01 16:56:08 -07:00
Tibor Vass
da6da096b8 Merge pull request #24247 from tiborvass/fix-rpm-for-fedora24
fix F24 rpm build
2016-07-01 16:52:57 -07:00
Antonio Murdaca
0500446b36 fix F24 rpm build
error: line 89: Invalid version (epoch must be unsigned integer):
%{epoch}:1.12.0-0.3.rc3.fc24: Requires(pre): docker-engine-selinux >=
%%{epoch}:1.12.0-0.3.rc3.fc24

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 0c07e55e4c)
2016-07-01 16:51:47 -07:00
Tibor Vass
ac499dc4bb Merge pull request #24231 from tiborvass/cherry-pick-containerd-race-fix
Vendor containerd 1b3a81545ca79456086dc2aa424357be98b962ee
2016-07-01 13:30:13 -07:00
Kenfe-Mickael Laventure
5199e3960e Vendor containerd 1b3a81545ca79456086dc2aa424357be98b962ee
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 2685c82c2e)
2016-07-01 12:01:28 -07:00
Tibor Vass
39bc769113 Merge pull request #23724 from tiborvass/cherry-picks-for-1.12.0-rc3
[WIP] Cherry picks for 1.12.0 rc3
2016-07-01 03:59:35 -07:00
Aaron Lehmann
8a18eac752 Add documentation for external CA features in API/CLI
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit fa147591ed)
2016-07-01 00:40:48 -07:00
Tonis Tiigi
f9f7abfffe Add support for external CAs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 11085b2260)
2016-07-01 00:40:37 -07:00
Tonis Tiigi
4905c858db Update to new swarmkit/engine-api
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 9b65273836)
2016-07-01 00:40:37 -07:00
Tonis Tiigi
7d835ed934 Vendor updated swarmkit, libnetwork, engine-api
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 54255f53d8)
2016-07-01 00:40:36 -07:00
Nishant Totla
ae47b00c6c Adding a flag to specify sending of registry auth
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit 538bac39d7)
2016-07-01 00:40:31 -07:00
Nishant Totla
d199f78d18 Updating header name and executor
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit af5df117a8)
2016-07-01 00:39:51 -07:00
Nishant Totla
25c6d432ac Update engine-api vendored version
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit e13a14340d)
2016-07-01 00:39:51 -07:00
Nishant Totla
c5ddd5bb7f Passing registry auth token for service create and update
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit 93ec5cda55)
2016-07-01 00:39:51 -07:00
Tonis Tiigi
88cb79d400 Fix duplicate layers in exported tar
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 41bf7de73b)
2016-07-01 00:39:50 -07:00
Wen Cheng Ma
72a4697cda Fix docker stack link
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
(cherry picked from commit 93ed4b35fa)
2016-07-01 00:39:50 -07:00
Keith Hudgins
17939a3159 Added HPE volume plugin listing
Signed-off-by: Keith Hudgins <greenman@greenman.org>
(cherry picked from commit 87ef5b4254)
2016-07-01 00:39:50 -07:00
John Howard
ddae91f21a Windows: Skip RunCidFileCleanupIfEmpty on RS1
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 20424fccdd)
2016-07-01 00:39:50 -07:00
John Howard
9185a0a681 Windows: Skip TestBuildEmptyCmd on RS1
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 45da127442)
2016-07-01 00:39:50 -07:00
Derek McGowan
6234af6680 Set permission on atomic file write
Perform chmod before rename with the atomic file writer.
Ensure writeErr is set on short write and file is removed on write error.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 1cd7490281)
2016-07-01 00:39:50 -07:00
Vincent Demeester
1e30b67b4d Fix --filter=desired_state behaviour
Just like `docker service tasks`, we should add `desired_state` filters
only in case there is no provided filters.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 3c194bd2a4)
2016-06-30 17:12:46 -07:00
Stefan Scherer
06cbb86a29 Revert tasksmax workaround to avoid unsupported bins
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
(cherry picked from commit 6509cc4e63)
2016-06-30 17:12:46 -07:00
Akihiro Suda
4d4848ab68 zfs: call mount.MakePrivate
Fix #24008

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit 5ec8441bb5)
2016-06-30 17:12:45 -07:00
allencloud
acc31b4448 fix comments and handle err
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit cc054f3195)
2016-06-30 17:12:45 -07:00
Yong Tang
b34706b152 Use HOSTNAME in the output of docker node ls
This fix tries to address an issue raised in #24090 where
the title field of `docker node ls` use NAME instead of
HOSTNAME. Yet the content of this field is actually
hostname.

The fix makes needed changes for the output of
`docker node ls`.

An additional test has been added to cover the change in
this fix.

This fix fixes #24090.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 4bc91ceeb7)
2016-06-30 17:12:45 -07:00
Antonio Murdaca
b375ccfee7 fix warn message typos
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit a4143e6756)
2016-06-30 17:12:37 -07:00
allencloud
49981f8327 make cmd short short consistency and change docs
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 184afb92bf)
2016-06-30 17:11:29 -07:00
Alexander Morozov
90c272a4f2 daemon/logger: fix races in channel close
it's actually not okay to do such trick from multiple goroutines

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 378f0657f9)
2016-06-30 17:11:13 -07:00
Lei Jitang
bb09b3e5f1 Remove dm.no_warn_on_loop_devices in info warning
I think we doesn't provide dm.no_warn_on_loop_devices option
at all. I didn't found any code to handle this option.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 2aa01e0fbc)
2016-06-30 16:58:15 -07:00
Madhu Venugopal
3657275ca0 Added missing flags for swarm-mode networks
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit cf78863e9d)
2016-06-30 16:57:32 -07:00
Sebastiaan van Stijn
99cfbbc287 docs: add note that we no longer send container-id for exec
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 82876c0f5b)
2016-06-30 16:57:32 -07:00
Daniel Nephin
0d061f680a Fix mount opts error message.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c8659d3cc5)
2016-06-30 16:57:31 -07:00
Tonis Tiigi
f492978638 Add test for force-new-cluster
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1acb8ef825)
2016-06-30 16:57:31 -07:00
Tonis Tiigi
1f4e2f33ef Fix race on clearing swarm nodes on stop
On stop there were multiple places that marked
`cluster.node` nil. Now stop waits for the node to
set itself nil.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1a8a473017)
2016-06-30 16:57:31 -07:00
Tonis Tiigi
7b70250d07 Switch node management tests to api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 22b34d6449)
2016-06-30 16:57:31 -07:00
Daniel Nephin
cd0ffa9359 Fix service update of Args
add a unit test

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 07b59ef210)
2016-06-30 16:57:31 -07:00
Vincent Demeester
ea03b75b20 Return an empty network list if nothing matches filter
Initializing the network list struct in order to return an empty list
instead of a nil object.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit a7043ac5c4)
2016-06-30 16:57:31 -07:00
Adam Kunk
d83a27471b updates to fix install script for RHEL
fixing install script for rhel7

fixing install script for rhel7

Signed-off-by: Adam Kunk <adam.kunk@tiaa-cref.org>

updates to fix install script for RHEL

fixing install script for rhel7

fixing install script for rhel7

Signed-off-by: Adam Kunk <adam.kunk@tiaa-cref.org>
(cherry picked from commit 485c27e186)
2016-06-30 16:57:31 -07:00
Vincent Demeester
5c04eab617 Fixes /swarm/join endpoint documentation
The JSON payload given in the API documentation is wrong, fixing it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 97c9491b0d)
2016-06-30 16:57:28 -07:00
Wonjun Kim
9ce196dc3c Add integration tests for swarm incompatible
Signed-off-by: Wonjun Kim <wonjun.kim@navercorp.com>
(cherry picked from commit d71789828f)
2016-06-30 16:57:21 -07:00
Wonjun Kim
bd572fcd8f Fix check code for --cluster-store and --cluster-advertise in config_unix.go
Signed-off-by: Wonjun Kim <wonjun.kim@navercorp.com>
(cherry picked from commit 4f671ae85e)
2016-06-30 16:57:21 -07:00
Anton Tiurin
712cbdbe1f Remove extra comma in Image Pull API examples
Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
(cherry picked from commit 307c39c187)
2016-06-30 16:57:08 -07:00
Harald Albers
4476697867 add documentation for desired_state filter
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 36f57f7d02)
2016-06-30 16:47:53 -07:00
Anusha Ragunathan
43186c4304 Fix daemon tests.
Fix two test issues:
- pidof is not available in PATH on some Jenkins systems (rhel, centos)
  Use kill -0 instead.
- Cleanup after plugin test. This is a stop gap fix. The right way to
  fix this, is to shutdown the plugin on daemon shutdown path (except
  for the live-restore case). This will be done in a follow up PR.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 6d36431e23)
2016-06-30 16:47:53 -07:00
Charles Smith
79b488d5c4 remove margin from bottom of swarm mode docs
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 0d6f59e85a)
2016-06-30 16:47:53 -07:00
Derek McGowan
07bd7b0128 overlay2: close read end of pipe on mount exec
Use StdinPipe to ensure pipe is properly closed after startup

Fixes #23686

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit ad4b3e11fe)
2016-06-30 16:47:53 -07:00
Brian Goff
0f1439a065 Add ip_vs to check-config script
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 9e14002ced)
2016-06-30 16:47:52 -07:00
Akihiro Suda
cab4e108c8 update storagedriver/zfs-driver.md for Ubuntu 16.04 LTS
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit ddf9b6f666)
2016-06-30 16:47:52 -07:00
danf
a55b4462d4 Fix Malformed history layer - missing Sprintf in append of shell in Builder run config
Signed-off-by: Dan Feldman <danf@jfrog.com>
(cherry picked from commit 29b6a69660)
2016-06-30 16:47:52 -07:00
Victoria Bialas
246d503dea added another alias for getting started stuff
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
(cherry picked from commit 4060eb02ef)
2016-06-30 16:47:52 -07:00
Michael Crosby
795390b033 Change root_maxkeys
Most modern distros have the limit for the maximum root keys at 1000000
but some do not.  Because we are creating a new key for each container
we need to bump this up as the older distros are having this limit at
200.

Using 1000000 as the limit because that is that most distros are setting
this to now.  If someone has this value configured over that we do not
change it.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit ca3e4545aa)
2016-06-30 16:47:52 -07:00
Michael Crosby
4dc392b213 Update containerd to b93a33be39bc4ef0fb00bfcb79147
This updates containerd to b93a33be39bc4ef0fb00bfcb79147a28c33d9d43
fixing the start sync issues.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 7db7e04631)
2016-06-30 16:47:52 -07:00
Anusha Ragunathan
8ac21ed2d4 Add plugin restore tests.
Also live restore is stable now. So move experimental tests out to stable.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 006d58d7e6)
2016-06-30 16:47:51 -07:00
Sebastiaan van Stijn
6ed3aaf3b6 deprecate '-h' shorthand and remove '-help'
This deprecates the shorthand '-h', because we don't mention it as an option,
and it conflicts with the 'docker create -h/--hostname' option, so cannot be
used for all commands consistently.

This also removes the (single-dash) '-help' option. The single-dash variant was
marked "deprecated" in version 1.5.0 (basically, since it was added in
a2b529ead2), but still kept around to
prevent '-help' being treated as '-h -e -l -p', causing confusing
warnings.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6add695084)
2016-06-30 16:47:51 -07:00
allencloud
db9b930abc add err handling, close fd
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 2281ce7e98)
2016-06-30 16:47:51 -07:00
Sebastiaan van Stijn
63ce6b60d5 Fix installation script for RHEL
the previous fix changed the lsb_dist variable
too early. We only normalize to "centos"
for the repository-location, so changing
it just before that.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 73d5f0648e)
2016-06-30 16:47:51 -07:00
Kenfe-Mickael Laventure
7a5e247d01 Use "docker-runc" as alias for the default runtime
This also moves the variable holding the default runtime name from the
engine-api repository into docker repository

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 69af7d0d13)
2016-06-30 16:47:51 -07:00
Harald Albers
795560dba2 bash completion enhancements for docker {swarm,node,service}
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e3339a75d3)
2016-06-30 16:47:51 -07:00
Dong Chen
6661a20564 Block service mode change.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit 72f7cebfb0)
2016-06-30 16:47:50 -07:00
allencloud
a3b8c1a80e uppercase output in node inspect to keep consistency
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 89582e1a34)
2016-06-30 16:47:50 -07:00
Alex Coventry
460418f035 Clarify role of dockerhost variable
Signed-off-by: Alex Coventry <alx@empirical.com>
(cherry picked from commit 8aba9fd3ec)
2016-06-30 16:47:50 -07:00
Tadej Janež
ea4d01f22f Use 'default.target' in systemd unit file example
Previously, 'local.target' was used which is not going to work
out-of-the-box for lots of users.
The 'default.target' is the default unit systemd starts at bootup and
hence what most users would be expected to use.

Signed-off-by: Tadej Janež <tadej.j@nez.si>
(cherry picked from commit 0a8c46d5e5)
2016-06-30 16:47:50 -07:00
Tonis Tiigi
e5fb8b1fb6 Disable iptables in swarm test daemons
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit caaf92f7b4)
2016-06-30 16:47:50 -07:00
Vincent Demeester
0762cce09a Update experimental docs dsb -> dab
Fixing bundle extension in experimental documentation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 8af760c910)
2016-06-30 16:47:50 -07:00
Aanand Prasad
b84206157a Update bundle extension
It's now .dab, for Distributed Application Bundle

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
(cherry picked from commit 61e2d4240b)
2016-06-30 16:47:49 -07:00
Vincent Demeester
8084f80259 No need for container.Lock if rename same name
During the renaming of a container, no need to call `container.Lock()`
if `oldName == newName`.

This is a follow-up from #23360 (commit 88d1ee6c11)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 7e1ec8d2bd)
2016-06-30 16:47:49 -07:00
Aaron Lehmann
77e3708bf7 Fix "sanbox" typos
Correcting "sanbox" to "sandbox".

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit fa04558ac1)
2016-06-30 16:47:49 -07:00
Brian Goff
5ff054ef51 Fix panic due to nil bind options
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 4c2e1a9cb0)
2016-06-30 16:47:49 -07:00
allencloud
f463560ead fix error message and typos in swarm cluster
Signed-off-by: allencloud <allen.sun@daocloud.io>

(cherry picked from commit 39bc10c36d)
2016-06-30 16:47:49 -07:00
Alexander Morozov
d985acae68 cli: fix network create usage
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 159e7341ad)
2016-06-30 16:47:49 -07:00
Aaron Lehmann
72bb109a68 Remove log warning on task update
This warning appears in the course of normal use of swarm mode. Since
it's meant more as an internal TODO than something which should be
exposed to a user, remove the log message.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 39c93cfb47)
2016-06-30 16:47:48 -07:00
Tonis Tiigi
1fdce39622 Add better error messages for unavailable swarm commands
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 803733120a)
2016-06-30 16:47:48 -07:00
Adam Avilla
5c1a76f8da Fixing typo on service log output.
Signed-off-by: Adam Avilla <aavilla@yp.com>
(cherry picked from commit 7cc6fe5758)
2016-06-30 16:47:48 -07:00
Charles Smith
b6b262d8bb correct output description - only one task is running on manager
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 5f219806fc)
2016-06-30 16:47:48 -07:00
Sainath Grandhi
eebd6ac4df docker rename fix to address the issue of renaming with the same name issue #23319
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
(cherry picked from commit 3e8c16ef6d)
2016-06-30 16:47:48 -07:00
Alexander Morozov
0ec119e727 pkg/pools: avoid copy of sync.Pool
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ba3af336eb)
2016-06-30 16:47:48 -07:00
Tonis Tiigi
de5fd9d641 Increase test timeouts for node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 2e5da44341)
2016-06-30 16:47:47 -07:00
Tonis Tiigi
e546ffb37a Fix error reporting on executor wait
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit c895a76f10)
2016-06-30 16:47:47 -07:00
Alvaro Saurin
c2b195d3c2 Make sure we are trying to unmount a mounted /etc/resolv.conf
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
(cherry picked from commit 41cc7c4d9d)
2016-06-30 16:47:47 -07:00
Alvaro Saurin
3e6c39e2ee Make sure we compare strings with the same capitalization
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
(cherry picked from commit ded347e744)
2016-06-30 16:47:47 -07:00
Akihiro Suda
71dbab2235 update go-md2man to v1.0.5
Due to the issue of go-md2man, a numbered list in `man docker login` was not rendered correctly.
a8f937e113

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit cfe16e0d5b)
2016-06-30 16:47:47 -07:00
Tonis Tiigi
80405bef73 Do not show tasks from down nodes as active in ls
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 5d4401d6d7)
2016-06-30 16:47:47 -07:00
John Howard
f3da720d8b Windows: Ensure frozen cope with prefix
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit b820ead426)
2016-06-30 16:47:46 -07:00
Kenfe-Mickael Laventure
1641f5e308 Fix the value of the Components value in apt {In,}Release files
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 63b0713014)
2016-06-30 16:47:46 -07:00
Derek McGowan
d99f4cc83d Fix overlay2 ignoring whiteout files
Currently when overlay creates a whiteout file then the overlay2 layer is archived,
the correct tar header will be created for the whiteout file, but the tar logic will then attempt to open the file causing a failure.
When tar encounters such failures the file is skipped and excluded for the archive, causing the whiteout to be ignored.
By skipping the copy of empty files, no open attempt will be made on whiteout files.

Fixes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit bd13c53f8d)
2016-06-30 16:47:46 -07:00
Serhat Gülçiçek
f4de46d2ac Fix error for env variables example in docker reference - 2
The reason why the issue occurs is because sh parses the first argument after -c as the whole script to execute.
Everything after isn't executed as one might expect.

When working on the 'fix' I found out the same fix is also done in commit 2af7c5cfe2, except only for one occurrence.

Signed-off-by: Serhat Gülçiçek <serhat+signoff@equil.nl>
(cherry picked from commit 7a30fa7af6)
2016-06-30 16:47:46 -07:00
Sven Dowideit
eaf5b17592 Removing some url links that can be resolved using src markdown links
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit 01f9cbc366)
2016-06-30 16:47:46 -07:00
David M. Karr (fullname at gmail.com)
6de8049ab5 Update work-with-networks.md
The value of the Subnet and Gateway properties didn't match the command-line argument.

Signed-off-by: David M. Karr <davidmichaelkarr@gmail.com>
(cherry picked from commit a54c3fbb8a)
2016-06-30 16:47:46 -07:00
Alessandro Boch
f312883f39 Add modules for secure overlay network to check-config.sh
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit c355e059cc)
2016-06-30 16:47:45 -07:00
Alessandro Boch
ada93c7182 Vendoring libnetwork ed311d0
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit e26c513fa8)
2016-06-30 16:47:45 -07:00
Alessandro Boch
e928358dfb Vendoring vishvananda/netlink 734d02c
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit 58b8b8fa15)
2016-06-30 16:47:45 -07:00
Antonio Murdaca
ae0648fca8 contrib: builder: rpm: add Fedora 24
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 0b83f27328)
2016-06-30 16:47:45 -07:00
orkaa
d4cdc5172c For the lulz! (evalulate -> evaluate)
Signed-off-by: orkaa <orkica@gmail.com>
(cherry picked from commit 1bdbfa5770)
2016-06-30 16:47:45 -07:00
Steve Durrheimer
790501e51f Add zsh completion for 'load' and 'save' image events
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit e2f1f699b3)
2016-06-30 16:47:45 -07:00
Steve Durrheimer
7b643a09d5 Add zsh completion for 'docker {create,run,network connect} --link-local-ip'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 704d9b6864)
2016-06-30 16:47:44 -07:00
Steve Durrheimer
c6721ada67 Add zsh completion for 'docker run --storage-opt size='
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 857e7d6ae4)
2016-06-30 16:47:44 -07:00
Steve Durrheimer
3714e9b393 Re-Add zsh completion for '-c' alias to '--cpu-shares'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 4c23ac0ae5)
2016-06-30 16:47:44 -07:00
Steve Durrheimer
27d64ec8ad Add zsh completion for 'docker daemon --storage-driver (overlay2|vfs)'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 8e582a2573)
2016-06-30 16:47:44 -07:00
Tonis Tiigi
43014ea54b Fix opts tests after default port fix
The code for default port was already there but
it didn’t work because split function errored out
before. This should be the desired behavior that
matches daemon listen address with swarm listen
address.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 0a4a0d9800)
2016-06-30 16:47:44 -07:00
Tonis Tiigi
3d06cd4910 Unify swarm init and update options
Add api side validation and defaults for init and
join requests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit fb3eb1c27e)
2016-06-30 16:47:44 -07:00
Stefan J. Wernli
8691607ade Fixing file handle leak for "docker logs"
If "docker logs" was used on an offline container, the logger is leaked, leaving it up to the finalizer to close the file handle, which could block removal of the container.  Further, the json file logger could leak an open handle if the logs are read without follow due to an early return without a close.  This change addresses both cases.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
(cherry picked from commit 54f11b84d2)
2016-06-30 16:47:44 -07:00
Kai Qiang Wu(Kennan)
db4153cc90 Fix the missing 'ls'
Signed-off-by: Kai Qiang Wu(Kennan) <wkq5325@gmail.com>
(cherry picked from commit cbd240581f)
2016-06-30 16:47:43 -07:00
Shishir Mahajan
c984a6cdc8 Man page fix: Mention supported drivers for --storage-opt size option in docker create/run
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
(cherry picked from commit dc3fdfbe5b)
2016-06-30 16:47:43 -07:00
Eric Barch
060b6c4363 Add missing words in the swarm docs
Signed-off-by: Eric Barch <barch@tomesoftware.com>
(cherry picked from commit db158e9182)
2016-06-30 16:47:43 -07:00
bin liu
6a5a150722 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
(cherry picked from commit 950073aabb)
2016-06-30 16:47:43 -07:00
nick
62d50a3f13 Fix misspell typos
Signed-off-by: nick <nicholasrusso@icloud.com>
(cherry picked from commit 7135afa79b)
2016-06-30 16:47:43 -07:00
Aaron Lehmann
56d53adab1 Fix parallel push of the same image to different registries
Layer uploads are deduplicated by a "key" made up of the layer DiffID
and the repository name. The repository name being used to form this key
was a remote version of the name that didn't include the name of the
registry. Consequently, pushes of the same layer in a repository with
the same remote name to different registries would wrongly be
deduplicated.

Correct the key by using the full name of the repository, which includes
the registry hostname as well as the image's name.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 1333ef3ca3)
2016-06-30 16:47:43 -07:00
Ken Cochrane
8f677417d1 Fixed issue #23787 install script not working for RHEL7 host
Signed-off-by: Ken Cochrane <kencochrane@gmail.com>
(cherry picked from commit 0e84474672)
2016-06-30 16:47:42 -07:00
Sven Dowideit
3d5903a45f Now that the Docker4 links are online, we can use them
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit 587d2f9d81)
2016-06-30 16:47:42 -07:00
Akihiro Suda
ba77356d98 Add overlay2 description to overlayfs-driver.md
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit 8625adbd67)
2016-06-30 16:47:42 -07:00
Harald Albers
5604fb2362 bash completion for -c alias to --cpu-shares
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 79296b2770)
2016-06-30 16:47:42 -07:00
Harald Albers
b23562ea20 bash completion for docker daemon --storage-opt btrfs.min_space
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit f693b99870)
2016-06-30 16:47:42 -07:00
Harald Albers
0afeae16de bash completion for docker {run,create} --storage-opt
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 7d2ffa00c0)
2016-06-30 16:47:42 -07:00
Harald Albers
749f94e885 bash completion for load and save image events
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 5334520bf0)
2016-06-30 16:47:41 -07:00
Harald Albers
5188629256 bash completion for docker daemon --storage-driver olverlay2
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit d96eeff194)
2016-06-30 16:47:41 -07:00
Harald Albers
9117c0dd41 bash completion for docker {run,create,network connect} --link-local-ip
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 98483f57ed)
2016-06-30 16:47:41 -07:00
Steve Durrheimer
7d72ca329c Add zsh completion for 'docker daemon --live-restore'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 8036fc794a)
2016-06-30 16:47:41 -07:00
Kenfe-Mickael Laventure
df987c84de Fix missing container runtime on upgrade
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit d7ceda4e37)
2016-06-30 16:47:41 -07:00
Shishir Mahajan
16274ba940 PR 19367 doc change: Mention supported drivers for --storage-opt size option in docker create/run.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
(cherry picked from commit fe6416d04f)
2016-06-30 16:47:41 -07:00
Kevin Jing Qiu
c7d35daad8 Fix some doc typos and spacings
Signed-off-by: Kevin Jing Qiu <kevin@idempotent.ca>
(cherry picked from commit 3b2ee9a704)
2016-06-30 16:47:40 -07:00
Sebastiaan van Stijn
1b053efb5a Sync API changes from 1.25 -> 1.24
commit 79e1d3877a
updated the v1.25 API with changes in SwarmKit,
but these changes should apply to v1.24.

This updates the 1.24 API with the same changes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 93095b1699)
2016-06-30 16:47:40 -07:00
Charles Smith
803b4d30a6 clarify swarm concept
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit e029631713)
2016-06-30 16:47:40 -07:00
Lei Jitang
c51fced060 Fix link doesn't work sometimes when container start with multiple networks
If there is multiple networks to connect to on container starting,
the order of these networks is random because we "range a map". But
the defautl network "bridge" should be connected first since only
"bridge" support link and we should have do some settings on sandbox
creation, and only the first connect will setting the sandbox.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 57c0a653e3)
2016-06-30 16:47:40 -07:00
Derek McGowan
aa123b73d1 Add tests for rmi
Add integration test for removing by image id with tag and digest reference to the same repository.
Add integration test to ensure only tag to other repository remains after deleting tag with accompanying digest reference.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 5cff374b14)
2016-06-30 16:47:39 -07:00
Derek McGowan
611bbed2df Update rmi logic for canonical references
Updates the rmi code to treat canonical references as related to tagged references from the same repository during deletion.
Canonical references with a different repository name will be treated as separate references.
Updates the remove by ID logic to still remove an image if there is a single tag reference and only canonical references to the same repository remaining.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit a281be1c11)
2016-06-30 16:47:39 -07:00
Daniel Nephin
8a93ff1ffb Remove dead code from node update.
Also share mode code between update commands
and use flag constants

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit cacaeab9db)
2016-06-30 16:47:39 -07:00
Daniel Nephin
0641b8ba9c Use flag constants for swarm flag.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c08a50dbd1)
2016-06-30 16:47:39 -07:00
Daniel Nephin
7b0bb3f92c add more flag constants to service update.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 9d1f3373b3)
2016-06-30 16:47:39 -07:00
Charles Smith
3f276b58a5 update docker swarm cli
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 78ebfaff1a)
2016-06-30 16:47:39 -07:00
Harald Albers
75193e58ce fix bash completion for docker {swarm,node} subcommands
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e65f036e13)
2016-06-30 16:47:38 -07:00
Harald Albers
a4e3415235 correct sort order in new bash completions
The completion for the new `docker service`, `docker swarm` and
`docker node` command families were partly added in non-alphabetical
order.

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 19753ec84d)
2016-06-30 16:47:38 -07:00
Mike Goelzer
b8b938c61c Add bash completion for docker service scale
Signed-off-by: Mike Goelzer <mike.goelzer@docker.com>

Conflicts:
	contrib/completion/bash/docker

(cherry picked from commit 5cf73a47f5)
2016-06-30 16:47:38 -07:00
Sebastiaan van Stijn
2899866c63 Fix markdown formatting for experimental
- don't indent code-blocks that use fences
- fixed some formatting
- wrapped long lines to 80-chars
- removed stray empty lines

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a92f6551c9)
2016-06-30 16:47:38 -07:00
Michael Friis
9157831d16 bring dab into title and intro
Signed-off-by: Michael Friis <friism@gmail.com>
(cherry picked from commit 6defef5619)
2016-06-30 16:47:38 -07:00
Michael Friis
cabc0df64d expand stack doc
Signed-off-by: Michael Friis <friism@gmail.com>
(cherry picked from commit cd2237c2bc)
2016-06-30 16:47:38 -07:00
Zhang Wei
c40debc362 Make --help information consistent
Other docker command always print "[OPTIONS]" right after `docker
COMMAND`, but `build` and `push` has inconsistent help message.

This commit will fix help information format.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
(cherry picked from commit 0e53976336)
2016-06-30 16:47:37 -07:00
Charles Smith
1784366694 add links to swarm and service commands to swarm mode overview
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit c13c560196)
2016-06-30 16:47:37 -07:00
Tonis Tiigi
8a994d4724 Don’t try to restore swarm from incomplete state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit ded1d9af38)
2016-06-30 16:47:37 -07:00
Yong Tang
abb6e38208 Fix reference link error in Jenkins docs failure
This fix fixes one of the Jenkins docs failure:
https://jenkins.dockerproject.org/job/docs-docker-pr/9754/

There are 7 errors. This fix addresses one:
`* link error: (in page engine/userguide/storagedriver/device-mapper-driver.md) ../../reference/commandline/dockerd/#storage-driver-options`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 1cb7fb4d2e)
2016-06-30 16:47:37 -07:00
Yong Tang
92ffbd2b52 Fix docker start error with renamed container
This fix tries to fix the issue raised in #23716 where `docker start`
causes an error of `No such container:` if the container has been
renamed before `docker start` returns.

The issue is that `docker start` use container name passed at the
beginning to check for exit code at the end of the `docker start`.

This fix addresses the issue by always use container's `ID` to get
the information during `docker start`.

Additional integration tests have been added to cover this fix.

This fix fixes #23716.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 6e86733b47)
2016-06-30 16:47:37 -07:00
Jana Radhakrishnan
2b45db42b2 Vendoring @ab62dd6bf06bf0
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 663159e9ac)
2016-06-30 16:47:37 -07:00
Charles Chan
fe2a9bea38 Update help output to match Docker 1.11.
* Also touch up headings.

Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
(cherry picked from commit 17ae6539f6)
2016-06-18 20:58:25 -07:00
Charles Smith
dd39dbe79c update cli commands output for rc1, revise key concepts
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 9499d5fd52)
2016-06-18 20:58:25 -07:00
Sven Dowideit
e8e1fbb72f bad url
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit c2495dbe6d)
2016-06-18 20:58:25 -07:00
Sven Dowideit
d546db33ff href links are not converted from file.md by hugo
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit ad1819ca1d)
2016-06-18 20:58:24 -07:00
Daniel Nephin
3c35da6029 Add tests for AutoAcceptOption
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c544649874)
2016-06-18 20:58:24 -07:00
Daniel Nephin
e090e2dbd4 Support a listen addr without a port, and add tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 595e79b805)
2016-06-18 20:58:24 -07:00
Victor Vieux
6b2cd6e843 accept uppercase endpoint mode
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 8a0c5f1578)
2016-06-18 20:58:24 -07:00
Jana Radhakrishnan
0728f28cbe Vendoring swarmkit @3f135f206179e
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 64a567d24c)
2016-06-18 20:58:24 -07:00
tomwbarlow@gmail.com
9e1d592de3 Change log.printf service creation msg to debug
Signed-off-by: tomwbarlow@gmail.com <tomwbarlow@gmail.com>
(cherry picked from commit eed8d14ed1)
2016-06-18 20:58:24 -07:00
Arnaud Porterie (icecrime)
f1f2461e09 Change docker service update semantics
Change `docker service update` to replace attributes of the target
service rather than augment them. One particular occurrence where the
previous behavior proved problematic is when trying to update a port
mapping: the merge semantics provided no way of removing published
ports, but strictly of adding more.

The utility merge* functions where renamed accordingly to update*.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
(cherry picked from commit 1f8ab93b44)
2016-06-18 20:58:23 -07:00
Harald Albers
ffb4daf0fb fix bash completion for docker service subcommands
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 42f3b1f4ad)
2016-06-18 20:58:23 -07:00
Sebastiaan van Stijn
d5c89ec65e Add initial "service" docs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f565bc7ec9)
2016-06-18 20:58:23 -07:00
Victoria Bialas
d1c91b41e1 install mac and win pared down, link to d4mac, d4win, getting started improved, added menu.md's
fixing links to d4mac and d4win

updates per @Sven and @theJeztah, fixing links, typos, menu definitions, etc.

updates per Sven's comments in the PR

removed duplicate line in tutorials menu.md

Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
(cherry picked from commit 5bc730eda7)
2016-06-18 20:58:23 -07:00
Tibor Vass
906eacd586 Bump VERSION to v1.12.0-rc2
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-17 16:28:45 -04:00
Tibor Vass
02772750e1 Merge pull request #23594 from tiborvass/changelog-fix
v1.12.0: some fixes to CHANGELOG
2016-06-17 13:25:47 -07:00
Tibor Vass
2ba4108c95 Merge pull request #23661 from tiborvass/cherry-picks-for-1.12.0-rc2
Cherry picks for 1.12.0 rc2
2016-06-17 13:20:10 -07:00
Tibor Vass
11daa3e417 v1.12.0: some fixes to CHANGELOG
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-17 13:18:49 -07:00
Arnaud Porterie (icecrime)
944a8f16c7 Improve docker service inspect --pretty
Remove capitalization in placement, and remove spurious `\t`.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
(cherry picked from commit 3c60b7b984)
2016-06-17 13:09:13 -07:00
Tibor Vass
70bd46293a plugins: fix name handling for legacy plugins
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8ba17b4823)
2016-06-17 13:09:13 -07:00
Vincent Demeester
6eaac7be89 Update plugin command with defaulttag
This way, you don't have to specify the ":latest" tag for some command
and not for others

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit cb321e82db)
2016-06-17 13:09:13 -07:00
Tibor Vass
2ae7330140 plugins: fix usage for plugin commands
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 65ed9daf70)
2016-06-17 13:09:12 -07:00
Tibor Vass
1cfd620124 plugins: remove automatic mounting of a state dir
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 15ff9de658)
2016-06-17 13:09:12 -07:00
Tibor Vass
f24e5d79bc plugins: install should not automatically accept all permissions
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 4b70d4561e)
2016-06-17 13:09:12 -07:00
Jana Radhakrishnan
a7c925cba4 Vendoring libnetwork @13be89d1cf79
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 70e2585d54)
2016-06-17 13:09:12 -07:00
Tonis Tiigi
bbc214fa9b Add newline to promote/demote message
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 3386e3570a)
2016-06-17 13:09:12 -07:00
Jana Radhakrishnan
8fdc925338 Check if DriverState is valid before using in convert
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 4fea81154b)
2016-06-17 13:09:12 -07:00
Anil Madhavapeddy
4b2883fac6 docker swarm: more consistent CLI help
This changes `docker swarm help` to be consistent with capitals
and removes full stops.

Before:

```
Commands:
  init        Initialize a Swarm.
  join        Join a Swarm as a node and/or manager.
  update      update the Swarm.
  leave       Leave a Swarm.
  inspect     Inspect the Swarm
```

After:

```
Commands:
  init        Initialize a Swarm
  join        Join a Swarm as a node and/or manager
  update      Update the Swarm
  leave       Leave a Swarm
  inspect     Inspect the Swarm
```

Signed-off-by: Anil Madhavapeddy <anil@docker.com>
(cherry picked from commit 0ec78739ac)
2016-06-17 13:09:12 -07:00
Ke Xu
05c32e7f08 fix #23017, add zsh completion for dockerd
Signed-off-by: Ke Xu <leonhartx.k@gmail.com>
(cherry picked from commit bd1fc1e5c2)
2016-06-17 13:09:11 -07:00
Anusha Ragunathan
82608cd4ce Add disable flag for plugin Install.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 22e781e8e3)
2016-06-17 13:09:11 -07:00
Harald Albers
fcdd4d4a52 bash completion for docker swarm update --cert-expiry
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit dc2fc75d42)
2016-06-17 13:09:11 -07:00
Justin Cormack
445f4f2f3e Missing line feed after accepting node
Avoids
```
root@swarmatorium:~# docker node accept 3dnh6k13o44np9fwl83e7gh80
Node 3dnh6k13o44np9fwl83e7gh80 accepted in the swarm.root@swarmatorium:~#
```

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit c34d752419)
2016-06-17 13:09:11 -07:00
Justin Cormack
b7a1f1a2d1 fix invalid typo in error message
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 2322ccb8ff)
2016-06-17 13:09:11 -07:00
Charles Smith
aa1f241894 update output for node commands, minor edits
Signed-off-by: Charles Smith <charles.smith@docker.com>
(cherry picked from commit 3b2132c2c7)
2016-06-16 23:36:59 -07:00
Daniel Nephin
fb364d86fa Add some tests for bundlefile and improve the error messages for LoadFile
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c0ea589c1b)
2016-06-16 23:36:59 -07:00
Victor Vieux
d747fbc95c improve some messages in the node subcmds
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit eb962235fb)
2016-06-16 23:36:58 -07:00
Tonis Tiigi
0efe76c62b Add integration test for parsing swarm update options
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit a933ac3c27)
2016-06-16 23:36:58 -07:00
Tonis Tiigi
ab6abb799b Add cert-expiry to swarm update
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 7d8d51aa9d)
2016-06-16 23:36:58 -07:00
Brian Goff
9647e4d6cc Implement plugin restore after daemon restart
This ensures that:

- The in-memory plugin store is populated with all the plugins
- Plugins which were active before daemon restart are active after.
  This utilizes the liverestore feature when available, otherwise it
  manually starts the plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit dfd9187305)
2016-06-16 23:36:58 -07:00
Brian Goff
be82ff5c7f Fix removing plugins
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 5e156fd3d4)
2016-06-16 23:36:58 -07:00
Tonis Tiigi
efc10a92ef Fix removing containers on leaving from pending state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 826f6f0703)
2016-06-16 23:36:58 -07:00
Victor Vieux
3635938b00 add some more fields in docker service inspect -p
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 4c9e21b674)
2016-06-16 23:36:58 -07:00
Tonis Tiigi
0cac3c4c23 Return membership status on join without timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1973cee0cd)
2016-06-16 23:36:57 -07:00
Tonis Tiigi
01c5b208e8 Update daemon to new swarmkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit a83bba467a)
2016-06-16 23:36:57 -07:00
Tonis Tiigi
528f3ab668 Update swarmkit to 310f1119
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 2783568284)
2016-06-16 23:36:57 -07:00
Derek McGowan
56b253fb3c Do not show empty tags for digest references in output
When a repository has a tag and digests, show tag for each digest value.
Do not duplicate rows for the same image name with both tag and digest.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 79eada3814)
2016-06-16 23:36:57 -07:00
Sebastiaan van Stijn
b3387e96ed fix "overlay" -> "overlay2" in error message
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2d4b285a75)
2016-06-16 23:36:57 -07:00
Vincent Demeester
42f445565d Update ServiceInspectWithRaw
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 4a70cb5571)
2016-06-16 23:36:57 -07:00
Vincent Demeester
d9d24b6605 Update docker plugin install code…
… for more consistency (api side).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 2c82337b04)
2016-06-16 23:36:57 -07:00
Vincent Demeester
7444bb2c25 Bump engine-api to c57d0447ea1ae71f6dad83c8d8a1215a89869a0c
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 58529a1553)
2016-06-16 23:36:56 -07:00
Sebastiaan van Stijn
fdb5324595 Update docker info output example
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 07e1c62bf4)
2016-06-16 23:36:56 -07:00
Madhu Venugopal
ed01cfc6db Vendoring Libnetwork caf22bd9a6a53dfe91b0266274155bc69235e8ed
* fixes https://github.com/docker/docker/issues/23622
* fixes a memory leak issue with bulk sync
* fixes external DNS resolution issue after live restore

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 7f2f6ed0d6)
2016-06-16 23:36:56 -07:00
Justin Cormack
213adac2ea Add the seccomp build tag for s390x now runc updated
This was waiting for runc bump see https://github.com/docker/docker/issues/23171
runc was bumped in https://github.com/docker/docker/pull/23603

Fixes #23171

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit f8d970169a)
2016-06-16 23:36:56 -07:00
Lei Jitang
83fbaa3cb4 Fix restore active sandbox
we store the active sandbox after daemon.containerd.Restore, but there
is a chance the `Restore` will set the container to exit see
(https://github.com/docker/docker/blob/master/libcontainerd/client_linux.go#L469).
so we should check if the container is really running before add it to
activesandbox.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 78f3094518)
2016-06-16 23:36:56 -07:00
Yong Tang
1ad7b517fa Add security info to docker info
The security infomation has already been added to `GET /info` in #21172.
However, it is not part of the output of `docker info` yet.

This fix adds the security information to `docker info`.

Additional tests has been added to cover changes.

This fix fixes #23500. This fix is related to #20909, #21172.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit eee20b564f)
2016-06-16 23:36:56 -07:00
Stephen J Day
6c3d080e83 api/client/service: fix minor spelling error in service inspect
Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 920e65ccbc)
2016-06-16 23:36:55 -07:00
Kai Qiang Wu(Kennan)
82453c84ba Add ecryptfs check for overlay2
We added docs about ecryptfs check but not in code side.
Also refactor code to make it clean.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
(cherry picked from commit 136323b043)
2016-06-16 23:36:55 -07:00
Sebastiaan van Stijn
c73e56fd7f docs: move "advisory" to general metadata
the advisory option should not be
below "menu"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit aadd88c306)
2016-06-16 23:36:55 -07:00
Sainath Grandhi
1e5ee1dd37 Fixes #23596-returns empty string for NetworkID in response to /containers/json
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
(cherry picked from commit ad85d29906)
2016-06-16 23:36:55 -07:00
Stephen J Day
c3015a22cb api/client/service: list running services over replicas
To provide users a view of service status, list the number of running
task over the requested number of replicas.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit b86cb293ec)
2016-06-16 23:36:55 -07:00
Tonis Tiigi
01d26abd5c Add api tests for secret update
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit aed7667bee)
2016-06-16 23:36:55 -07:00
Victor Vieux
7f4bca0f90 use same hash for same secret
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit a579ce8ed3)
2016-06-16 23:36:55 -07:00
Victor Vieux
7cc76facba fix docker swarm init/update --secret
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 085895342c)
2016-06-16 23:36:54 -07:00
Michael Crosby
e491dbb38a Set systemd KillMode
Change the kill mode to process so that systemd does not kill container
processes when the daemon is shutdown but only the docker daemon

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit db435f526a)
2016-06-16 23:36:54 -07:00
Sebastiaan van Stijn
dd5573bc60 Update release script installation instructions
Instructions for installing the static binaries
has changed, so updated the instructions.

The comment on top already requires the steps
to be executed as root, so removing the 'sudo'

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e233c8dd72)
2016-06-16 23:36:54 -07:00
Daniel Nephin
bb8996d62b Fix String() for some option types
and add unit tests for them.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c26e7d8c91)
2016-06-16 23:36:54 -07:00
Adrian Moisey
2401c0223d Fix URL to issue
Signed-off-by: Adrian Moisey <adrian@changeover.za.net>
(cherry picked from commit 88d4da7f42)
2016-06-16 23:36:54 -07:00
Sven Dowideit
af3b1c7370 advisory can't be in the [menu] section
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit bc033cb706)
2016-06-16 23:36:54 -07:00
Thomas Leonard
979ad07925 Remove out-of-date health test
The test was waiting for the container to exit after failing its
healthcheck. However, we no longer automatically terminate containers,
so this waited instead for the container to time-out by itself.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
(cherry picked from commit 18a59bb869)
2016-06-16 23:36:53 -07:00
Anusha Ragunathan
3e44703cae Add basic integration tests for plugins.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit a2d48c9e4e)
2016-06-16 23:36:53 -07:00
Anusha Ragunathan
c82f23095a Add accept-permissions flag for install.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit ec4857da48)
2016-06-16 23:36:53 -07:00
Arnaud Porterie (icecrime)
187b6607a4 Service --update-parallelism defauls to 0
The `--update-parallelism` flaag should default to 0, which is
interpreted by the backend as unlimited. In other words, by default all
services should update simultaneously.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
(cherry picked from commit f22d0174f3)
2016-06-16 23:36:53 -07:00
Tom Barlow
5e41ec703d Change 'invald' to 'invalid' in volume opts errors
Signed-off-by: Tom Barlow <tomwbarlow@gmail.com>
(cherry picked from commit bf988fc6ff)
2016-06-16 23:36:53 -07:00
Justin Cormack
ad28216987 Move mlock back into the default ungated seccomp profile
Do not gate with CAP_IPC_LOCK as unprivileged use is now
allowed in Linux. This returns it to how it was in 1.11.

Fixes #23587

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit bdf01cf5de)
2016-06-16 23:36:53 -07:00
Anusha Ragunathan
d2a9560e71 Avoid back and forth conversion between strings and bytes.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit d6d448aab8)
2016-06-16 23:36:53 -07:00
Daniel Nephin
41d72e28c3 Change SCALE to REPLICAS.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 4df0349948)
2016-06-16 23:36:52 -07:00
Kenfe-Mickael Laventure
e324ec639b Fix TestRunWithRuntime* on arm
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit bd6317031b)
2016-06-16 23:36:52 -07:00
Michael Crosby
cdb04519e2 Update libnetwork to 96d45528599c32354230480a1ebc0
This fixes an issue with hanging tests due to store.

Fixes #23560

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit e927df7b4b)
2016-06-16 23:36:52 -07:00
Victoria Bialas
38305cb676 fixing links and merge conflicts
updated link to faqs/troubleshoot to point to new location /toolbox

fixed docker-for-mac link error

Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
(cherry picked from commit 1d80f8ca19)
2016-06-16 23:36:52 -07:00
Shoubhik Bose
2b36087597 Fixes #23376 Broken URL for Centos yum repo for docker changed to now have a hardcoded centos version 7
Signed-off-by: Shoubhik Bose <sbose78@gmail.com>
(cherry picked from commit d3fad80cc7)
2016-06-16 23:36:52 -07:00
Sven Dowideit
7af9b80f23 fix links for #23505
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit fa94eb4604)
2016-06-16 23:36:52 -07:00
Madhu Venugopal
60a86590aa Use service alias and configure container's --net-alias
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 07e39e9e72)
2016-06-16 23:36:51 -07:00
Madhu Venugopal
588b76c2a1 Vendoring swarmkit 682e0b69be208176d6055cba855a5e9cf15c7cb4
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 5af8e2a9c0)
2016-06-16 23:36:51 -07:00
Madhu Venugopal
f1d5c3374c Vendoring libnetwork 0d517a9e4e5cbdb889b3257eebd2351addcd46d4
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit f2f97f768e)
2016-06-16 23:36:51 -07:00
Tonis Tiigi
ca16a4c81d Fix hanging integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 22f827abab)
2016-06-16 23:36:51 -07:00
Antonio Murdaca
034d555d30 daemon: allow tmpfs to trump over VOLUME(s)
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 756f6cef4a)
2016-06-16 23:36:51 -07:00
Akihiro Suda
ce6211d252 Update experimental/README.md
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit fec98ecca1)
2016-06-16 23:36:51 -07:00
Victoria Bialas
92ff142da2 surfacing Learn by example topics to top level of Docker Engine docs
fixing links after moving surfacing tutorials

fixing more links for the newly located tutorials

WIP: merging 3 getting started tutorials into one to cover all platforms, added new files

fixing broken images and links in 3-in-1 getting started, re-wrote story flow, linked to Toolbox, d4mac,d4win

Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
(cherry picked from commit 0254c12e1e)
2016-06-16 23:36:50 -07:00
Drew Erny
c816f2c905 Remove the node leader column, show leader as status.
Removes the leader column from node ls and shows whether a node is the
leader in the manager status column instead.

Signed-off-by: Drew Erny <drew.erny@docker.com>
(cherry picked from commit 4104c1dc13)
2016-06-16 23:36:50 -07:00
Michael Crosby
be67aae778 Merge pull request #23627 from mlaventure/update-runc-on-1.12
Update runc on 1.12
2016-06-16 14:30:54 -07:00
Kenfe-Mickael Laventure
301f3d776f Revert build-{deb,rpm} to cloning from opencontainers repository
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-16 09:06:53 -07:00
Kenfe-Mickael Laventure
9eb6e049bd Vendor in runc cc29e3dded8e27ba8f65738f40d251c885030a28
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit b675124cf5)
2016-06-16 08:46:23 -07:00
Tibor Vass
1f136c1f85 bump VERSION to v1.12.0-rc1
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-15 00:36:32 -04:00
Michael Crosby
c293f64dc0 Merge pull request #23564 from tiborvass/fix-changelog
v1.12.0: fixed date in CHANGELOG to be in YYYY-MM-DD form
2016-06-14 21:35:39 -07:00
Tibor Vass
adbf43fe10 v1.12.0: fixed date in CHANGELOG to be in YYYY-MM-DD form
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-14 21:33:17 -07:00
Arnaud Porterie
aab402731f Merge pull request #23563 from icecrime/i_trust_crosbymichael
Use runc from crosbymichael's fork
2016-06-15 04:14:13 +00:00
Arnaud Porterie (icecrime)
e2b7f648f4
Use runc from crosbymichael's fork
Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
2016-06-14 21:10:38 -07:00
Tibor Vass
427738d81f v1.12.0: first draft of CHANGELOG additions
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-14 20:12:57 -07:00
1025 changed files with 53143 additions and 18013 deletions

View file

@ -5,6 +5,625 @@ information on the list of deprecated flags and APIs please have a look at
https://docs.docker.com/engine/deprecated/ where target removal dates can also
be found.
## 1.12.6 (2017-01-10)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
**NOTE**: Docker 1.12.5 will correctly validate that either an IPv6 subnet is provided or
that the IPAM driver can provide one when you specify the `--ipv6` option.
If you are currently using the `--ipv6` option _without_ specifying the
`--fixed-cidr-v6` option, the Docker daemon will refuse to start with the
following message:
```none
Error starting daemon: Error initializing network controller: Error creating
default "bridge" network: failed to parse pool request
for address space "LocalDefault" pool " subpool ":
could not find an available, non-overlapping IPv6 address
pool among the defaults to assign to the network
```
To resolve this error, either remove the `--ipv6` flag (to preserve the same
behavior as in Docker 1.12.3 and earlier), or provide an IPv6 subnet as the
value of the `--fixed-cidr-v6` flag.
In a similar way, if you specify the `--ipv6` flag when creating a network
with the default IPAM driver, without providing an IPv6 `--subnet`, network
creation will fail with the following message:
```none
Error response from daemon: failed to parse pool request for address space
"LocalDefault" pool "" subpool "": could not find an
available, non-overlapping IPv6 address pool among
the defaults to assign to the network
```
To resolve this, either remove the `--ipv6` flag (to preserve the same behavior
as in Docker 1.12.3 and earlier), or provide an IPv6 subnet as the value of the
`--subnet` flag.
The network network creation will instead succeed if you use an external IPAM driver
which supports automatic allocation of IPv6 subnets.
### Runtime
- Fix runC privilege escalation (CVE-2016-9962)
## 1.12.5 (2016-12-15)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
**NOTE**: Docker 1.12.5 will correctly validate that either an IPv6 subnet is provided or
that the IPAM driver can provide one when you specify the `--ipv6` option.
If you are currently using the `--ipv6` option _without_ specifying the
`--fixed-cidr-v6` option, the Docker daemon will refuse to start with the
following message:
```none
Error starting daemon: Error initializing network controller: Error creating
default "bridge" network: failed to parse pool request
for address space "LocalDefault" pool " subpool ":
could not find an available, non-overlapping IPv6 address
pool among the defaults to assign to the network
```
To resolve this error, either remove the `--ipv6` flag (to preserve the same
behavior as in Docker 1.12.3 and earlier), or provide an IPv6 subnet as the
value of the `--fixed-cidr-v6` flag.
In a similar way, if you specify the `--ipv6` flag when creating a network
with the default IPAM driver, without providing an IPv6 `--subnet`, network
creation will fail with the following message:
```none
Error response from daemon: failed to parse pool request for address space
"LocalDefault" pool "" subpool "": could not find an
available, non-overlapping IPv6 address pool among
the defaults to assign to the network
```
To resolve this, either remove the `--ipv6` flag (to preserve the same behavior
as in Docker 1.12.3 and earlier), or provide an IPv6 subnet as the value of the
`--subnet` flag.
The network network creation will instead succeed if you use an external IPAM driver
which supports automatic allocation of IPv6 subnets.
### Runtime
- Fix race on sending stdin close event [#29424](https://github.com/docker/docker/pull/29424)
### Networking
- Fix panic in docker network ls when a network was created with `--ipv6` and no ipv6 `--subnet` in older docker versions [#29416](https://github.com/docker/docker/pull/29416)
### Contrib
- Fix compilation on Darwin [#29370](https://github.com/docker/docker/pull/29370)
## 1.12.4 (2016-12-12)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
### Runtime
- Fix issue where volume metadata was not removed [#29083](https://github.com/docker/docker/pull/29083)
- Asynchronously close streams to prevent holding container lock [#29050](https://github.com/docker/docker/pull/29050)
- Fix selinux labels for newly created container volumes [#29050](https://github.com/docker/docker/pull/29050)
- Remove hostname validation [#28990](https://github.com/docker/docker/pull/28990)
- Fix deadlocks caused by IO races [#29095](https://github.com/docker/docker/pull/29095) [#29141](https://github.com/docker/docker/pull/29141)
- Return an empty stats if the container is restarting [#29150](https://github.com/docker/docker/pull/29150)
- Fix volume store locking [#29151](https://github.com/docker/docker/pull/29151)
- Ensure consistent status code in API [#29150](https://github.com/docker/docker/pull/29150)
- Fix incorrect opaque directory permission in overlay2 [#29093](https://github.com/docker/docker/pull/29093)
- Detect plugin content and error out on `docker pull` [#29297](https://github.com/docker/docker/pull/29297)
### Swarm Mode
* Update Swarmkit [#29047](https://github.com/docker/docker/pull/29047)
- orchestrator/global: Fix deadlock on updates [docker/swarmkit#1760](https://github.com/docker/swarmkit/pull/1760)
- on leader switchover preserve the vxlan id for existing networks [docker/swarmkit#1773](https://github.com/docker/swarmkit/pull/1773)
- Refuse swarm spec not named "default" [#29152](https://github.com/docker/docker/pull/29152)
### Networking
* Update libnetwork [#29004](https://github.com/docker/docker/pull/29004) [#29146](https://github.com/docker/docker/pull/29146)
- Fix panic in embedded DNS [docker/libnetwork#1561](https://github.com/docker/libnetwork/pull/1561)
- Fix unmarhalling panic when passing --link-local-ip on global scope network [docker/libnetwork#1564](https://github.com/docker/libnetwork/pull/1564)
- Fix panic when network plugin returns nil StaticRoutes [docker/libnetwork#1563](https://github.com/docker/libnetwork/pull/1563)
- Fix panic in osl.(*networkNamespace).DeleteNeighbor [docker/libnetwork#1555](https://github.com/docker/libnetwork/pull/1555)
- Fix panic in swarm networking concurrent map read/write [docker/libnetwork#1570](https://github.com/docker/libnetwork/pull/1570)
* Allow encrypted networks when running docker inside a container [docker/libnetwork#1502](https://github.com/docker/libnetwork/pull/1502)
- Do not block autoallocation of IPv6 pool [docker/libnetwork#1538](https://github.com/docker/libnetwork/pull/1538)
- Set timeout for netlink calls [docker/libnetwork#1557](https://github.com/docker/libnetwork/pull/1557)
- Increase networking local store timeout to one minute [docker/libkv#140](https://github.com/docker/libkv/pull/140)
- Fix a panic in libnetwork.(*sandbox).execFunc [docker/libnetwork#1556](https://github.com/docker/libnetwork/pull/1556)
- Honor icc=false for internal networks [docker/libnetwork#1525](https://github.com/docker/libnetwork/pull/1525)
### Logging
* Update syslog log driver [#29150](https://github.com/docker/docker/pull/29150)
### Contrib
- Run "dnf upgrade" before installing in fedora [#29150](https://github.com/docker/docker/pull/29150)
- Add build-date back to RPM packages [#29150](https://github.com/docker/docker/pull/29150)
- deb package filename changed to include distro to distinguish between distro code names [#27829](https://github.com/docker/docker/pull/27829)
## 1.12.3 (2016-10-26)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
### Runtime
- Fix ambient capability usage in containers (CVE-2016-8867) [#27610](https://github.com/docker/docker/pull/27610)
- Prevent a deadlock in libcontainerd for Windows [#27136](https://github.com/docker/docker/pull/27136)
- Fix error reporting in CopyFileWithTar [#27075](https://github.com/docker/docker/pull/27075)
* Reset health status to starting when a container is restarted [#27387](https://github.com/docker/docker/pull/27387)
* Properly handle shared mount propagation in storage directory [#27609](https://github.com/docker/docker/pull/27609)
- Fix docker exec [#27610](https://github.com/docker/docker/pull/27610)
- Fix backward compatibility with containerds events log [#27693](https://github.com/docker/docker/pull/27693)
### Swarm Mode
- Fix conversion of restart-policy [#27062](https://github.com/docker/docker/pull/27062)
* Update Swarmkit [#27554](https://github.com/docker/docker/pull/27554)
* Avoid restarting a task that has already been restarted [docker/swarmkit#1305](https://github.com/docker/swarmkit/pull/1305)
* Allow duplicate published ports when they use different protocols [docker/swarmkit#1632](https://github.com/docker/swarmkit/pull/1632)
* Allow multiple randomly assigned published ports on service [docker/swarmkit#1657](https://github.com/docker/swarmkit/pull/1657)
- Fix panic when allocations happen at init time [docker/swarmkit#1651](https://github.com/docker/swarmkit/pull/1651)
### Networking
* Update libnetwork [#27559](https://github.com/docker/docker/pull/27559)
- Fix race in serializing sandbox to string [docker/libnetwork#1495](https://github.com/docker/libnetwork/pull/1495)
- Fix race during deletion [docker/libnetwork#1503](https://github.com/docker/libnetwork/pull/1503)
* Reset endpoint port info on connectivity revoke in bridge driver [docker/libnetwork#1504](https://github.com/docker/libnetwork/pull/1504)
- Fix a deadlock in networking code [docker/libnetwork#1507](https://github.com/docker/libnetwork/pull/1507)
- Fix a race in load balancer state [docker/libnetwork#1512](https://github.com/docker/libnetwork/pull/1512)
### Logging
* Update fluent-logger-golang to v1.2.1 [#27474](https://github.com/docker/docker/pull/27474)
### Contrib
* Update buildtags for armhf ubuntu-trusty [#27327](https://github.com/docker/docker/pull/27327)
* Add AppArmor to runc buildtags for armhf [#27421](https://github.com/docker/docker/pull/27421)
## 1.12.2 (2016-10-11)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
### Runtime
- Fix a panic due to a race condition filtering `docker ps` [#26049](https://github.com/docker/docker/pull/26049)
* Implement retry logic to prevent "Unable to remove filesystem" errors when using the aufs storage driver [#26536](https://github.com/docker/docker/pull/26536)
* Prevent devicemapper from removing device symlinks if `dm.use_deferred_removal` is enabled [#24740](https://github.com/docker/docker/pull/24740)
- Fix an issue where the CLI did not return correct exit codes if a command was run with invalid options [#26777](https://github.com/docker/docker/pull/26777)
- Fix a panic due to a bug in stdout / stderr processing in health checks [#26507](https://github.com/docker/docker/pull/26507)
- Fix exec's children handling [#26874](https://github.com/docker/docker/pull/26874)
- Fix exec form of HEALTHCHECK CMD [#26208](https://github.com/docker/docker/pull/26208)
### Networking
- Fix a daemon start panic on armv5 [#24315](https://github.com/docker/docker/issues/24315)
* Vendor libnetwork [#26879](https://github.com/docker/docker/pull/26879) [#26953](https://github.com/docker/docker/pull/26953)
* Avoid returning early on agent join failures [docker/libnetwork#1473](https://github.com/docker/libnetwork/pull/1473)
- Fix service published port cleanup issues [docker/libetwork#1432](https://github.com/docker/libnetwork/pull/1432) [docker/libnetwork#1433](https://github.com/docker/libnetwork/pull/1433)
* Recover properly from transient gossip failures [docker/libnetwork#1446](https://github.com/docker/libnetwork/pull/1446)
* Disambiguate node names known to gossip cluster to avoid node name collision [docker/libnetwork#1451](https://github.com/docker/libnetwork/pull/1451)
* Honor user provided listen address for gossip [docker/libnetwork#1460](https://github.com/docker/libnetwork/pull/1460)
* Allow reachability via published port across services on the same host [docker/libnetwork#1398](https://github.com/docker/libnetwork/pull/1398)
* Change the ingress sandbox name from random id to just `ingress_sbox` [docker/libnetwork#1449](https://github.com/docker/libnetwork/pull/1449)
- Disable service discovery in ingress network [docker/libnetwork#1489](https://github.com/docker/libnetwork/pull/1489)
### Swarm Mode
* Fix remote detection of a node's address when it joins the cluster [#26211](https://github.com/docker/docker/pull/26211)
* Vendor SwarmKit [#26765](https://github.com/docker/docker/pull/26765)
* Bounce session after failed status update [docker/swarmkit#1539](https://github.com/docker/swarmkit/pull/1539)
- Fix possible raft deadlocks [docker/swarmkit#1537](https://github.com/docker/swarmkit/pull/1537)
- Fix panic and endpoint leak when a service is updated with no endpoints [docker/swarmkit#1481](https://github.com/docker/swarmkit/pull/1481)
* Produce an error if the same port is published twice on `service create` or `service update` [docker/swarmkit#1495](https://github.com/docker/swarmkit/pull/1495)
- Fix an issue where changes to a service were not detected, resulting in the service not being updated [docker/swarmkit#1497](https://github.com/docker/swarmkit/pull/1497)
- Do not allow service creation on ingress network [docker/swarmkit#1600](https://github.com/docker/swarmkit/pull/1600)
### Contrib
* Update the debian sysv-init script to use `dockerd` instead of `docker daemon` [#25869](https://github.com/docker/docker/pull/25869)
* Improve stability when running the docker client on MacOS Sierra [#26875](https://github.com/docker/docker/pull/26875)
- Fix installation on debian stretch [#27184](https://github.com/docker/docker/pull/27184)
### Windows
- Fix an issue where arrow-navigation did not work when running the docker client in ConEmu [#25578](https://github.com/docker/docker/pull/25578)
## 1.12.1 (2016-08-18)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
### Client
* Add `Joined at` information in `node inspect --pretty` [#25512](https://github.com/docker/docker/pull/25512)
- Fix a crash on `service inspect` [#25454](https://github.com/docker/docker/pull/25454)
- Fix issue preventing `service update --env-add` to work as intended [#25427](https://github.com/docker/docker/pull/25427)
- Fix issue preventing `service update --publish-add` to work as intended [#25428](https://github.com/docker/docker/pull/25428)
- Remove `service update --network-add` and `service update --network-rm` flags
because this feature is not yet implemented in 1.12, but was inadvertently added
to the client in 1.12.0 [#25646](https://github.com/docker/docker/pull/25646)
### Contrib
+ Official ARM installation for Debian Jessie, Ubuntu Trusty, and Raspbian Jessie [#24815](https://github.com/docker/docker/pull/24815) [#25591](https://github.com/docker/docker/pull/25637)
- Add selinux policy per distro/version, fixing issue preventing successful installation on Fedora 24, and Oracle Linux [#25334](https://github.com/docker/docker/pull/25334) [#25593](https://github.com/docker/docker/pull/25593)
### Networking
- Fix issue that prevented containers to be accessed by hostname with Docker overlay driver in Swarm Mode [#25603](https://github.com/docker/docker/pull/25603) [#25648](https://github.com/docker/docker/pull/25648)
- Fix random network issues on service with published port [#25603](https://github.com/docker/docker/pull/25603)
- Fix unreliable inter-service communication after scaling down and up [#25603](https://github.com/docker/docker/pull/25603)
- Fix issue where removing all tasks on a node and adding them back breaks connectivity with other services [#25603](https://github.com/docker/docker/pull/25603)
- Fix issue where a task that fails to start results in a race, causing a `network xxx not found` error that masks the actual error [#25550](https://github.com/docker/docker/pull/25550)
- Relax validation of SRV records for external services that use SRV records not formatted according to RFC 2782 [#25739](https://github.com/docker/docker/pull/25739)
### Plugins (experimental)
* Make daemon events listen for plugin lifecycle events [#24760](https://github.com/docker/docker/pull/24760)
* Check for plugin state before enabling plugin [#25033](https://github.com/docker/docker/pull/25033)
- Remove plugin root from filesystem on `plugin rm` [#25187](https://github.com/docker/docker/pull/25187)
- Prevent deadlock when more than one plugin is installed [#25384](https://github.com/docker/docker/pull/25384)
### Runtime
* Mask join tokens in daemon logs [#25346](https://github.com/docker/docker/pull/25346)
- Fix `docker ps --filter` causing the results to no longer be sorted by creation time [#25387](https://github.com/docker/docker/pull/25387)
- Fix various crashes [#25053](https://github.com/docker/docker/pull/25053)
### Security
* Add `/proc/timer_list` to the masked paths list to prevent information leak from the host [#25630](https://github.com/docker/docker/pull/25630)
* Allow systemd to run with only `--cap-add SYS_ADMIN` rather than having to also add `--cap-add DAC_READ_SEARCH` or disabling seccomp filtering [#25567](https://github.com/docker/docker/pull/25567)
### Swarm
- Fix an issue where the swarm can get stuck electing a new leader after quorum is lost [#25055](https://github.com/docker/docker/issues/25055)
- Fix unwanted rescheduling of containers after a leader failover [#25017](https://github.com/docker/docker/issues/25017)
- Change swarm root CA key to P256 curve [swarmkit#1376](https://github.com/docker/swarmkit/pull/1376)
- Allow forced removal of a node from a swarm [#25159](https://github.com/docker/docker/pull/25159)
- Fix connection leak when a node leaves a swarm [swarmkit/#1277](https://github.com/docker/swarmkit/pull/1277)
- Backdate swarm certificates by one hour to tolerate more clock skew [swarmkit/#1243](https://github.com/docker/swarmkit/pull/1243)
- Avoid high CPU use with many unschedulable tasks [swarmkit/#1287](https://github.com/docker/swarmkit/pull/1287)
- Fix issue with global tasks not starting up [swarmkit/#1295](https://github.com/docker/swarmkit/pull/1295)
- Garbage collect raft logs [swarmkit/#1327](https://github.com/docker/swarmkit/pull/1327)
### Volume
- Persist local volume options after a daemon restart [#25316](https://github.com/docker/docker/pull/25316)
- Fix an issue where the mount ID was not returned on volume unmount [#25333](https://github.com/docker/docker/pull/25333)
- Fix an issue where a volume mount could inadvertently create a bind mount [#25309](https://github.com/docker/docker/pull/25309)
- `docker service create --mount type=bind,...` now correctly validates if the source path exists, instead of creating it [#25494](https://github.com/docker/docker/pull/25494)
## 1.12.0 (2016-07-28)
**IMPORTANT**: Docker 1.12.0 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
**IMPORTANT**: With Docker 1.12, a Linux docker installation now has two
additional binaries; `dockerd`, and `docker-proxy`. If you have scripts for
installing docker, please make sure to update them accordingly.
### Builder
+ New `HEALTHCHECK` Dockerfile instruction to support user-defined healthchecks [#23218](https://github.com/docker/docker/pull/23218)
+ New `SHELL` Dockerfile instruction to specify the default shell when using the shell form for commands in a Dockerfile [#22489](https://github.com/docker/docker/pull/22489)
+ Add `#escape=` Dockerfile directive to support platform-specific parsing of file paths in Dockerfile [#22268](https://github.com/docker/docker/pull/22268)
+ Add support for comments in `.dockerignore` [#23111](https://github.com/docker/docker/pull/23111)
* Support for UTF-8 in Dockerfiles [#23372](https://github.com/docker/docker/pull/23372)
* Skip UTF-8 BOM bytes from `Dockerfile` and `.dockerignore` if exist [#23234](https://github.com/docker/docker/pull/23234)
* Windows: support for `ARG` to match Linux [#22508](https://github.com/docker/docker/pull/22508)
- Fix error message when building using a daemon with the bridge network disabled [#22932](https://github.com/docker/docker/pull/22932)
### Contrib
* Enable seccomp for Centos 7 and Oracle Linux 7 [#22344](https://github.com/docker/docker/pull/22344)
- Remove MountFlags in systemd unit to allow shared mount propagation [#22806](https://github.com/docker/docker/pull/22806)
### Distribution
+ Add `--max-concurrent-downloads` and `--max-concurrent-uploads` daemon flags useful for situations where network connections don't support multiple downloads/uploads [#22445](https://github.com/docker/docker/pull/22445)
* Registry operations now honor the `ALL_PROXY` environment variable [#22316](https://github.com/docker/docker/pull/22316)
* Provide more information to the user on `docker load` [#23377](https://github.com/docker/docker/pull/23377)
* Always save registry digest metadata about images pushed and pulled [#23996](https://github.com/docker/docker/pull/23996)
### Logging
+ Syslog logging driver now supports DGRAM sockets [#21613](https://github.com/docker/docker/pull/21613)
+ Add `--details` option to `docker logs` to also display log tags [#21889](https://github.com/docker/docker/pull/21889)
+ Enable syslog logger to have access to env and labels [#21724](https://github.com/docker/docker/pull/21724)
+ An additional syslog-format option `rfc5424micro` to allow microsecond resolution in syslog timestamp [#21844](https://github.com/docker/docker/pull/21844)
* Inherit the daemon log options when creating containers [#21153](https://github.com/docker/docker/pull/21153)
* Remove `docker/` prefix from log messages tag and replace it with `{{.DaemonName}}` so that users have the option of changing the prefix [#22384](https://github.com/docker/docker/pull/22384)
### Networking
+ Built-in Virtual-IP based internal and ingress load-balancing using IPVS [#23361](https://github.com/docker/docker/pull/23361)
+ Routing Mesh using ingress overlay network [#23361](https://github.com/docker/docker/pull/23361)
+ Secured multi-host overlay networking using encrypted control-plane and Data-plane [#23361](https://github.com/docker/docker/pull/23361)
+ MacVlan driver is out of experimental [#23524](https://github.com/docker/docker/pull/23524)
+ Add `driver` filter to `network ls` [#22319](https://github.com/docker/docker/pull/22319)
+ Adding `network` filter to `docker ps --filter` [#23300](https://github.com/docker/docker/pull/23300)
+ Add `--link-local-ip` flag to `create`, `run` and `network connect` to specify a container's link-local address [#23415](https://github.com/docker/docker/pull/23415)
+ Add network label filter support [#21495](https://github.com/docker/docker/pull/21495)
* Removed dependency on external KV-Store for Overlay networking in Swarm-Mode [#23361](https://github.com/docker/docker/pull/23361)
* Add container's short-id as default network alias [#21901](https://github.com/docker/docker/pull/21901)
* `run` options `--dns` and `--net=host` are no longer mutually exclusive [#22408](https://github.com/docker/docker/pull/22408)
- Fix DNS issue when renaming containers with generated names [#22716](https://github.com/docker/docker/pull/22716)
- Allow both `network inspect -f {{.Id}}` and `network inspect -f {{.ID}}` to address inconsistency with inspect output [#23226](https://github.com/docker/docker/pull/23226)
### Plugins (experimental)
+ New `plugin` command to manager plugins with `install`, `enable`, `disable`, `rm`, `inspect`, `set` subcommands [#23446](https://github.com/docker/docker/pull/23446)
### Remote API (v1.24) & Client
+ Split the binary into two: `docker` (client) and `dockerd` (daemon) [#20639](https://github.com/docker/docker/pull/20639)
+ Add `before` and `since` filters to `docker images --filter` [#22908](https://github.com/docker/docker/pull/22908)
+ Add `--limit` option to `docker search` [#23107](https://github.com/docker/docker/pull/23107)
+ Add `--filter` option to `docker search` [#22369](https://github.com/docker/docker/pull/22369)
+ Add security options to `docker info` output [#21172](https://github.com/docker/docker/pull/21172) [#23520](https://github.com/docker/docker/pull/23520)
+ Add insecure registries to `docker info` output [#20410](https://github.com/docker/docker/pull/20410)
+ Extend Docker authorization with TLS user information [#21556](https://github.com/docker/docker/pull/21556)
+ devicemapper: expose Mininum Thin Pool Free Space through `docker info` [#21945](https://github.com/docker/docker/pull/21945)
* API now returns a JSON object when an error occurs making it more consistent [#22880](https://github.com/docker/docker/pull/22880)
- Prevent `docker run -i --restart` from hanging on exit [#22777](https://github.com/docker/docker/pull/22777)
- Fix API/CLI discrepancy on hostname validation [#21641](https://github.com/docker/docker/pull/21641)
- Fix discrepancy in the format of sizes in `stats` from HumanSize to BytesSize [#21773](https://github.com/docker/docker/pull/21773)
- authz: when request is denied return forbbiden exit code (403) [#22448](https://github.com/docker/docker/pull/22448)
- Windows: fix tty-related displaying issues [#23878](https://github.com/docker/docker/pull/23878)
### Runtime
+ Split the userland proxy to a separate binary (`docker-proxy`) [#23312](https://github.com/docker/docker/pull/23312)
+ Add `--live-restore` daemon flag to keep containers running when daemon shuts down, and regain control on startup [#23213](https://github.com/docker/docker/pull/23213)
+ Ability to add OCI-compatible runtimes (via `--add-runtime` daemon flag) and select one with `--runtime` on `create` and `run` [#22983](https://github.com/docker/docker/pull/22983)
+ New `overlay2` graphdriver for Linux 4.0+ with multiple lower directory support [#22126](https://github.com/docker/docker/pull/22126)
+ New load/save image events [#22137](https://github.com/docker/docker/pull/22137)
+ Add support for reloading daemon configuration through systemd [#22446](https://github.com/docker/docker/pull/22446)
+ Add disk quota support for btrfs [#19651](https://github.com/docker/docker/pull/19651)
+ Add disk quota support for zfs [#21946](https://github.com/docker/docker/pull/21946)
+ Add support for `docker run --pid=container:<id>` [#22481](https://github.com/docker/docker/pull/22481)
+ Align default seccomp profile with selected capabilities [#22554](https://github.com/docker/docker/pull/22554)
+ Add a `daemon reload` event when the daemon reloads its configuration [#22590](https://github.com/docker/docker/pull/22590)
+ Add `trace` capability in the pprof profiler to show execution traces in binary form [#22715](https://github.com/docker/docker/pull/22715)
+ Add a `detach` event [#22898](https://github.com/docker/docker/pull/22898)
+ Add support for setting sysctls with `--sysctl` [#19265](https://github.com/docker/docker/pull/19265)
+ Add `--storage-opt` flag to `create` and `run` allowing to set `size` on devicemapper [#19367](https://github.com/docker/docker/pull/19367)
+ Add `--oom-score-adjust` daemon flag with a default value of `-500` making the daemon less likely to be killed before containers [#24516](https://github.com/docker/docker/pull/24516)
* Undeprecate the `-c` short alias of `--cpu-shares` on `run`, `build`, `create`, `update` [#22621](https://github.com/docker/docker/pull/22621)
* Prevent from using aufs and overlay graphdrivers on an eCryptfs mount [#23121](https://github.com/docker/docker/pull/23121)
- Fix issues with tmpfs mount ordering [#22329](https://github.com/docker/docker/pull/22329)
- Created containers are no longer listed on `docker ps -a -f exited=0` [#21947](https://github.com/docker/docker/pull/21947)
- Fix an issue where containers are stuck in a "Removal In Progress" state [#22423](https://github.com/docker/docker/pull/22423)
- Fix bug that was returning an HTTP 500 instead of a 400 when not specifying a command on run/create [#22762](https://github.com/docker/docker/pull/22762)
- Fix bug with `--detach-keys` whereby input matching a prefix of the detach key was not preserved [#22943](https://github.com/docker/docker/pull/22943)
- SELinux labeling is now disabled when using `--privileged` mode [#22993](https://github.com/docker/docker/pull/22993)
- If volume-mounted into a container, `/etc/hosts`, `/etc/resolv.conf`, `/etc/hostname` are no longer SELinux-relabeled [#22993](https://github.com/docker/docker/pull/22993)
- Fix inconsistency in `--tmpfs` behavior regarding mount options [#22438](https://github.com/docker/docker/pull/22438)
- Fix an issue where daemon hangs at startup [#23148](https://github.com/docker/docker/pull/23148)
- Ignore SIGPIPE events to prevent journald restarts to crash docker in some cases [#22460](https://github.com/docker/docker/pull/22460)
- Containers are not removed from stats list on error [#20835](https://github.com/docker/docker/pull/20835)
- Fix `on-failure` restart policy when daemon restarts [#20853](https://github.com/docker/docker/pull/20853)
- Fix an issue with `stats` when a container is using another container's network [#21904](https://github.com/docker/docker/pull/21904)
### Swarm Mode
+ New `swarm` command to manage swarms with `init`, `join`, `join-token`, `leave`, `update` subcommands [#23361](https://github.com/docker/docker/pull/23361) [#24823](https://github.com/docker/docker/pull/24823)
+ New `service` command to manage swarm-wide services with `create`, `inspect`, `update`, `rm`, `ps` subcommands [#23361](https://github.com/docker/docker/pull/23361) [#25140](https://github.com/docker/docker/pull/25140)
+ New `node` command to manage nodes with `accept`, `promote`, `demote`, `inspect`, `update`, `ps`, `ls` and `rm` subcommands [#23361](https://github.com/docker/docker/pull/23361) [#25140](https://github.com/docker/docker/pull/25140)
+ (experimental) New `stack` and `deploy` commands to manage and deploy multi-service applications [#23522](https://github.com/docker/docker/pull/23522) [#25140](https://github.com/docker/docker/pull/25140)
### Volume
+ Add support for local and global volume scopes (analogous to network scopes) [#22077](https://github.com/docker/docker/pull/22077)
+ Allow volume drivers to provide a `Status` field [#21006](https://github.com/docker/docker/pull/21006)
+ Add name/driver filter support for volume [#21361](https://github.com/docker/docker/pull/21361)
* Mount/Unmount operations now receives an opaque ID to allow volume drivers to differentiate between two callers [#21015](https://github.com/docker/docker/pull/21015)
- Fix issue preventing to remove a volume in a corner case [#22103](https://github.com/docker/docker/pull/22103)
- Windows: Enable auto-creation of host-path to match Linux [#22094](https://github.com/docker/docker/pull/22094)
### DEPRECATION
* Environment variables `DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE` and `DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE` have been renamed
to `DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE` and `DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE` respectively [#22574](https://github.com/docker/docker/pull/22574)
* Remove deprecated `syslog-tag`, `gelf-tag`, `fluentd-tag` log option in favor of the more generic `tag` one [#22620](https://github.com/docker/docker/pull/22620)
* Remove deprecated feature of passing HostConfig at API container start [#22570](https://github.com/docker/docker/pull/22570)
* Remove deprecated `-f`/`--force` flag on docker tag [#23090](https://github.com/docker/docker/pull/23090)
* Remove deprecated `/containers/<id|name>/copy` endpoint [#22149](https://github.com/docker/docker/pull/22149)
* Remove deprecated `docker ps` flags `--since` and `--before` [#22138](https://github.com/docker/docker/pull/22138)
* Deprecate the old 3-args form of `docker import` [#23273](https://github.com/docker/docker/pull/23273)
## 1.11.2 (2016-05-31)
### Networking
@ -116,7 +735,7 @@ be found.
### Misc
+ When saving linked images together with `docker save` a subsequent `docker load` will correctly restore their parent/child relationship ([#21385](https://github.com/docker/docker/pull/c))
+ When saving linked images together with `docker save` a subsequent `docker load` will correctly restore their parent/child relationship ([#21385](https://github.com/docker/docker/pull/21385))
+ Support for building the Docker cli for OpenBSD was added ([#21325](https://github.com/docker/docker/pull/21325))
+ Labels can now be applied at network, volume and image creation ([#21270](https://github.com/docker/docker/pull/21270))
* The `dockremap` is now created as a system user ([#21266](https://github.com/docker/docker/pull/21266))
@ -891,7 +1510,7 @@ by another client (#15489)
#### Security
- Fix tar breakout vulnerability
* Extractions are now sandboxed chroot
- Security options are no longer committed to images
- Security options are no longer comitted to images
#### Runtime
- Fix deadlock in `docker ps -f exited=1`
@ -1317,7 +1936,7 @@ by another client (#15489)
* Update issue filing instructions
* Warn against the use of symlinks for Docker's storage folder
* Replace the Firefox example with an IceWeasel example
* Rewrite the PostgresSQL example using a Dockerfile and add more details to it
* Rewrite the PostgreSQL example using a Dockerfile and add more details to it
* Improve the OS X documentation
#### Remote API

View file

@ -378,7 +378,7 @@ The rules:
5. Document _all_ declarations and methods, even private ones. Declare
expectations, caveats and anything else that may be important. If a type
gets exported, having the comments already there will ensure it's ready.
6. Variable name length should be proportional to it's context and no longer.
6. Variable name length should be proportional to its context and no longer.
`noCommaALongVariableNameLikeThisIsNotMoreClearWhenASimpleCommentWouldDo`.
In practice, short methods will have short variable names and globals will
have longer names.
@ -386,7 +386,7 @@ The rules:
and re-examine why you need a compound name. If you still think you need a
compound name, lose the underscore.
8. No utils or helpers packages. If a function is not general enough to
warrant it's own package, it has not been written generally enough to be a
warrant its own package, it has not been written generally enough to be a
part of a util package. Just leave it unexported and well-documented.
9. All tests should run with `go test` and outside tooling should not be
required. No, we don't need another unit testing framework. Assertion

View file

@ -120,12 +120,7 @@ RUN set -x \
# IMPORTANT: If the version of Go is updated, the Windows to Linux CI machines
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
# with a heads-up.
ENV GO_VERSION 1.6.2
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -xzC /usr/local
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
ENV GO_VERSION 1.6.4
# Compile Go for cross compilation
ENV DOCKER_CROSSPLATFORMS \
@ -134,6 +129,20 @@ ENV DOCKER_CROSSPLATFORMS \
freebsd/amd64 freebsd/386 freebsd/arm \
windows/amd64 windows/386
RUN curl -fsSL "https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz" \
| tar -xzC /root && \
mv /root/go /root/go1.4 && \
cd /usr/local && \
curl -fsSL "https://storage.googleapis.com/golang/go$GO_VERSION.src.tar.gz" \
| tar -xzC /usr/local && \
cd go && \
printf 'diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s\nindex e09b906..fa8ff2f 100644\n--- a/src/runtime/sys_darwin_amd64.s\n+++ b/src/runtime/sys_darwin_amd64.s\n@@ -157,6 +157,7 @@ systime:\n\t// Fall back to system call (usually first call in this thread).\n\tMOVQ\tSP, DI\n\tMOVQ\t$0, SI\n+\tMOVQ\t$0, DX // required as of Sierra; Issue 16570\n\tMOVL\t$(0x2000000+116), AX\n\tSYSCALL\n\tCMPQ\tAX, $0\n' | patch -p1 && \
cd src && \
./make.bash
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
# This has been commented out and kept as reference because we don't support compiling with older Go anymore.
# ENV GOFMT_VERSION 1.3.3
# RUN curl -sSL https://storage.googleapis.com/golang/go${GOFMT_VERSION}.$(go env GOOS)-$(go env GOARCH).tar.gz | tar -C /go/bin -xz --strip-components=2 go/bin/gofmt
@ -217,7 +226,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone --depth 1 -b v1.0.4 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.0.5 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.4 https://github.com/russross/blackfriday.git "$GOPATH/src/github.com/russross/blackfriday" \
&& go get -v -d github.com/cpuguy83/go-md2man \
&& go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \
@ -233,10 +242,10 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
&& git checkout -q "$RUNC_COMMIT" \
&& make static BUILDTAGS="seccomp apparmor selinux" \
@ -244,7 +253,7 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install containerd
ENV CONTAINERD_COMMIT 860f3a94940894ac0a106eff4bd1616a67407ee2
ENV CONTAINERD_COMMIT 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \

View file

@ -36,6 +36,7 @@ RUN apt-get update && apt-get install -y \
libapparmor-dev \
libc6-dev \
libcap-dev \
libltdl-dev \
libsqlite3-dev \
libsystemd-dev \
mercurial \
@ -96,7 +97,7 @@ RUN set -x \
# We don't have official binary tarballs for ARM64, eigher for Go or bootstrap,
# so we use the official armv6 released binaries as a GOROOT_BOOTSTRAP, and
# build Go from source code.
ENV GO_VERSION 1.6.2
ENV GO_VERSION 1.6.4
RUN mkdir /usr/src/go && curl -fsSL https://storage.googleapis.com/golang/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/src/go -xz --strip-components=1 \
&& cd /usr/src/go/src \
&& GOOS=linux GOARCH=arm64 GOROOT_BOOTSTRAP="$(go env GOROOT)" ./make.bash
@ -164,7 +165,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone --depth 1 -b v1.0.4 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.0.5 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.4 https://github.com/russross/blackfriday.git "$GOPATH/src/github.com/russross/blackfriday" \
&& go get -v -d github.com/cpuguy83/go-md2man \
&& go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \
@ -180,10 +181,10 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
&& git checkout -q "$RUNC_COMMIT" \
&& make static BUILDTAGS="seccomp apparmor selinux" \
@ -191,7 +192,7 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install containerd
ENV CONTAINERD_COMMIT 860f3a94940894ac0a106eff4bd1616a67407ee2
ENV CONTAINERD_COMMIT 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \

View file

@ -46,7 +46,8 @@ RUN apt-get update && apt-get install -y \
python-websocket \
xfsprogs \
tar \
--no-install-recommends
--no-install-recommends \
&& pip install awscli==1.10.15
# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
@ -65,7 +66,7 @@ RUN cd /usr/local/lvm2 \
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# Install Go
ENV GO_VERSION 1.6.2
ENV GO_VERSION 1.6.4
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-armv6l.tar.gz" \
| tar -xzC /usr/local
ENV PATH /go/bin:/usr/local/go/bin:$PATH
@ -173,7 +174,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone --depth 1 -b v1.0.4 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.0.5 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.4 https://github.com/russross/blackfriday.git "$GOPATH/src/github.com/russross/blackfriday" \
&& go get -v -d github.com/cpuguy83/go-md2man \
&& go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \
@ -189,10 +190,10 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
&& git checkout -q "$RUNC_COMMIT" \
&& make static BUILDTAGS="seccomp apparmor selinux" \
@ -200,7 +201,7 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install containerd
ENV CONTAINERD_COMMIT 860f3a94940894ac0a106eff4bd1616a67407ee2
ENV CONTAINERD_COMMIT 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \

View file

@ -74,10 +74,10 @@ WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
# Install runc
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
&& git checkout -q "$RUNC_COMMIT" \
&& make static BUILDTAGS="seccomp apparmor selinux" \
@ -85,7 +85,7 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install containerd
ENV CONTAINERD_COMMIT 860f3a94940894ac0a106eff4bd1616a67407ee2
ENV CONTAINERD_COMMIT 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \

View file

@ -15,7 +15,7 @@
# the case. Therefore, you don't have to disable it anymore.
#
FROM ppc64le/gcc:6.1
FROM ppc64le/debian:jessie
# Packaged dependencies
RUN apt-get update && apt-get install -y \
@ -87,22 +87,13 @@ RUN set -x \
&& rm -rf "$SECCOMP_PATH"
## BUILD GOLANG 1.6
# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6
ENV GO_VERSION 1.6.2
ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz
ENV GO_DOWNLOAD_SHA256 787b0b750d037016a30c6ed05a8a70a91b2e9db4bd9b1a2453aa502a63f1bccc
ENV GOROOT_BOOTSTRAP /usr/local
# Install Go
# NOTE: official ppc64le go binaries weren't available until go 1.6.4 and 1.7.4
ENV GO_VERSION 1.6.4
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" \
| tar -xzC /usr/local
RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GO_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/src -xzf golang.tar.gz \
&& rm golang.tar.gz \
&& cd /usr/src/go/src && ./make.bash 2>&1
ENV GOROOT_BOOTSTRAP /usr/src/
ENV PATH /usr/src/go/bin/:/go/bin:$PATH
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
# This has been commented out and kept as reference because we don't support compiling with older Go anymore.
@ -188,7 +179,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone --depth 1 -b v1.0.4 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.0.5 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.4 https://github.com/russross/blackfriday.git "$GOPATH/src/github.com/russross/blackfriday" \
&& go get -v -d github.com/cpuguy83/go-md2man \
&& go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \
@ -204,10 +195,10 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
&& git checkout -q "$RUNC_COMMIT" \
&& make static BUILDTAGS="apparmor seccomp selinux" \
@ -215,7 +206,7 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install containerd
ENV CONTAINERD_COMMIT 860f3a94940894ac0a106eff4bd1616a67407ee2
ENV CONTAINERD_COMMIT 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \

View file

@ -161,7 +161,7 @@ RUN useradd --create-home --gid docker unprivilegeduser
VOLUME /var/lib/docker
WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor selinux
ENV DOCKER_BUILDTAGS apparmor selinux seccomp
# Let us use a .bashrc file
RUN ln -sfv $PWD/.bashrc ~/.bashrc
@ -181,7 +181,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone --depth 1 -b v1.0.4 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.0.5 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone --depth 1 -b v1.4 https://github.com/russross/blackfriday.git "$GOPATH/src/github.com/russross/blackfriday" \
&& go get -v -d github.com/cpuguy83/go-md2man \
&& go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \
@ -197,10 +197,10 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
&& git checkout -q "$RUNC_COMMIT" \
&& make static BUILDTAGS="seccomp apparmor selinux" \
@ -208,7 +208,7 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install containerd
ENV CONTAINERD_COMMIT 860f3a94940894ac0a106eff4bd1616a67407ee2
ENV CONTAINERD_COMMIT 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \

View file

@ -49,7 +49,7 @@ RUN set -x \
# IMPORTANT: If the version of Go is updated, the Windows to Linux CI machines
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
# with a heads-up.
ENV GO_VERSION 1.6.2
ENV GO_VERSION 1.6.4
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -xzC /usr/local
ENV PATH /go/bin:/usr/local/go/bin:$PATH
@ -57,10 +57,10 @@ ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
ENV CGO_LDFLAGS -L/lib
# Install runc
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
&& git checkout -q "$RUNC_COMMIT" \
&& make static BUILDTAGS="seccomp apparmor selinux" \
@ -68,7 +68,7 @@ RUN set -x \
&& rm -rf "$GOPATH"
# Install containerd
ENV CONTAINERD_COMMIT 860f3a94940894ac0a106eff4bd1616a67407ee2
ENV CONTAINERD_COMMIT 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \

View file

@ -34,7 +34,7 @@ FROM windowsservercore
# Environment variable notes:
# - GO_VERSION must consistent with 'Dockerfile' used by Linux'.
# - FROM_DOCKERFILE is used for detection of building within a container.
ENV GO_VERSION=1.6.2 \
ENV GO_VERSION=1.6.4 \
GIT_LOCATION=https://github.com/git-for-windows/git/releases/download/v2.7.2.windows.1/Git-2.7.2-64-bit.exe \
GOPATH=C:/go;C:/go/src/github.com/docker/docker/vendor \
FROM_DOCKERFILE=1

View file

@ -115,6 +115,12 @@ test-unit: build ## run the unit tests
validate: build ## validate DCO, Seccomp profile generation, gofmt,\n./pkg/ isolation, golint, tests, tomls, go vet and vendor
$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-default-seccomp validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet validate-vendor
manpages: ## Generate man pages from go source and markdown
docker build -t docker-manpage-dev -f "man/$(DOCKERFILE)" ./man
docker run \
-v $(PWD):/go/src/github.com/docker/docker/ \
docker-manpage-dev
help: ## this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

View file

@ -38,7 +38,7 @@ to the MAJOR.MINOR.PATCH format."
## Vendoring cadence
In order to avoid huge vendoring changes, it is recommended to have a regular
cadence for vendoring updates. eg. monthly.
cadence for vendoring updates. e.g. monthly.
## Pre-merge vendoring tests
All related repos will be vendored into docker/docker.

View file

@ -1 +1 @@
1.12.0-dev
1.12.6

View file

@ -4,8 +4,8 @@ package bundlefile
import (
"encoding/json"
"fmt"
"io"
"os"
)
// Bundlefile stores the contents of a bundlefile
@ -34,19 +34,28 @@ type Port struct {
}
// LoadFile loads a bundlefile from a path to the file
func LoadFile(path string) (*Bundlefile, error) {
reader, err := os.Open(path)
if err != nil {
return nil, err
}
func LoadFile(reader io.Reader) (*Bundlefile, error) {
bundlefile := &Bundlefile{}
if err := json.NewDecoder(reader).Decode(bundlefile); err != nil {
decoder := json.NewDecoder(reader)
if err := decoder.Decode(bundlefile); err != nil {
switch jsonErr := err.(type) {
case *json.SyntaxError:
return nil, fmt.Errorf(
"JSON syntax error at byte %v: %s",
jsonErr.Offset,
jsonErr.Error())
case *json.UnmarshalTypeError:
return nil, fmt.Errorf(
"Unexpected type at byte %v. Expected %s but received %s.",
jsonErr.Offset,
jsonErr.Type,
jsonErr.Value)
}
return nil, err
}
return bundlefile, err
return bundlefile, nil
}
// Print writes the contents of the bundlefile to the output writer

View file

@ -0,0 +1,79 @@
// +build experimental
package bundlefile
import (
"bytes"
"strings"
"testing"
"github.com/docker/docker/pkg/testutil/assert"
)
func TestLoadFileV01Success(t *testing.T) {
reader := strings.NewReader(`{
"Version": "0.1",
"Services": {
"redis": {
"Image": "redis@sha256:4b24131101fa0117bcaa18ac37055fffd9176aa1a240392bb8ea85e0be50f2ce",
"Networks": ["default"]
},
"web": {
"Image": "dockercloud/hello-world@sha256:fe79a2cfbd17eefc344fb8419420808df95a1e22d93b7f621a7399fd1e9dca1d",
"Networks": ["default"],
"User": "web"
}
}
}`)
bundle, err := LoadFile(reader)
assert.NilError(t, err)
assert.Equal(t, bundle.Version, "0.1")
assert.Equal(t, len(bundle.Services), 2)
}
func TestLoadFileSyntaxError(t *testing.T) {
reader := strings.NewReader(`{
"Version": "0.1",
"Services": unquoted string
}`)
_, err := LoadFile(reader)
assert.Error(t, err, "syntax error at byte 37: invalid character 'u'")
}
func TestLoadFileTypeError(t *testing.T) {
reader := strings.NewReader(`{
"Version": "0.1",
"Services": {
"web": {
"Image": "redis",
"Networks": "none"
}
}
}`)
_, err := LoadFile(reader)
assert.Error(t, err, "Unexpected type at byte 94. Expected []string but received string")
}
func TestPrint(t *testing.T) {
var buffer bytes.Buffer
bundle := &Bundlefile{
Version: "0.1",
Services: map[string]Service{
"web": {
Image: "image",
Command: []string{"echo", "something"},
},
},
}
assert.NilError(t, Print(&buffer, bundle))
output := buffer.String()
assert.Contains(t, output, "\"Image\": \"image\"")
assert.Contains(t, output,
`"Command": [
"echo",
"something"
]`)
}

View file

@ -47,8 +47,10 @@ type DockerCli struct {
isTerminalOut bool
// client is the http client that performs all API operations
client client.APIClient
// state holds the terminal state
state *term.State
// state holds the terminal input state
inState *term.State
// outState holds the terminal output state
outState *term.State
}
// Initialize calls the init function that will setup the configuration for the client
@ -124,19 +126,31 @@ func (cli *DockerCli) ImagesFormat() string {
}
func (cli *DockerCli) setRawTerminal() error {
if cli.isTerminalIn && os.Getenv("NORAW") == "" {
state, err := term.SetRawTerminal(cli.inFd)
if err != nil {
return err
if os.Getenv("NORAW") == "" {
if cli.isTerminalIn {
state, err := term.SetRawTerminal(cli.inFd)
if err != nil {
return err
}
cli.inState = state
}
if cli.isTerminalOut {
state, err := term.SetRawTerminalOutput(cli.outFd)
if err != nil {
return err
}
cli.outState = state
}
cli.state = state
}
return nil
}
func (cli *DockerCli) restoreTerminal(in io.Closer) error {
if cli.state != nil {
term.RestoreTerminal(cli.inFd, cli.state)
if cli.inState != nil {
term.RestoreTerminal(cli.inFd, cli.inState)
}
if cli.outState != nil {
term.RestoreTerminal(cli.outFd, cli.outState)
}
// WARNING: DO NOT REMOVE THE OS CHECK !!!
// For some reason this Close call blocks on darwin..

View file

@ -36,7 +36,6 @@ func NewAttachCommand(dockerCli *client.DockerCli) *cobra.Command {
return runAttach(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
flags := cmd.Flags()
flags.BoolVar(&opts.noStdin, "no-stdin", false, "Do not attach STDIN")

View file

@ -41,7 +41,6 @@ func NewCommitCommand(dockerCli *client.DockerCli) *cobra.Command {
return runCommit(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
flags := cmd.Flags()
flags.SetInterspersed(false)

View file

@ -44,6 +44,7 @@ func NewCopyCommand(dockerCli *client.DockerCli) *cobra.Command {
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH`,
Short: "Copy files/folders between a container and the local filesystem",
Long: strings.Join([]string{
"Copy files/folders between a container and the local filesystem\n",
"\nUse '-' as the source to read a tar archive from stdin\n",
"and extract it to a directory destination in a container.\n",
"Use '-' as the destination to stream a tar archive of a\n",

View file

@ -43,7 +43,6 @@ func NewCreateCommand(dockerCli *client.DockerCli) *cobra.Command {
return runCreate(dockerCli, cmd.Flags(), &opts, copts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
flags := cmd.Flags()
flags.SetInterspersed(false)

View file

@ -15,7 +15,7 @@ type diffOptions struct {
container string
}
// NewDiffCommand creats a new cobra.Command for `docker diff`
// NewDiffCommand creates a new cobra.Command for `docker diff`
func NewDiffCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts diffOptions
@ -28,7 +28,6 @@ func NewDiffCommand(dockerCli *client.DockerCli) *cobra.Command {
return runDiff(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
return cmd
}

View file

@ -23,7 +23,7 @@ func NewKillCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "kill [OPTIONS] CONTAINER [CONTAINER...]",
Short: "Kill one or more running container",
Short: "Kill one or more running containers",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args

View file

@ -41,7 +41,6 @@ func NewLogsCommand(dockerCli *client.DockerCli) *cobra.Command {
return runLogs(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
flags := cmd.Flags()
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output")

View file

@ -28,7 +28,6 @@ func NewPauseCommand(dockerCli *client.DockerCli) *cobra.Command {
return runPause(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
return cmd
}

View file

@ -34,7 +34,6 @@ func NewPortCommand(dockerCli *client.DockerCli) *cobra.Command {
return runPort(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
return cmd
}

View file

@ -42,7 +42,7 @@ func NewPsCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "ps [OPTIONS]",
Short: "List containers",
Args: cli.ExactArgs(0),
Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return runPs(dockerCli, &opts)
},
@ -55,7 +55,7 @@ func NewPsCommand(dockerCli *client.DockerCli) *cobra.Command {
flags.BoolVarP(&opts.all, "all", "a", false, "Show all containers (default shows just running)")
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Don't truncate output")
flags.BoolVarP(&opts.nLatest, "latest", "l", false, "Show the latest created container (includes all states)")
flags.IntVarP(&opts.last, "", "n", -1, "Show n last created containers (includes all states)")
flags.IntVarP(&opts.last, "last", "n", -1, "Show n last created containers (includes all states)")
flags.StringVarP(&opts.format, "format", "", "", "Pretty-print containers using a Go template")
flags.StringSliceVarP(&opts.filter, "filter", "f", []string{}, "Filter output based on conditions provided")

View file

@ -21,7 +21,7 @@ func NewRenameCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts renameOptions
cmd := &cobra.Command{
Use: "rename OLD_NAME NEW_NAME",
Use: "rename CONTAINER NEW_NAME",
Short: "Rename a container",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
@ -30,7 +30,6 @@ func NewRenameCommand(dockerCli *client.DockerCli) *cobra.Command {
return runRename(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
return cmd
}

View file

@ -18,7 +18,7 @@ type restartOptions struct {
containers []string
}
// NewRestartCommand creats a new cobra.Command for `docker restart`
// NewRestartCommand creates a new cobra.Command for `docker restart`
func NewRestartCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts restartOptions
@ -41,7 +41,8 @@ func runRestart(dockerCli *client.DockerCli, opts *restartOptions) error {
ctx := context.Background()
var errs []string
for _, name := range opts.containers {
if err := dockerCli.Client().ContainerRestart(ctx, name, time.Duration(opts.nSeconds)*time.Second); err != nil {
timeout := time.Duration(opts.nSeconds) * time.Second
if err := dockerCli.Client().ContainerRestart(ctx, name, &timeout); err != nil {
errs = append(errs, err.Error())
} else {
fmt.Fprintf(dockerCli.Out(), "%s\n", name)

View file

@ -20,7 +20,7 @@ type rmOptions struct {
containers []string
}
// NewRmCommand creats a new cobra.Command for `docker rm`
// NewRmCommand creates a new cobra.Command for `docker rm`
func NewRmCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts rmOptions

View file

@ -54,7 +54,6 @@ func NewRunCommand(dockerCli *client.DockerCli) *cobra.Command {
return runRun(dockerCli, cmd.Flags(), &opts, copts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
flags := cmd.Flags()
flags.SetInterspersed(false)
@ -75,13 +74,6 @@ func NewRunCommand(dockerCli *client.DockerCli) *cobra.Command {
return cmd
}
func flagErrorFunc(cmd *cobra.Command, err error) error {
return cli.StatusError{
Status: cli.FlagErrorFunc(cmd, err).Error(),
StatusCode: 125,
}
}
func runRun(dockerCli *client.DockerCli, flags *pflag.FlagSet, opts *runOptions, copts *runconfigopts.ContainerOptions) error {
stdout, stderr, stdin := dockerCli.Out(), dockerCli.Err(), dockerCli.In()
client := dockerCli.Client()

View file

@ -37,7 +37,6 @@ func NewStartCommand(dockerCli *client.DockerCli) *cobra.Command {
return runStart(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
flags := cmd.Flags()
flags.BoolVarP(&opts.attach, "attach", "a", false, "Attach STDOUT/STDERR and forward signals")
@ -63,8 +62,9 @@ func runStart(dockerCli *client.DockerCli, opts *startOptions) error {
return err
}
// We always use c.ID instead of container to maintain consistency during `docker start`
if !c.Config.Tty {
sigc := dockerCli.ForwardAllSignals(ctx, container)
sigc := dockerCli.ForwardAllSignals(ctx, c.ID)
defer signal.StopCatch(sigc)
}
@ -86,7 +86,7 @@ func runStart(dockerCli *client.DockerCli, opts *startOptions) error {
in = dockerCli.In()
}
resp, errAttach := dockerCli.Client().ContainerAttach(ctx, container, options)
resp, errAttach := dockerCli.Client().ContainerAttach(ctx, c.ID, options)
if errAttach != nil && errAttach != httputil.ErrPersistEOF {
// ContainerAttach return an ErrPersistEOF (connection closed)
// means server met an error and put it in Hijacked connection
@ -103,7 +103,7 @@ func runStart(dockerCli *client.DockerCli, opts *startOptions) error {
})
// 3. Start the container.
if err := dockerCli.Client().ContainerStart(ctx, container, types.ContainerStartOptions{}); err != nil {
if err := dockerCli.Client().ContainerStart(ctx, c.ID, types.ContainerStartOptions{}); err != nil {
cancelFun()
<-cErr
return err
@ -111,14 +111,14 @@ func runStart(dockerCli *client.DockerCli, opts *startOptions) error {
// 4. Wait for attachment to break.
if c.Config.Tty && dockerCli.IsTerminalOut() {
if err := dockerCli.MonitorTtySize(ctx, container, false); err != nil {
if err := dockerCli.MonitorTtySize(ctx, c.ID, false); err != nil {
fmt.Fprintf(dockerCli.Err(), "Error monitoring TTY size: %s\n", err)
}
}
if attchErr := <-cErr; attchErr != nil {
return attchErr
}
_, status, err := getExitCode(dockerCli, ctx, container)
_, status, err := getExitCode(dockerCli, ctx, c.ID)
if err != nil {
return err
}

View file

@ -192,13 +192,23 @@ func runStats(dockerCli *client.DockerCli, opts *statsOptions) error {
for range time.Tick(500 * time.Millisecond) {
printHeader()
toRemove := []string{}
cStats.mu.Lock()
for _, s := range cStats.cs {
if err := s.Display(w); err != nil && !opts.noStream {
logrus.Debugf("stats: got error for %s: %v", s.Name, err)
if err == io.EOF {
toRemove = append(toRemove, s.Name)
}
}
}
cStats.mu.Unlock()
for _, name := range toRemove {
cStats.remove(name)
}
if len(cStats.cs) == 0 && !showAll {
return nil
}
w.Flush()
if opts.noStream {
break

View file

@ -97,6 +97,10 @@ func (s *containerStats) Collect(ctx context.Context, cli client.APIClient, stre
if err := dec.Decode(&v); err != nil {
dec = json.NewDecoder(io.MultiReader(dec.Buffered(), responseBody))
u <- err
if err == io.EOF {
break
}
time.Sleep(100 * time.Millisecond)
continue
}

View file

@ -31,7 +31,6 @@ func NewStopCommand(dockerCli *client.DockerCli) *cobra.Command {
return runStop(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
flags := cmd.Flags()
flags.IntVarP(&opts.time, "time", "t", 10, "Seconds to wait for stop before killing it")
@ -43,7 +42,8 @@ func runStop(dockerCli *client.DockerCli, opts *stopOptions) error {
var errs []string
for _, container := range opts.containers {
if err := dockerCli.Client().ContainerStop(ctx, container, time.Duration(opts.time)*time.Second); err != nil {
timeout := time.Duration(opts.time) * time.Second
if err := dockerCli.Client().ContainerStop(ctx, container, &timeout); err != nil {
errs = append(errs, err.Error())
} else {
fmt.Fprintf(dockerCli.Out(), "%s\n", container)

View file

@ -18,7 +18,7 @@ type topOptions struct {
args []string
}
// NewTopCommand creats a new cobra.Command for `docker top`
// NewTopCommand creates a new cobra.Command for `docker top`
func NewTopCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts topOptions
@ -32,7 +32,6 @@ func NewTopCommand(dockerCli *client.DockerCli) *cobra.Command {
return runTop(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
flags := cmd.Flags()
flags.SetInterspersed(false)

View file

@ -28,7 +28,6 @@ func NewUnpauseCommand(dockerCli *client.DockerCli) *cobra.Command {
return runUnpause(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
return cmd
}

View file

@ -7,7 +7,7 @@ import (
clientapi "github.com/docker/engine-api/client"
)
// getExitCode perform an inspect on the container. It returns
// getExitCode performs an inspect on the container. It returns
// the running state and the exit code.
func getExitCode(dockerCli *client.DockerCli, ctx context.Context, containerID string) (bool, int, error) {
c, err := dockerCli.Client().ContainerInspect(ctx, containerID)

View file

@ -15,7 +15,7 @@ type waitOptions struct {
containers []string
}
// NewWaitCommand creats a new cobra.Command for `docker wait`
// NewWaitCommand creates a new cobra.Command for `docker wait`
func NewWaitCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts waitOptions
@ -28,7 +28,6 @@ func NewWaitCommand(dockerCli *client.DockerCli) *cobra.Command {
return runWait(dockerCli, &opts)
},
}
cmd.SetFlagErrorFunc(flagErrorFunc)
return cmd
}

View file

@ -17,7 +17,7 @@ import (
//
// Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
func (cli *DockerCli) CmdExec(args ...string) error {
cmd := Cli.Subcmd("exec", []string{"CONTAINER COMMAND [ARG...]"}, Cli.DockerCommands["exec"].Description, true)
cmd := Cli.Subcmd("exec", []string{"[OPTIONS] CONTAINER COMMAND [ARG...]"}, Cli.DockerCommands["exec"].Description, true)
detachKeys := cmd.String([]string{"-detach-keys"}, "", "Override the key sequence for detaching a container")
execConfig, err := ParseExec(cmd, args)

View file

@ -155,6 +155,10 @@ func (ctx ContainerContext) Write() {
ctx.postformat(tmpl, &containerContext{})
}
func isDangling(image types.Image) bool {
return len(image.RepoTags) == 1 && image.RepoTags[0] == "<none>:<none>" && len(image.RepoDigests) == 1 && image.RepoDigests[0] == "<none>@<none>"
}
func (ctx ImageContext) Write() {
switch ctx.Format {
case tableFormatKey:
@ -200,42 +204,98 @@ virtual_size: {{.Size}}
}
for _, image := range ctx.Images {
images := []*imageContext{}
if isDangling(image) {
images = append(images, &imageContext{
trunc: ctx.Trunc,
i: image,
repo: "<none>",
tag: "<none>",
digest: "<none>",
})
} else {
repoTags := map[string][]string{}
repoDigests := map[string][]string{}
repoTags := image.RepoTags
repoDigests := image.RepoDigests
if len(repoTags) == 1 && repoTags[0] == "<none>:<none>" && len(repoDigests) == 1 && repoDigests[0] == "<none>@<none>" {
// dangling image - clear out either repoTags or repoDigests so we only show it once below
repoDigests = []string{}
}
// combine the tags and digests lists
tagsAndDigests := append(repoTags, repoDigests...)
for _, repoAndRef := range tagsAndDigests {
repo := "<none>"
tag := "<none>"
digest := "<none>"
if !strings.HasPrefix(repoAndRef, "<none>") {
ref, err := reference.ParseNamed(repoAndRef)
for _, refString := range append(image.RepoTags) {
ref, err := reference.ParseNamed(refString)
if err != nil {
continue
}
repo = ref.Name()
switch x := ref.(type) {
case reference.Canonical:
digest = x.Digest().String()
case reference.NamedTagged:
tag = x.Tag()
if nt, ok := ref.(reference.NamedTagged); ok {
repoTags[ref.Name()] = append(repoTags[ref.Name()], nt.Tag())
}
}
imageCtx := &imageContext{
trunc: ctx.Trunc,
i: image,
repo: repo,
tag: tag,
digest: digest,
for _, refString := range append(image.RepoDigests) {
ref, err := reference.ParseNamed(refString)
if err != nil {
continue
}
if c, ok := ref.(reference.Canonical); ok {
repoDigests[ref.Name()] = append(repoDigests[ref.Name()], c.Digest().String())
}
}
for repo, tags := range repoTags {
digests := repoDigests[repo]
// Do not display digests as their own row
delete(repoDigests, repo)
if !ctx.Digest {
// Ignore digest references, just show tag once
digests = nil
}
for _, tag := range tags {
if len(digests) == 0 {
images = append(images, &imageContext{
trunc: ctx.Trunc,
i: image,
repo: repo,
tag: tag,
digest: "<none>",
})
continue
}
// Display the digests for each tag
for _, dgst := range digests {
images = append(images, &imageContext{
trunc: ctx.Trunc,
i: image,
repo: repo,
tag: tag,
digest: dgst,
})
}
}
}
// Show rows for remaining digest only references
for repo, digests := range repoDigests {
// If digests are displayed, show row per digest
if ctx.Digest {
for _, dgst := range digests {
images = append(images, &imageContext{
trunc: ctx.Trunc,
i: image,
repo: repo,
tag: "<none>",
digest: dgst,
})
}
} else {
images = append(images, &imageContext{
trunc: ctx.Trunc,
i: image,
repo: repo,
tag: "<none>",
})
}
}
}
for _, imageCtx := range images {
err = ctx.contextFormat(tmpl, imageCtx)
if err != nil {
return

View file

@ -301,7 +301,6 @@ func TestImageContextWrite(t *testing.T) {
},
`REPOSITORY TAG IMAGE ID CREATED SIZE
image tag1 imageID1 24 hours ago 0 B
image <none> imageID1 24 hours ago 0 B
image tag2 imageID2 24 hours ago 0 B
<none> <none> imageID3 24 hours ago 0 B
`,
@ -312,7 +311,7 @@ image tag2 imageID2 24 hours ago
Format: "table {{.Repository}}",
},
},
"REPOSITORY\nimage\nimage\nimage\n<none>\n",
"REPOSITORY\nimage\nimage\n<none>\n",
},
{
ImageContext{
@ -322,7 +321,6 @@ image tag2 imageID2 24 hours ago
Digest: true,
},
`REPOSITORY DIGEST
image <none>
image sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
image <none>
<none> <none>
@ -335,7 +333,7 @@ image <none>
Quiet: true,
},
},
"REPOSITORY\nimage\nimage\nimage\n<none>\n",
"REPOSITORY\nimage\nimage\n<none>\n",
},
{
ImageContext{
@ -344,7 +342,7 @@ image <none>
Quiet: true,
},
},
"imageID1\nimageID1\nimageID2\nimageID3\n",
"imageID1\nimageID2\nimageID3\n",
},
{
ImageContext{
@ -355,8 +353,7 @@ image <none>
Digest: true,
},
`REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
image tag1 <none> imageID1 24 hours ago 0 B
image <none> sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf imageID1 24 hours ago 0 B
image tag1 sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf imageID1 24 hours ago 0 B
image tag2 <none> imageID2 24 hours ago 0 B
<none> <none> <none> imageID3 24 hours ago 0 B
`,
@ -369,7 +366,7 @@ image tag2 <none>
},
Digest: true,
},
"imageID1\nimageID1\nimageID2\nimageID3\n",
"imageID1\nimageID2\nimageID3\n",
},
// Raw Format
{
@ -384,12 +381,6 @@ image_id: imageID1
created_at: %s
virtual_size: 0 B
repository: image
tag: <none>
image_id: imageID1
created_at: %s
virtual_size: 0 B
repository: image
tag: tag2
image_id: imageID2
@ -402,7 +393,7 @@ image_id: imageID3
created_at: %s
virtual_size: 0 B
`, expectedTime, expectedTime, expectedTime, expectedTime),
`, expectedTime, expectedTime, expectedTime),
},
{
ImageContext{
@ -413,13 +404,6 @@ virtual_size: 0 B
},
fmt.Sprintf(`repository: image
tag: tag1
digest: <none>
image_id: imageID1
created_at: %s
virtual_size: 0 B
repository: image
tag: <none>
digest: sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
image_id: imageID1
created_at: %s
@ -439,7 +423,7 @@ image_id: imageID3
created_at: %s
virtual_size: 0 B
`, expectedTime, expectedTime, expectedTime, expectedTime),
`, expectedTime, expectedTime, expectedTime),
},
{
ImageContext{
@ -449,7 +433,6 @@ virtual_size: 0 B
},
},
`image_id: imageID1
image_id: imageID1
image_id: imageID2
image_id: imageID3
`,
@ -461,7 +444,7 @@ image_id: imageID3
Format: "{{.Repository}}",
},
},
"image\nimage\nimage\n<none>\n",
"image\nimage\n<none>\n",
},
{
ImageContext{
@ -470,7 +453,7 @@ image_id: imageID3
},
Digest: true,
},
"image\nimage\nimage\n<none>\n",
"image\nimage\n<none>\n",
},
}

View file

@ -28,7 +28,7 @@ func New(client client.APIClient, noResolve bool) *IDResolver {
func (r *IDResolver) get(ctx context.Context, t interface{}, id string) (string, error) {
switch t.(type) {
case swarm.Node:
node, err := r.client.NodeInspect(ctx, id)
node, _, err := r.client.NodeInspectWithRaw(ctx, id)
if err != nil {
return id, nil
}
@ -40,7 +40,7 @@ func (r *IDResolver) get(ctx context.Context, t interface{}, id string) (string,
}
return id, nil
case swarm.Service:
service, err := r.client.ServiceInspect(ctx, id)
service, _, err := r.client.ServiceInspectWithRaw(ctx, id)
if err != nil {
return id, nil
}

View file

@ -37,7 +37,7 @@ type buildOptions struct {
context string
dockerfileName string
tags opts.ListOpts
labels []string
labels opts.ListOpts
buildArgs opts.ListOpts
ulimits *runconfigopts.UlimitOpt
memory string
@ -64,10 +64,11 @@ func NewBuildCommand(dockerCli *client.DockerCli) *cobra.Command {
tags: opts.NewListOpts(validateTag),
buildArgs: opts.NewListOpts(runconfigopts.ValidateEnv),
ulimits: runconfigopts.NewUlimitOpt(&ulimits),
labels: opts.NewListOpts(runconfigopts.ValidateEnv),
}
cmd := &cobra.Command{
Use: "build PATH | URL | -",
Use: "build [OPTIONS] PATH | URL | -",
Short: "Build an image from a Dockerfile",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
@ -92,7 +93,7 @@ func NewBuildCommand(dockerCli *client.DockerCli) *cobra.Command {
flags.StringVar(&options.cpuSetMems, "cpuset-mems", "", "MEMs in which to allow execution (0-3, 0,1)")
flags.StringVar(&options.cgroupParent, "cgroup-parent", "", "Optional parent cgroup for the container")
flags.StringVar(&options.isolation, "isolation", "", "Container isolation technology")
flags.StringSliceVar(&options.labels, "label", []string{}, "Set metadata for an image")
flags.Var(&options.labels, "label", "Set metadata for an image")
flags.BoolVar(&options.noCache, "no-cache", false, "Do not use cache when building the image")
flags.BoolVar(&options.rm, "rm", true, "Remove intermediate containers after a successful build")
flags.BoolVar(&options.forceRm, "force-rm", false, "Always remove intermediate containers")
@ -264,7 +265,7 @@ func runBuild(dockerCli *client.DockerCli, options buildOptions) error {
Ulimits: options.ulimits.GetList(),
BuildArgs: runconfigopts.ConvertKVStringsToMap(options.buildArgs.GetAll()),
AuthConfigs: dockerCli.RetrieveAuthConfigs(),
Labels: runconfigopts.ConvertKVStringsToMap(options.labels),
Labels: runconfigopts.ConvertKVStringsToMap(options.labels.GetAll()),
}
response, err := dockerCli.Client().ImageBuild(ctx, body, buildOptions)

View file

@ -77,9 +77,13 @@ func runPull(dockerCli *client.DockerCli, opts pullOptions) error {
if client.IsTrusted() && !registryRef.HasDigest() {
// Check if tag is digest
return dockerCli.TrustedPull(ctx, repoInfo, registryRef, authConfig, requestPrivilege)
err = dockerCli.TrustedPull(ctx, repoInfo, registryRef, authConfig, requestPrivilege)
} else {
err = dockerCli.ImagePullPrivileged(ctx, authConfig, distributionRef.String(), requestPrivilege, opts.all)
}
if err != nil {
return err
}
return dockerCli.ImagePullPrivileged(ctx, authConfig, distributionRef.String(), requestPrivilege, opts.all)
return nil
}

View file

@ -14,7 +14,7 @@ import (
// NewPushCommand creates a new `docker push` command
func NewPushCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "push NAME[:TAG]",
Use: "push [OPTIONS] NAME[:TAG]",
Short: "Push an image or a repository to a registry",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {

View file

@ -18,7 +18,7 @@ func NewTagCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts tagOptions
cmd := &cobra.Command{
Use: "tag IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]",
Use: "tag IMAGE[:TAG] IMAGE[:TAG]",
Short: "Tag an image into a repository",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {

View file

@ -3,6 +3,7 @@ package client
import (
"fmt"
"strings"
"time"
"golang.org/x/net/context"
@ -23,7 +24,8 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
cmd.ParseFlags(args, true)
info, err := cli.client.Info(context.Background())
ctx := context.Background()
info, err := cli.client.Info(ctx)
if err != nil {
return err
}
@ -41,7 +43,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
// print a warning if devicemapper is using a loopback file
if pair[0] == "Data loop file" {
fmt.Fprintln(cli.err, " WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.")
fmt.Fprintln(cli.err, " WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.")
}
}
@ -51,7 +53,6 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
fmt.Fprintf(cli.out, "%s: %s\n", pair[0], pair[1])
}
}
ioutils.FprintfIfNotEmpty(cli.out, "Execution Driver: %s\n", info.ExecutionDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Cgroup Driver: %s\n", info.CgroupDriver)
@ -75,14 +76,29 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
if info.Swarm.Error != "" {
fmt.Fprintf(cli.out, " Error: %v\n", info.Swarm.Error)
}
fmt.Fprintf(cli.out, " Is Manager: %v\n", info.Swarm.ControlAvailable)
if info.Swarm.ControlAvailable {
fmt.Fprintf(cli.out, " IsManager: Yes\n")
fmt.Fprintf(cli.out, " ClusterID: %s\n", info.Swarm.Cluster.ID)
fmt.Fprintf(cli.out, " Managers: %d\n", info.Swarm.Managers)
fmt.Fprintf(cli.out, " Nodes: %d\n", info.Swarm.Nodes)
ioutils.FprintfIfNotEmpty(cli.out, " CACertHash: %s\n", info.Swarm.CACertHash)
} else {
fmt.Fprintf(cli.out, " IsManager: No\n")
fmt.Fprintf(cli.out, " Orchestration:\n")
fmt.Fprintf(cli.out, " Task History Retention Limit: %d\n", info.Swarm.Cluster.Spec.Orchestration.TaskHistoryRetentionLimit)
fmt.Fprintf(cli.out, " Raft:\n")
fmt.Fprintf(cli.out, " Snapshot Interval: %d\n", info.Swarm.Cluster.Spec.Raft.SnapshotInterval)
fmt.Fprintf(cli.out, " Heartbeat Tick: %d\n", info.Swarm.Cluster.Spec.Raft.HeartbeatTick)
fmt.Fprintf(cli.out, " Election Tick: %d\n", info.Swarm.Cluster.Spec.Raft.ElectionTick)
fmt.Fprintf(cli.out, " Dispatcher:\n")
fmt.Fprintf(cli.out, " Heartbeat Period: %s\n", units.HumanDuration(time.Duration(info.Swarm.Cluster.Spec.Dispatcher.HeartbeatPeriod)))
fmt.Fprintf(cli.out, " CA Configuration:\n")
fmt.Fprintf(cli.out, " Expiry Duration: %s\n", units.HumanDuration(info.Swarm.Cluster.Spec.CAConfig.NodeCertExpiry))
if len(info.Swarm.Cluster.Spec.CAConfig.ExternalCAs) > 0 {
fmt.Fprintf(cli.out, " External CAs:\n")
for _, entry := range info.Swarm.Cluster.Spec.CAConfig.ExternalCAs {
fmt.Fprintf(cli.out, " %s: %s\n", entry.Protocol, entry.URL)
}
}
}
fmt.Fprintf(cli.out, " Node Address: %s\n", info.Swarm.NodeAddr)
}
if len(info.Runtimes) > 0 {
@ -94,6 +110,10 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
fmt.Fprintf(cli.out, "Default Runtime: %s\n", info.DefaultRuntime)
}
fmt.Fprintf(cli.out, "Security Options:")
ioutils.FprintfIfNotEmpty(cli.out, " %s", strings.Join(info.SecurityOptions, " "))
fmt.Fprintf(cli.out, "\n")
ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
ioutils.FprintfIfNotEmpty(cli.out, "OSType: %s\n", info.OSType)

View file

@ -15,7 +15,7 @@ import (
//
// Usage: docker inspect [OPTIONS] CONTAINER|IMAGE|TASK [CONTAINER|IMAGE|TASK...]
func (cli *DockerCli) CmdInspect(args ...string) error {
cmd := Cli.Subcmd("inspect", []string{"CONTAINER|IMAGE|TASK [CONTAINER|IMAGE|TASK...]"}, Cli.DockerCommands["inspect"].Description, true)
cmd := Cli.Subcmd("inspect", []string{"[OPTIONS] CONTAINER|IMAGE|TASK [CONTAINER|IMAGE|TASK...]"}, Cli.DockerCommands["inspect"].Description, true)
tmplStr := cmd.String([]string{"f", "-format"}, "", "Format the output using the given go template")
inspectType := cmd.String([]string{"-type"}, "", "Return JSON for specified type, (e.g image, container or task)")
size := cmd.Bool([]string{"s", "-size"}, false, "Display total file sizes if the type is container")
@ -86,10 +86,10 @@ func (cli *DockerCli) inspectAll(ctx context.Context, getSize bool) inspect.GetR
}
return nil, nil, err
}
return i, rawImage, err
return i, rawImage, nil
}
return nil, nil, err
}
return c, rawContainer, err
return c, rawContainer, nil
}
}

View file

@ -28,7 +28,7 @@ func newConnectCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "connect [OPTIONS] NETWORK CONTAINER",
Short: "Connects a container to a network",
Short: "Connect a container to a network",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
opts.network = args[0]

View file

@ -40,7 +40,7 @@ func newCreateCommand(dockerCli *client.DockerCli) *cobra.Command {
}
cmd := &cobra.Command{
Use: "create",
Use: "create [OPTIONS] NETWORK",
Short: "Create a network",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
@ -53,16 +53,16 @@ func newCreateCommand(dockerCli *client.DockerCli) *cobra.Command {
flags.StringVarP(&opts.driver, "driver", "d", "bridge", "Driver to manage the Network")
flags.VarP(&opts.driverOpts, "opt", "o", "Set driver specific options")
flags.StringSliceVar(&opts.labels, "label", []string{}, "Set metadata on a network")
flags.BoolVar(&opts.internal, "internal", false, "restricts external access to the network")
flags.BoolVar(&opts.ipv6, "ipv6", false, "enable IPv6 networking")
flags.BoolVar(&opts.internal, "internal", false, "Restrict external access to the network")
flags.BoolVar(&opts.ipv6, "ipv6", false, "Enable IPv6 networking")
flags.StringVar(&opts.ipamDriver, "ipam-driver", "default", "IP Address Management Driver")
flags.StringSliceVar(&opts.ipamSubnet, "subnet", []string{}, "subnet in CIDR format that represents a network segment")
flags.StringSliceVar(&opts.ipamIPRange, "ip-range", []string{}, "allocate container ip from a sub-range")
flags.StringSliceVar(&opts.ipamGateway, "gateway", []string{}, "ipv4 or ipv6 Gateway for the master subnet")
flags.StringSliceVar(&opts.ipamSubnet, "subnet", []string{}, "Subnet in CIDR format that represents a network segment")
flags.StringSliceVar(&opts.ipamIPRange, "ip-range", []string{}, "Allocate container ip from a sub-range")
flags.StringSliceVar(&opts.ipamGateway, "gateway", []string{}, "IPv4 or IPv6 Gateway for the master subnet")
flags.Var(&opts.ipamAux, "aux-address", "auxiliary ipv4 or ipv6 addresses used by Network driver")
flags.Var(&opts.ipamOpt, "ipam-opt", "set IPAM driver specific options")
flags.Var(&opts.ipamAux, "aux-address", "Auxiliary IPv4 or IPv6 addresses used by Network driver")
flags.Var(&opts.ipamOpt, "ipam-opt", "Set IPAM driver specific options")
return cmd
}

View file

@ -19,7 +19,7 @@ func newDisconnectCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "disconnect [OPTIONS] NETWORK CONTAINER",
Short: "Disconnects container from a network",
Short: "Disconnect a container from a network",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
opts.network = args[0]

View file

@ -19,7 +19,7 @@ func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "inspect [OPTIONS] NETWORK [NETWORK...]",
Short: "Displays detailed information on one or more networks",
Short: "Display detailed information on one or more networks",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.names = args

View file

@ -31,7 +31,7 @@ func newListCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts listOptions
cmd := &cobra.Command{
Use: "ls",
Use: "ls [OPTIONS]",
Aliases: []string{"list"},
Short: "List networks",
Args: cli.NoArgs,
@ -41,7 +41,7 @@ func newListCommand(dockerCli *client.DockerCli) *cobra.Command {
}
flags := cmd.Flags()
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Only display volume names")
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Only display network IDs")
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Do not truncate the output")
flags.StringSliceVarP(&opts.filter, "filter", "f", []string{}, "Provide filter values (i.e. 'dangling=true')")

View file

@ -12,9 +12,9 @@ import (
func newRemoveCommand(dockerCli *client.DockerCli) *cobra.Command {
return &cobra.Command{
Use: "rm NETWORK [NETWORK]...",
Use: "rm NETWORK [NETWORK...]",
Aliases: []string{"remove"},
Short: "Remove a network",
Short: "Remove one or more networks",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runRemove(dockerCli, args)
@ -33,7 +33,7 @@ func runRemove(dockerCli *client.DockerCli, networks []string) error {
status = 1
continue
}
fmt.Fprintf(dockerCli.Err(), "%s\n", name)
fmt.Fprintf(dockerCli.Out(), "%s\n", name)
}
if status != 0 {

View file

@ -1,40 +0,0 @@
package node
import (
"fmt"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
func newAcceptCommand(dockerCli *client.DockerCli) *cobra.Command {
var flags *pflag.FlagSet
cmd := &cobra.Command{
Use: "accept NODE [NODE...]",
Short: "Accept a node in the swarm",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runAccept(dockerCli, flags, args)
},
}
flags = cmd.Flags()
return cmd
}
func runAccept(dockerCli *client.DockerCli, flags *pflag.FlagSet, args []string) error {
for _, id := range args {
if err := runUpdate(dockerCli, id, func(node *swarm.Node) {
node.Spec.Membership = swarm.NodeMembershipAccepted
}); err != nil {
return err
}
fmt.Println(id, "attempting to accept a node in the swarm.")
}
return nil
}

View file

@ -23,21 +23,21 @@ func NewNodeCommand(dockerCli *client.DockerCli) *cobra.Command {
},
}
cmd.AddCommand(
newAcceptCommand(dockerCli),
newDemoteCommand(dockerCli),
newInspectCommand(dockerCli),
newListCommand(dockerCli),
newPromoteCommand(dockerCli),
newRemoveCommand(dockerCli),
newTasksCommand(dockerCli),
newPSCommand(dockerCli),
newUpdateCommand(dockerCli),
)
return cmd
}
func nodeReference(client apiclient.APIClient, ctx context.Context, ref string) (string, error) {
// The special value "self" for a node reference is mapped to the current
// node, hence the node ID is retrieved using the `/info` endpoint.
// Reference returns the reference of a node. The special value "self" for a node
// reference is mapped to the current node, hence the node ID is retrieved using
// the `/info` endpoint.
func Reference(client apiclient.APIClient, ctx context.Context, ref string) (string, error) {
if ref == "self" {
info, err := client.Info(ctx)
if err != nil {

View file

@ -7,34 +7,26 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
func newDemoteCommand(dockerCli *client.DockerCli) *cobra.Command {
var flags *pflag.FlagSet
cmd := &cobra.Command{
return &cobra.Command{
Use: "demote NODE [NODE...]",
Short: "Demote a node from manager in the swarm",
Short: "Demote one or more nodes from manager in the swarm",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runDemote(dockerCli, flags, args)
return runDemote(dockerCli, args)
},
}
flags = cmd.Flags()
return cmd
}
func runDemote(dockerCli *client.DockerCli, flags *pflag.FlagSet, args []string) error {
for _, id := range args {
if err := runUpdate(dockerCli, id, func(node *swarm.Node) {
node.Spec.Role = swarm.NodeRoleWorker
}); err != nil {
return err
}
fmt.Println(id, "attempting to demote a manager in the swarm.")
func runDemote(dockerCli *client.DockerCli, nodes []string) error {
demote := func(node *swarm.Node) error {
node.Spec.Role = swarm.NodeRoleWorker
return nil
}
return nil
success := func(nodeID string) {
fmt.Fprintf(dockerCli.Out(), "Manager %s demoted in the swarm.\n", nodeID)
}
return updateNodes(dockerCli, nodes, demote, success)
}

View file

@ -27,7 +27,7 @@ func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "inspect [OPTIONS] self|NODE [NODE...]",
Short: "Inspect a node in the swarm",
Short: "Display detailed information on one or more nodes",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.nodeIds = args
@ -37,7 +37,7 @@ func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
flags := cmd.Flags()
flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given go template")
flags.BoolVarP(&opts.pretty, "pretty", "p", false, "Print the information in a human friendly format.")
flags.BoolVar(&opts.pretty, "pretty", false, "Print the information in a human friendly format.")
return cmd
}
@ -45,11 +45,11 @@ func runInspect(dockerCli *client.DockerCli, opts inspectOptions) error {
client := dockerCli.Client()
ctx := context.Background()
getRef := func(ref string) (interface{}, []byte, error) {
nodeRef, err := nodeReference(client, ctx, ref)
nodeRef, err := Reference(client, ctx, ref)
if err != nil {
return nil, nil, err
}
node, err := client.NodeInspect(ctx, nodeRef)
node, _, err := client.NodeInspectWithRaw(ctx, nodeRef)
return node, nil, err
}
@ -71,6 +71,8 @@ func printHumanFriendly(out io.Writer, refs []string, getRef inspect.GetRefFunc)
// print extra space between objects, but not after the last one
if idx+1 != len(refs) {
fmt.Fprintf(out, "\n\n")
} else {
fmt.Fprintf(out, "\n")
}
}
return nil
@ -88,6 +90,7 @@ func printNode(out io.Writer, node swarm.Node) {
}
ioutils.FprintfIfNotEmpty(out, "Hostname:\t\t%s\n", node.Description.Hostname)
fmt.Fprintf(out, "Joined at:\t\t%s\n", client.PrettyPrint(node.CreatedAt))
fmt.Fprintln(out, "Status:")
fmt.Fprintf(out, " State:\t\t\t%s\n", client.PrettyPrint(node.Status.State))
ioutils.FprintfIfNotEmpty(out, " Message:\t\t%s\n", client.PrettyPrint(node.Status.Message))
@ -96,7 +99,7 @@ func printNode(out io.Writer, node swarm.Node) {
if node.ManagerStatus != nil {
fmt.Fprintln(out, "Manager Status:")
fmt.Fprintf(out, " Address:\t\t%s\n", node.ManagerStatus.Addr)
fmt.Fprintf(out, " Raft status:\t\t%s\n", client.PrettyPrint(node.ManagerStatus.Reachability))
fmt.Fprintf(out, " Raft Status:\t\t%s\n", client.PrettyPrint(node.ManagerStatus.Reachability))
leader := "No"
if node.ManagerStatus.Leader {
leader = "Yes"
@ -134,8 +137,7 @@ func printNode(out io.Writer, node swarm.Node) {
if len(node.Description.Engine.Labels) != 0 {
fmt.Fprintln(out, "Engine Labels:")
for k, v := range node.Description.Engine.Labels {
fmt.Fprintf(out, " - %s = %s", k, v)
fmt.Fprintf(out, " - %s = %s\n", k, v)
}
}
}

View file

@ -16,7 +16,7 @@ import (
)
const (
listItemFmt = "%s\t%s\t%s\t%s\t%s\t%s\t%s\n"
listItemFmt = "%s\t%s\t%s\t%s\t%s\n"
)
type listOptions struct {
@ -28,7 +28,7 @@ func newListCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := listOptions{filter: opts.NewFilterOpt()}
cmd := &cobra.Command{
Use: "ls",
Use: "ls [OPTIONS]",
Aliases: []string{"list"},
Short: "List nodes in the swarm",
Args: cli.NoArgs,
@ -74,24 +74,18 @@ func printTable(out io.Writer, nodes []swarm.Node, info types.Info) {
// Ignore flushing errors
defer writer.Flush()
fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "MEMBERSHIP", "STATUS", "AVAILABILITY", "MANAGER STATUS", "LEADER")
fmt.Fprintf(writer, listItemFmt, "ID", "HOSTNAME", "STATUS", "AVAILABILITY", "MANAGER STATUS")
for _, node := range nodes {
name := node.Spec.Name
name := node.Description.Hostname
availability := string(node.Spec.Availability)
membership := string(node.Spec.Membership)
if name == "" {
name = node.Description.Hostname
}
leader := ""
if node.ManagerStatus != nil && node.ManagerStatus.Leader {
leader = "Yes"
}
reachability := ""
if node.ManagerStatus != nil {
reachability = string(node.ManagerStatus.Reachability)
if node.ManagerStatus.Leader {
reachability = "Leader"
} else {
reachability = string(node.ManagerStatus.Reachability)
}
}
ID := node.ID
@ -104,11 +98,9 @@ func printTable(out io.Writer, nodes []swarm.Node, info types.Info) {
listItemFmt,
ID,
name,
client.PrettyPrint(membership),
client.PrettyPrint(string(node.Status.State)),
client.PrettyPrint(availability),
client.PrettyPrint(reachability),
leader)
client.PrettyPrint(reachability))
}
}

View file

@ -4,18 +4,36 @@ import (
"fmt"
"strings"
"github.com/docker/docker/opts"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/engine-api/types/swarm"
)
type nodeOptions struct {
annotations
role string
membership string
availability string
}
type annotations struct {
name string
labels opts.ListOpts
}
func newNodeOptions() *nodeOptions {
return &nodeOptions{
annotations: annotations{
labels: opts.NewListOpts(nil),
},
}
}
func (opts *nodeOptions) ToNodeSpec() (swarm.NodeSpec, error) {
var spec swarm.NodeSpec
spec.Annotations.Name = opts.annotations.name
spec.Annotations.Labels = runconfigopts.ConvertKVStringsToMap(opts.annotations.labels.GetAll())
switch swarm.NodeRole(strings.ToLower(opts.role)) {
case swarm.NodeRoleWorker:
spec.Role = swarm.NodeRoleWorker
@ -26,14 +44,6 @@ func (opts *nodeOptions) ToNodeSpec() (swarm.NodeSpec, error) {
return swarm.NodeSpec{}, fmt.Errorf("invalid role %q, only worker and manager are supported", opts.role)
}
switch swarm.NodeMembership(strings.ToLower(opts.membership)) {
case swarm.NodeMembershipAccepted:
spec.Membership = swarm.NodeMembershipAccepted
case "":
default:
return swarm.NodeSpec{}, fmt.Errorf("invalid membership %q, only accepted is supported", opts.membership)
}
switch swarm.NodeAvailability(strings.ToLower(opts.availability)) {
case swarm.NodeAvailabilityActive:
spec.Availability = swarm.NodeAvailabilityActive

View file

@ -7,34 +7,26 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
func newPromoteCommand(dockerCli *client.DockerCli) *cobra.Command {
var flags *pflag.FlagSet
cmd := &cobra.Command{
return &cobra.Command{
Use: "promote NODE [NODE...]",
Short: "Promote a node to a manager in the swarm",
Short: "Promote one or more nodes to manager in the swarm",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runPromote(dockerCli, flags, args)
return runPromote(dockerCli, args)
},
}
flags = cmd.Flags()
return cmd
}
func runPromote(dockerCli *client.DockerCli, flags *pflag.FlagSet, args []string) error {
for _, id := range args {
if err := runUpdate(dockerCli, id, func(node *swarm.Node) {
node.Spec.Role = swarm.NodeRoleManager
}); err != nil {
return err
}
fmt.Println(id, "attempting to promote a node to a manager in the swarm.")
func runPromote(dockerCli *client.DockerCli, nodes []string) error {
promote := func(node *swarm.Node) error {
node.Spec.Role = swarm.NodeRoleManager
return nil
}
return nil
success := func(nodeID string) {
fmt.Fprintf(dockerCli.Out(), "Node %s promoted to a manager in the swarm.\n", nodeID)
}
return updateNodes(dockerCli, nodes, promote, success)
}

View file

@ -9,58 +9,49 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/opts"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/cobra"
)
type tasksOptions struct {
type psOptions struct {
nodeID string
all bool
noResolve bool
filter opts.FilterOpt
}
func newTasksCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := tasksOptions{filter: opts.NewFilterOpt()}
func newPSCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := psOptions{filter: opts.NewFilterOpt()}
cmd := &cobra.Command{
Use: "tasks [OPTIONS] self|NODE",
Use: "ps [OPTIONS] self|NODE",
Short: "List tasks running on a node",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.nodeID = args[0]
return runTasks(dockerCli, opts)
return runPS(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.all, "all", "a", false, "Display all instances")
flags.BoolVarP(&opts.noResolve, "no-resolve", "n", false, "Do not map IDs to Names")
flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
return cmd
}
func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
func runPS(dockerCli *client.DockerCli, opts psOptions) error {
client := dockerCli.Client()
ctx := context.Background()
nodeRef, err := nodeReference(client, ctx, opts.nodeID)
nodeRef, err := Reference(client, ctx, opts.nodeID)
if err != nil {
return nil
}
node, err := client.NodeInspect(ctx, nodeRef)
node, _, err := client.NodeInspectWithRaw(ctx, nodeRef)
if err != nil {
return err
}
filter := opts.filter.Value()
filter.Add("node", node.ID)
if !opts.all {
filter.Add("desired_state", string(swarm.TaskStateRunning))
filter.Add("desired_state", string(swarm.TaskStateAccepted))
}
tasks, err := client.TaskList(
ctx,
types.TaskListOptions{Filter: filter})

View file

@ -7,26 +7,36 @@ import (
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
func newRemoveCommand(dockerCli *client.DockerCli) *cobra.Command {
return &cobra.Command{
Use: "rm NODE [NODE...]",
Aliases: []string{"remove"},
Short: "Remove a node from the swarm",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runRemove(dockerCli, args)
},
}
type removeOptions struct {
force bool
}
func runRemove(dockerCli *client.DockerCli, args []string) error {
func newRemoveCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := removeOptions{}
cmd := &cobra.Command{
Use: "rm [OPTIONS] NODE [NODE...]",
Aliases: []string{"remove"},
Short: "Remove one or more nodes from the swarm",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runRemove(dockerCli, args, opts)
},
}
flags := cmd.Flags()
flags.BoolVar(&opts.force, "force", false, "Force remove an active node")
return cmd
}
func runRemove(dockerCli *client.DockerCli, args []string, opts removeOptions) error {
client := dockerCli.Client()
ctx := context.Background()
for _, nodeID := range args {
err := client.NodeRemove(ctx, nodeID)
err := client.NodeRemove(ctx, nodeID, types.NodeRemoveOptions{Force: opts.force})
if err != nil {
return err
}

View file

@ -5,6 +5,7 @@ import (
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/opts"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/cobra"
@ -13,88 +14,100 @@ import (
)
func newUpdateCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts nodeOptions
var flags *pflag.FlagSet
nodeOpts := newNodeOptions()
cmd := &cobra.Command{
Use: "update [OPTIONS] NODE",
Short: "Update a node",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runUpdate(dockerCli, args[0], mergeNodeUpdate(flags))
return runUpdate(dockerCli, cmd.Flags(), args[0])
},
}
flags = cmd.Flags()
flags.StringVar(&opts.role, "role", "", "Role of the node (worker/manager)")
flags.StringVar(&opts.membership, "membership", "", "Membership of the node (accepted/rejected)")
flags.StringVar(&opts.availability, "availability", "", "Availability of the node (active/pause/drain)")
flags := cmd.Flags()
flags.StringVar(&nodeOpts.role, flagRole, "", "Role of the node (worker/manager)")
flags.StringVar(&nodeOpts.availability, flagAvailability, "", "Availability of the node (active/pause/drain)")
flags.Var(&nodeOpts.annotations.labels, flagLabelAdd, "Add or update a node label (key=value)")
labelKeys := opts.NewListOpts(nil)
flags.Var(&labelKeys, flagLabelRemove, "Remove a node label if exists")
return cmd
}
func runUpdate(dockerCli *client.DockerCli, nodeID string, mergeNode func(node *swarm.Node)) error {
func runUpdate(dockerCli *client.DockerCli, flags *pflag.FlagSet, nodeID string) error {
success := func(_ string) {
fmt.Fprintln(dockerCli.Out(), nodeID)
}
return updateNodes(dockerCli, []string{nodeID}, mergeNodeUpdate(flags), success)
}
func updateNodes(dockerCli *client.DockerCli, nodes []string, mergeNode func(node *swarm.Node) error, success func(nodeID string)) error {
client := dockerCli.Client()
ctx := context.Background()
node, err := client.NodeInspect(ctx, nodeID)
if err != nil {
return err
}
for _, nodeID := range nodes {
node, _, err := client.NodeInspectWithRaw(ctx, nodeID)
if err != nil {
return err
}
mergeNode(&node)
err = client.NodeUpdate(ctx, node.ID, node.Version, node.Spec)
if err != nil {
return err
err = mergeNode(&node)
if err != nil {
return err
}
err = client.NodeUpdate(ctx, node.ID, node.Version, node.Spec)
if err != nil {
return err
}
success(nodeID)
}
fmt.Fprintf(dockerCli.Out(), "%s\n", nodeID)
return nil
}
func mergeNodeUpdate(flags *pflag.FlagSet) func(*swarm.Node) {
return func(node *swarm.Node) {
mergeString := func(flag string, field *string) {
if flags.Changed(flag) {
*field, _ = flags.GetString(flag)
}
}
mergeRole := func(flag string, field *swarm.NodeRole) {
if flags.Changed(flag) {
str, _ := flags.GetString(flag)
*field = swarm.NodeRole(str)
}
}
mergeMembership := func(flag string, field *swarm.NodeMembership) {
if flags.Changed(flag) {
str, _ := flags.GetString(flag)
*field = swarm.NodeMembership(str)
}
}
mergeAvailability := func(flag string, field *swarm.NodeAvailability) {
if flags.Changed(flag) {
str, _ := flags.GetString(flag)
*field = swarm.NodeAvailability(str)
}
}
mergeLabels := func(flag string, field *map[string]string) {
if flags.Changed(flag) {
values, _ := flags.GetStringSlice(flag)
for key, value := range runconfigopts.ConvertKVStringsToMap(values) {
(*field)[key] = value
}
}
}
func mergeNodeUpdate(flags *pflag.FlagSet) func(*swarm.Node) error {
return func(node *swarm.Node) error {
spec := &node.Spec
mergeString("name", &spec.Name)
// TODO: setting labels is not working
mergeLabels("label", &spec.Labels)
mergeRole("role", &spec.Role)
mergeMembership("membership", &spec.Membership)
mergeAvailability("availability", &spec.Availability)
if flags.Changed(flagRole) {
str, err := flags.GetString(flagRole)
if err != nil {
return err
}
spec.Role = swarm.NodeRole(str)
}
if flags.Changed(flagAvailability) {
str, err := flags.GetString(flagAvailability)
if err != nil {
return err
}
spec.Availability = swarm.NodeAvailability(str)
}
if spec.Annotations.Labels == nil {
spec.Annotations.Labels = make(map[string]string)
}
if flags.Changed(flagLabelAdd) {
labels := flags.Lookup(flagLabelAdd).Value.(*opts.ListOpts).GetAll()
for k, v := range runconfigopts.ConvertKVStringsToMap(labels) {
spec.Annotations.Labels[k] = v
}
}
if flags.Changed(flagLabelRemove) {
keys := flags.Lookup(flagLabelRemove).Value.(*opts.ListOpts).GetAll()
for _, k := range keys {
// if a key doesn't exist, fail the command explicitly
if _, exists := spec.Annotations.Labels[k]; !exists {
return fmt.Errorf("key %s doesn't exist in node's labels", k)
}
delete(spec.Annotations.Labels, k)
}
}
return nil
}
}
const (
flagRole = "role"
flagAvailability = "availability"
flagLabelAdd = "label-add"
flagLabelRemove = "label-rm"
)

View file

@ -3,21 +3,43 @@
package plugin
import (
"fmt"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/reference"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
func newDisableCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "disable",
Use: "disable PLUGIN",
Short: "Disable a plugin",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return dockerCli.Client().PluginDisable(context.Background(), args[0])
return runDisable(dockerCli, args[0])
},
}
return cmd
}
func runDisable(dockerCli *client.DockerCli, name string) error {
named, err := reference.ParseNamed(name) // FIXME: validate
if err != nil {
return err
}
if reference.IsNameOnly(named) {
named = reference.WithDefaultTag(named)
}
ref, ok := named.(reference.NamedTagged)
if !ok {
return fmt.Errorf("invalid name: %s", named.String())
}
if err := dockerCli.Client().PluginDisable(context.Background(), ref.String()); err != nil {
return err
}
fmt.Fprintln(dockerCli.Out(), name)
return nil
}

View file

@ -3,21 +3,43 @@
package plugin
import (
"fmt"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/reference"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
func newEnableCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "enable",
Use: "enable PLUGIN",
Short: "Enable a plugin",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return dockerCli.Client().PluginEnable(context.Background(), args[0])
return runEnable(dockerCli, args[0])
},
}
return cmd
}
func runEnable(dockerCli *client.DockerCli, name string) error {
named, err := reference.ParseNamed(name) // FIXME: validate
if err != nil {
return err
}
if reference.IsNameOnly(named) {
named = reference.WithDefaultTag(named)
}
ref, ok := named.(reference.NamedTagged)
if !ok {
return fmt.Errorf("invalid name: %s", named.String())
}
if err := dockerCli.Client().PluginEnable(context.Background(), ref.String()); err != nil {
return err
}
fmt.Fprintln(dockerCli.Out(), name)
return nil
}

View file

@ -4,16 +4,18 @@ package plugin
import (
"encoding/json"
"fmt"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/reference"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "inspect",
Use: "inspect PLUGIN",
Short: "Inspect a plugin",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
@ -25,7 +27,18 @@ func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
}
func runInspect(dockerCli *client.DockerCli, name string) error {
p, err := dockerCli.Client().PluginInspect(context.Background(), name)
named, err := reference.ParseNamed(name) // FIXME: validate
if err != nil {
return err
}
if reference.IsNameOnly(named) {
named = reference.WithDefaultTag(named)
}
ref, ok := named.(reference.NamedTagged)
if !ok {
return fmt.Errorf("invalid name: %s", named.String())
}
p, err := dockerCli.Client().PluginInspect(context.Background(), ref.String())
if err != nil {
return err
}

View file

@ -3,35 +3,52 @@
package plugin
import (
"bufio"
"fmt"
"strings"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/reference"
"github.com/docker/docker/registry"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
type pluginOptions struct {
name string
grantPerms bool
disable bool
}
func newInstallCommand(dockerCli *client.DockerCli) *cobra.Command {
var options pluginOptions
cmd := &cobra.Command{
Use: "install",
Use: "install [OPTIONS] PLUGIN",
Short: "Install a plugin",
Args: cli.RequiresMinArgs(1), // TODO: allow for set args
Args: cli.ExactArgs(1), // TODO: allow for set args
RunE: func(cmd *cobra.Command, args []string) error {
return runInstall(dockerCli, args[0], args[1:])
options.name = args[0]
return runInstall(dockerCli, options)
},
}
flags := cmd.Flags()
flags.BoolVar(&options.grantPerms, "grant-all-permissions", false, "grant all permissions necessary to run the plugin")
flags.BoolVar(&options.disable, "disable", false, "do not enable the plugin on install")
return cmd
}
func runInstall(dockerCli *client.DockerCli, name string, args []string) error {
named, err := reference.ParseNamed(name) // FIXME: validate
func runInstall(dockerCli *client.DockerCli, opts pluginOptions) error {
named, err := reference.ParseNamed(opts.name) // FIXME: validate
if err != nil {
return err
}
named = reference.WithDefaultTag(named)
if reference.IsNameOnly(named) {
named = reference.WithDefaultTag(named)
}
ref, ok := named.(reference.NamedTagged)
if !ok {
return fmt.Errorf("invalid name: %s", named.String())
@ -40,12 +57,47 @@ func runInstall(dockerCli *client.DockerCli, name string, args []string) error {
ctx := context.Background()
repoInfo, err := registry.ParseRepositoryInfo(named)
if err != nil {
return err
}
authConfig := dockerCli.ResolveAuthConfig(ctx, repoInfo.Index)
encodedAuth, err := client.EncodeAuthToBase64(authConfig)
if err != nil {
return err
}
// TODO: pass acceptAllPermissions and noEnable flag
return dockerCli.Client().PluginInstall(ctx, ref.String(), encodedAuth, false, false, dockerCli.In(), dockerCli.Out())
registryAuthFunc := dockerCli.RegistryAuthenticationPrivilegedFunc(repoInfo.Index, "plugin install")
options := types.PluginInstallOptions{
RegistryAuth: encodedAuth,
Disabled: opts.disable,
AcceptAllPermissions: opts.grantPerms,
AcceptPermissionsFunc: acceptPrivileges(dockerCli, opts.name),
// TODO: Rename PrivilegeFunc, it has nothing to do with privileges
PrivilegeFunc: registryAuthFunc,
}
if err := dockerCli.Client().PluginInstall(ctx, ref.String(), options); err != nil {
return err
}
fmt.Fprintln(dockerCli.Out(), opts.name)
return nil
}
func acceptPrivileges(dockerCli *client.DockerCli, name string) func(privileges types.PluginPrivileges) (bool, error) {
return func(privileges types.PluginPrivileges) (bool, error) {
fmt.Fprintf(dockerCli.Out(), "Plugin %q is requesting the following privileges:\n", name)
for _, privilege := range privileges {
fmt.Fprintf(dockerCli.Out(), " - %s: %v\n", privilege.Name, privilege.Value)
}
fmt.Fprint(dockerCli.Out(), "Do you grant the above permissions? [y/N] ")
reader := bufio.NewReader(dockerCli.In())
line, _, err := reader.ReadLine()
if err != nil {
return false, err
}
return strings.ToLower(string(line)) == "y", nil
}
}

View file

@ -17,7 +17,7 @@ func newListCommand(dockerCli *client.DockerCli) *cobra.Command {
Use: "ls",
Short: "List plugins",
Aliases: []string{"list"},
Args: cli.ExactArgs(0),
Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return runList(dockerCli)
},

View file

@ -16,7 +16,7 @@ import (
func newPushCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "push",
Use: "push PLUGIN",
Short: "Push a plugin",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
@ -31,7 +31,9 @@ func runPush(dockerCli *client.DockerCli, name string) error {
if err != nil {
return err
}
named = reference.WithDefaultTag(named)
if reference.IsNameOnly(named) {
named = reference.WithDefaultTag(named)
}
ref, ok := named.(reference.NamedTagged)
if !ok {
return fmt.Errorf("invalid name: %s", named.String())
@ -40,6 +42,9 @@ func runPush(dockerCli *client.DockerCli, name string) error {
ctx := context.Background()
repoInfo, err := registry.ParseRepositoryInfo(named)
if err != nil {
return err
}
authConfig := dockerCli.ResolveAuthConfig(ctx, repoInfo.Index)
encodedAuth, err := client.EncodeAuthToBase64(authConfig)

View file

@ -7,16 +7,17 @@ import (
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/reference"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
func newRemoveCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "rm",
Use: "rm PLUGIN",
Short: "Remove a plugin",
Aliases: []string{"remove"},
Args: cli.RequiresMinArgs(1),
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runRemove(dockerCli, args)
},
@ -28,8 +29,19 @@ func newRemoveCommand(dockerCli *client.DockerCli) *cobra.Command {
func runRemove(dockerCli *client.DockerCli, names []string) error {
var errs cli.Errors
for _, name := range names {
named, err := reference.ParseNamed(name) // FIXME: validate
if err != nil {
return err
}
if reference.IsNameOnly(named) {
named = reference.WithDefaultTag(named)
}
ref, ok := named.(reference.NamedTagged)
if !ok {
return fmt.Errorf("invalid name: %s", named.String())
}
// TODO: pass names to api instead of making multiple api calls
if err := dockerCli.Client().PluginRemove(context.Background(), name); err != nil {
if err := dockerCli.Client().PluginRemove(context.Background(), ref.String()); err != nil {
errs = append(errs, err)
continue
}

View file

@ -3,16 +3,19 @@
package plugin
import (
"fmt"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/reference"
"github.com/spf13/cobra"
)
func newSetCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "set",
Use: "set PLUGIN key1=value1 [key2=value2...]",
Short: "Change settings for a plugin",
Args: cli.RequiresMinArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
@ -24,5 +27,16 @@ func newSetCommand(dockerCli *client.DockerCli) *cobra.Command {
}
func runSet(dockerCli *client.DockerCli, name string, args []string) error {
return dockerCli.Client().PluginSet(context.Background(), name, args)
named, err := reference.ParseNamed(name) // FIXME: validate
if err != nil {
return err
}
if reference.IsNameOnly(named) {
named = reference.WithDefaultTag(named)
}
ref, ok := named.(reference.NamedTagged)
if !ok {
return fmt.Errorf("invalid name: %s", named.String())
}
return dockerCli.Client().PluginSet(context.Background(), ref.String(), args)
}

View file

@ -13,6 +13,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/docker/pkg/term"
"github.com/docker/docker/reference"
"github.com/docker/docker/registry"
"github.com/docker/engine-api/types"
registrytypes "github.com/docker/engine-api/types/registry"
@ -42,7 +43,7 @@ func EncodeAuthToBase64(authConfig types.AuthConfig) (string, error) {
return base64.URLEncoding.EncodeToString(buf), nil
}
// RegistryAuthenticationPrivilegedFunc return a RequestPrivilegeFunc from the specified registry index info
// RegistryAuthenticationPrivilegedFunc returns a RequestPrivilegeFunc from the specified registry index info
// for the given command.
func (cli *DockerCli) RegistryAuthenticationPrivilegedFunc(index *registrytypes.IndexInfo, cmdName string) types.RequestPrivilegeFunc {
return func() (string, error) {
@ -103,14 +104,14 @@ func (cli *DockerCli) ConfigureAuth(flUser, flPassword, serverAddress string, is
// will hit this if you attempt docker login from mintty where stdin
// is a pipe, not a character based console.
if flPassword == "" && !cli.isTerminalIn {
return authconfig, fmt.Errorf("Error: Cannot perform an interactive logon from a non TTY device")
return authconfig, fmt.Errorf("Error: Cannot perform an interactive login from a non TTY device")
}
authconfig.Username = strings.TrimSpace(authconfig.Username)
if flUser = strings.TrimSpace(flUser); flUser == "" {
if isDefaultRegistry {
// if this is a defauly registry (docker hub), then display the following message.
// if this is a default registry (docker hub), then display the following message.
fmt.Fprintln(cli.out, "Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.")
}
cli.promptWithDefault("Username", authconfig.Username)
@ -148,6 +149,34 @@ func (cli *DockerCli) ConfigureAuth(flUser, flPassword, serverAddress string, is
return authconfig, nil
}
// resolveAuthConfigFromImage retrieves that AuthConfig using the image string
func (cli *DockerCli) resolveAuthConfigFromImage(ctx context.Context, image string) (types.AuthConfig, error) {
registryRef, err := reference.ParseNamed(image)
if err != nil {
return types.AuthConfig{}, err
}
repoInfo, err := registry.ParseRepositoryInfo(registryRef)
if err != nil {
return types.AuthConfig{}, err
}
authConfig := cli.ResolveAuthConfig(ctx, repoInfo.Index)
return authConfig, nil
}
// RetrieveAuthTokenFromImage retrieves an encoded auth token given a complete image
func (cli *DockerCli) RetrieveAuthTokenFromImage(ctx context.Context, image string) (string, error) {
// Retrieve encoded auth token from the image reference
authConfig, err := cli.resolveAuthConfigFromImage(ctx, image)
if err != nil {
return "", err
}
encodedAuth, err := EncodeAuthToBase64(authConfig)
if err != nil {
return "", err
}
return encodedAuth, nil
}
func readInput(in io.Reader, out io.Writer) string {
reader := bufio.NewReader(in)
line, _, err := reader.ReadLine()

View file

@ -45,7 +45,7 @@ func runLogout(dockerCli *client.DockerCli, serverAddress string) error {
fmt.Fprintf(dockerCli.Out(), "Remove login credentials for %s\n", serverAddress)
if err := client.EraseCredentials(dockerCli.ConfigFile(), serverAddress); err != nil {
fmt.Fprintf(dockerCli.Out(), "WARNING: could not erase credentials: %v\n", err)
fmt.Fprintf(dockerCli.Err(), "WARNING: could not erase credentials: %v\n", err)
}
return nil

View file

@ -22,7 +22,7 @@ func NewServiceCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd.AddCommand(
newCreateCommand(dockerCli),
newInspectCommand(dockerCli),
newTasksCommand(dockerCli),
newPSCommand(dockerCli),
newListCommand(dockerCli),
newRemoveCommand(dockerCli),
newScaleCommand(dockerCli),

View file

@ -5,6 +5,7 @@ import (
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
@ -24,20 +25,44 @@ func newCreateCommand(dockerCli *client.DockerCli) *cobra.Command {
return runCreate(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.StringVar(&opts.mode, flagMode, "replicated", "Service mode (replicated or global)")
addServiceFlags(cmd, opts)
cmd.Flags().SetInterspersed(false)
flags.VarP(&opts.labels, flagLabel, "l", "Service labels")
flags.Var(&opts.containerLabels, flagContainerLabel, "Container labels")
flags.VarP(&opts.env, flagEnv, "e", "Set environment variables")
flags.Var(&opts.mounts, flagMount, "Attach a mount to the service")
flags.StringSliceVar(&opts.constraints, flagConstraint, []string{}, "Placement constraints")
flags.StringSliceVar(&opts.networks, flagNetwork, []string{}, "Network attachments")
flags.VarP(&opts.endpoint.ports, flagPublish, "p", "Publish a port as a node port")
flags.SetInterspersed(false)
return cmd
}
func runCreate(dockerCli *client.DockerCli, opts *serviceOptions) error {
client := dockerCli.Client()
apiClient := dockerCli.Client()
createOpts := types.ServiceCreateOptions{}
service, err := opts.ToService()
if err != nil {
return err
}
response, err := client.ServiceCreate(context.Background(), service)
ctx := context.Background()
// only send auth if flag was set
if opts.registryAuth {
// Retrieve encoded auth token from the image reference
encodedAuth, err := dockerCli.RetrieveAuthTokenFromImage(ctx, opts.image)
if err != nil {
return err
}
createOpts.EncodedRegistryAuth = encodedAuth
}
response, err := apiClient.ServiceCreate(ctx, service, createOpts)
if err != nil {
return err
}

View file

@ -4,6 +4,7 @@ import (
"fmt"
"io"
"strings"
"time"
"golang.org/x/net/context"
@ -13,6 +14,7 @@ import (
"github.com/docker/docker/pkg/ioutils"
apiclient "github.com/docker/engine-api/client"
"github.com/docker/engine-api/types/swarm"
"github.com/docker/go-units"
"github.com/spf13/cobra"
)
@ -27,7 +29,7 @@ func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "inspect [OPTIONS] SERVICE [SERVICE...]",
Short: "Inspect a service",
Short: "Display detailed information on one or more services",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.refs = args
@ -41,7 +43,7 @@ func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
flags := cmd.Flags()
flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given go template")
flags.BoolVarP(&opts.pretty, "pretty", "p", false, "Print the information in a human friendly format.")
flags.BoolVar(&opts.pretty, "pretty", false, "Print the information in a human friendly format.")
return cmd
}
@ -50,7 +52,7 @@ func runInspect(dockerCli *client.DockerCli, opts inspectOptions) error {
ctx := context.Background()
getRef := func(ref string) (interface{}, []byte, error) {
service, err := client.ServiceInspect(ctx, ref)
service, _, err := client.ServiceInspectWithRaw(ctx, ref)
if err == nil || !apiclient.IsErrServiceNotFound(err) {
return service, nil, err
}
@ -93,35 +95,94 @@ func printService(out io.Writer, service swarm.Service) {
}
if service.Spec.Mode.Global != nil {
fmt.Fprintln(out, "Mode:\t\tGLOBAL")
fmt.Fprintln(out, "Mode:\t\tGlobal")
} else {
fmt.Fprintln(out, "Mode:\t\tREPLICATED")
fmt.Fprintln(out, "Mode:\t\tReplicated")
if service.Spec.Mode.Replicated.Replicas != nil {
fmt.Fprintf(out, " Replicas:\t\t%d\n", *service.Spec.Mode.Replicated.Replicas)
fmt.Fprintf(out, " Replicas:\t%d\n", *service.Spec.Mode.Replicated.Replicas)
}
}
fmt.Fprintln(out, "Placement:")
fmt.Fprintln(out, " Strategy:\tSPREAD")
fmt.Fprintf(out, "UpateConfig:\n")
fmt.Fprintf(out, " Parallelism:\t%d\n", service.Spec.UpdateConfig.Parallelism)
if service.Spec.UpdateConfig.Delay.Nanoseconds() > 0 {
fmt.Fprintf(out, " Delay:\t\t%s\n", service.Spec.UpdateConfig.Delay)
if service.UpdateStatus.State != "" {
fmt.Fprintln(out, "Update status:")
fmt.Fprintf(out, " State:\t\t%s\n", service.UpdateStatus.State)
fmt.Fprintf(out, " Started:\t%s ago\n", strings.ToLower(units.HumanDuration(time.Since(service.UpdateStatus.StartedAt))))
if service.UpdateStatus.State == swarm.UpdateStateCompleted {
fmt.Fprintf(out, " Completed:\t%s ago\n", strings.ToLower(units.HumanDuration(time.Since(service.UpdateStatus.CompletedAt))))
}
fmt.Fprintf(out, " Message:\t%s\n", service.UpdateStatus.Message)
}
fmt.Fprintln(out, "Placement:")
if service.Spec.TaskTemplate.Placement != nil && len(service.Spec.TaskTemplate.Placement.Constraints) > 0 {
ioutils.FprintfIfNotEmpty(out, " Constraints\t: %s\n", strings.Join(service.Spec.TaskTemplate.Placement.Constraints, ", "))
}
if service.Spec.UpdateConfig != nil {
fmt.Fprintf(out, "UpdateConfig:\n")
fmt.Fprintf(out, " Parallelism:\t%d\n", service.Spec.UpdateConfig.Parallelism)
if service.Spec.UpdateConfig.Delay.Nanoseconds() > 0 {
fmt.Fprintf(out, " Delay:\t\t%s\n", service.Spec.UpdateConfig.Delay)
}
fmt.Fprintf(out, " On failure:\t%s\n", service.Spec.UpdateConfig.FailureAction)
}
fmt.Fprintf(out, "ContainerSpec:\n")
printContainerSpec(out, service.Spec.TaskTemplate.ContainerSpec)
resources := service.Spec.TaskTemplate.Resources
if resources != nil {
fmt.Fprintln(out, "Resources:")
printResources := func(out io.Writer, requirement string, r *swarm.Resources) {
if r == nil || (r.MemoryBytes == 0 && r.NanoCPUs == 0) {
return
}
fmt.Fprintf(out, " %s:\n", requirement)
if r.NanoCPUs != 0 {
fmt.Fprintf(out, " CPU:\t\t%g\n", float64(r.NanoCPUs)/1e9)
}
if r.MemoryBytes != 0 {
fmt.Fprintf(out, " Memory:\t%s\n", units.BytesSize(float64(r.MemoryBytes)))
}
}
printResources(out, "Reservations", resources.Reservations)
printResources(out, "Limits", resources.Limits)
}
if len(service.Spec.Networks) > 0 {
fmt.Fprintf(out, "Networks:")
for _, n := range service.Spec.Networks {
fmt.Fprintf(out, " %s", n.Target)
}
fmt.Fprintln(out, "")
}
if len(service.Endpoint.Ports) > 0 {
fmt.Fprintln(out, "Ports:")
for _, port := range service.Endpoint.Ports {
ioutils.FprintfIfNotEmpty(out, " Name = %s\n", port.Name)
fmt.Fprintf(out, " Protocol = %s\n", port.Protocol)
fmt.Fprintf(out, " TargetPort = %d\n", port.TargetPort)
fmt.Fprintf(out, " PublishedPort = %d\n", port.PublishedPort)
}
}
}
func printContainerSpec(out io.Writer, containerSpec swarm.ContainerSpec) {
fmt.Fprintf(out, " Image:\t\t%s\n", containerSpec.Image)
if len(containerSpec.Command) > 0 {
fmt.Fprintf(out, " Command:\t%s\n", strings.Join(containerSpec.Command, " "))
}
if len(containerSpec.Args) > 0 {
fmt.Fprintf(out, " Args:\t%s\n", strings.Join(containerSpec.Args, " "))
fmt.Fprintf(out, " Args:\t\t%s\n", strings.Join(containerSpec.Args, " "))
}
if len(containerSpec.Env) > 0 {
fmt.Fprintf(out, " Env:\t\t%s\n", strings.Join(containerSpec.Env, " "))
}
ioutils.FprintfIfNotEmpty(out, " Dir\t\t%s\n", containerSpec.Dir)
ioutils.FprintfIfNotEmpty(out, " User\t\t%s\n", containerSpec.User)
if len(containerSpec.Mounts) > 0 {
fmt.Fprintln(out, " Mounts:")
for _, v := range containerSpec.Mounts {
fmt.Fprintf(out, " Target = %s\n", v.Target)
fmt.Fprintf(out, " Source = %s\n", v.Source)
fmt.Fprintf(out, " ReadOnly = %v\n", v.ReadOnly)
fmt.Fprintf(out, " Type = %v\n", v.Type)
}
}
}

View file

@ -0,0 +1,84 @@
package service
import (
"bytes"
"strings"
"testing"
"time"
"github.com/docker/engine-api/types/swarm"
)
func TestPrettyPrintWithNoUpdateConfig(t *testing.T) {
b := new(bytes.Buffer)
endpointSpec := &swarm.EndpointSpec{
Mode: "vip",
Ports: []swarm.PortConfig{
{
Protocol: swarm.PortConfigProtocolTCP,
TargetPort: 5000,
},
},
}
two := uint64(2)
s := swarm.Service{
ID: "de179gar9d0o7ltdybungplod",
Meta: swarm.Meta{
Version: swarm.Version{Index: 315},
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
},
Spec: swarm.ServiceSpec{
Annotations: swarm.Annotations{
Name: "my_service",
Labels: map[string]string{"com.label": "foo"},
},
TaskTemplate: swarm.TaskSpec{
ContainerSpec: swarm.ContainerSpec{
Image: "foo/bar@sha256:this_is_a_test",
},
},
Mode: swarm.ServiceMode{
Replicated: &swarm.ReplicatedService{
Replicas: &two,
},
},
UpdateConfig: nil,
Networks: []swarm.NetworkAttachmentConfig{
{
Target: "5vpyomhb6ievnk0i0o60gcnei",
Aliases: []string{"web"},
},
},
EndpointSpec: endpointSpec,
},
Endpoint: swarm.Endpoint{
Spec: *endpointSpec,
Ports: []swarm.PortConfig{
{
Protocol: swarm.PortConfigProtocolTCP,
TargetPort: 5000,
PublishedPort: 30000,
},
},
VirtualIPs: []swarm.EndpointVirtualIP{
{
NetworkID: "6o4107cj2jx9tihgb0jyts6pj",
Addr: "10.255.0.4/16",
},
},
},
UpdateStatus: swarm.UpdateStatus{
StartedAt: time.Now(),
CompletedAt: time.Now(),
},
}
printService(b, s)
if strings.Contains(b.String(), "UpdateStatus") {
t.Fatal("Pretty print failed before parsing UpdateStatus")
}
}

View file

@ -6,15 +6,15 @@ import (
"strings"
"text/tabwriter"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
const (
@ -30,7 +30,7 @@ func newListCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := listOptions{filter: opts.NewFilterOpt()}
cmd := &cobra.Command{
Use: "ls",
Use: "ls [OPTIONS]",
Aliases: []string{"list"},
Short: "List services",
Args: cli.NoArgs,
@ -47,11 +47,10 @@ func newListCommand(dockerCli *client.DockerCli) *cobra.Command {
}
func runList(dockerCli *client.DockerCli, opts listOptions) error {
ctx := context.Background()
client := dockerCli.Client()
services, err := client.ServiceList(
context.Background(),
types.ServiceListOptions{Filter: opts.filter.Value()})
services, err := client.ServiceList(ctx, types.ServiceListOptions{Filter: opts.filter.Value()})
if err != nil {
return err
}
@ -60,31 +59,59 @@ func runList(dockerCli *client.DockerCli, opts listOptions) error {
if opts.quiet {
printQuiet(out, services)
} else {
printTable(out, services)
taskFilter := filters.NewArgs()
for _, service := range services {
taskFilter.Add("service", service.ID)
}
tasks, err := client.TaskList(ctx, types.TaskListOptions{Filter: taskFilter})
if err != nil {
return err
}
nodes, err := client.NodeList(ctx, types.NodeListOptions{})
if err != nil {
return err
}
activeNodes := make(map[string]struct{})
for _, n := range nodes {
if n.Status.State == swarm.NodeStateReady {
activeNodes[n.ID] = struct{}{}
}
}
running := map[string]int{}
for _, task := range tasks {
if _, nodeActive := activeNodes[task.NodeID]; nodeActive && task.Status.State == "running" {
running[task.ServiceID]++
}
}
printTable(out, services, running)
}
return nil
}
func printTable(out io.Writer, services []swarm.Service) {
func printTable(out io.Writer, services []swarm.Service, running map[string]int) {
writer := tabwriter.NewWriter(out, 0, 4, 2, ' ', 0)
// Ignore flushing errors
defer writer.Flush()
fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "SCALE", "IMAGE", "COMMAND")
fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "REPLICAS", "IMAGE", "COMMAND")
for _, service := range services {
scale := ""
replicas := ""
if service.Spec.Mode.Replicated != nil && service.Spec.Mode.Replicated.Replicas != nil {
scale = fmt.Sprintf("%d", *service.Spec.Mode.Replicated.Replicas)
replicas = fmt.Sprintf("%d/%d", running[service.ID], *service.Spec.Mode.Replicated.Replicas)
} else if service.Spec.Mode.Global != nil {
scale = "global"
replicas = "global"
}
fmt.Fprintf(
writer,
listItemFmt,
stringid.TruncateID(service.ID),
service.Spec.Name,
scale,
replicas,
service.Spec.TaskTemplate.ContainerSpec.Image,
strings.Join(service.Spec.TaskTemplate.ContainerSpec.Args, " "))
}

View file

@ -16,11 +16,6 @@ import (
"github.com/spf13/cobra"
)
var (
// DefaultReplicas is the default replicas to use for a replicated service
DefaultReplicas uint64 = 1
)
type int64Value interface {
Value() int64
}
@ -28,7 +23,7 @@ type int64Value interface {
type memBytes int64
func (m *memBytes) String() string {
return strconv.FormatInt(m.Value(), 10)
return units.BytesSize(float64(m.Value()))
}
func (m *memBytes) Set(value string) error {
@ -48,7 +43,7 @@ func (m *memBytes) Value() int64 {
type nanoCPUs int64
func (c *nanoCPUs) String() string {
return strconv.FormatInt(c.Value(), 10)
return big.NewRat(c.Value(), 1e9).FloatString(3)
}
func (c *nanoCPUs) Set(value string) error {
@ -160,6 +155,13 @@ func (m *MountOpt) Set(value string) error {
return mount.VolumeOptions
}
bindOptions := func() *swarm.BindOptions {
if mount.BindOptions == nil {
mount.BindOptions = new(swarm.BindOptions)
}
return mount.BindOptions
}
setValueOnMap := func(target map[string]string, value string) {
parts := strings.SplitN(value, "=", 2)
if len(parts) == 1 {
@ -169,48 +171,58 @@ func (m *MountOpt) Set(value string) error {
}
}
mount.Type = swarm.MountTypeVolume // default to volume mounts
// Set writable as the default
for _, field := range fields {
parts := strings.SplitN(field, "=", 2)
if len(parts) == 1 && strings.ToLower(parts[0]) == "writable" {
mount.Writable = true
continue
key := strings.ToLower(parts[0])
if len(parts) == 1 {
switch key {
case "readonly", "ro":
mount.ReadOnly = true
continue
case "volume-nocopy":
volumeOptions().NoCopy = true
continue
}
}
if len(parts) != 2 {
return fmt.Errorf("invald field '%s' must be a key=value pair", field)
return fmt.Errorf("invalid field '%s' must be a key=value pair", field)
}
key, value := parts[0], parts[1]
switch strings.ToLower(key) {
value := parts[1]
switch key {
case "type":
mount.Type = swarm.MountType(strings.ToUpper(value))
case "source":
mount.Type = swarm.MountType(strings.ToLower(value))
case "source", "src":
mount.Source = value
case "target":
case "target", "dst", "destination":
mount.Target = value
case "writable":
mount.Writable, err = strconv.ParseBool(value)
case "readonly", "ro":
mount.ReadOnly, err = strconv.ParseBool(value)
if err != nil {
return fmt.Errorf("invald value for writable: %s", err.Error())
return fmt.Errorf("invalid value for %s: %s", key, value)
}
case "bind-propagation":
mount.BindOptions.Propagation = swarm.MountPropagation(strings.ToUpper(value))
case "volume-populate":
volumeOptions().Populate, err = strconv.ParseBool(value)
bindOptions().Propagation = swarm.MountPropagation(strings.ToLower(value))
case "volume-nocopy":
volumeOptions().NoCopy, err = strconv.ParseBool(value)
if err != nil {
return fmt.Errorf("invald value for populate: %s", err.Error())
return fmt.Errorf("invalid value for populate: %s", value)
}
case "volume-label":
setValueOnMap(volumeOptions().Labels, value)
case "volume-driver":
volumeOptions().DriverConfig.Name = value
case "volume-driver-opt":
case "volume-opt":
if volumeOptions().DriverConfig.Options == nil {
volumeOptions().DriverConfig.Options = make(map[string]string)
}
setValueOnMap(volumeOptions().DriverConfig.Options, value)
default:
return fmt.Errorf("unexpected key '%s' in '%s'", key, value)
return fmt.Errorf("unexpected key '%s' in '%s'", key, field)
}
}
@ -222,6 +234,17 @@ func (m *MountOpt) Set(value string) error {
return fmt.Errorf("target is required")
}
if mount.VolumeOptions != nil && mount.Source == "" {
return fmt.Errorf("source is required when specifying volume-* options")
}
if mount.Type == swarm.MountTypeBind && mount.VolumeOptions != nil {
return fmt.Errorf("cannot mix 'volume-*' options with mount type '%s'", swarm.MountTypeBind)
}
if mount.Type == swarm.MountTypeVolume && mount.BindOptions != nil {
return fmt.Errorf("cannot mix 'bind-*' options with mount type '%s'", swarm.MountTypeVolume)
}
m.values = append(m.values, mount)
return nil
}
@ -235,7 +258,8 @@ func (m *MountOpt) Type() string {
func (m *MountOpt) String() string {
mounts := []string{}
for _, mount := range m.values {
mounts = append(mounts, fmt.Sprintf("%v", mount))
repr := fmt.Sprintf("%s %s %s", mount.Type, mount.Source, mount.Target)
mounts = append(mounts, repr)
}
return strings.Join(mounts, ", ")
}
@ -248,6 +272,7 @@ func (m *MountOpt) Value() []swarm.Mount {
type updateOptions struct {
parallelism uint64
delay time.Duration
onFailure string
}
type resourceOptions struct {
@ -309,7 +334,7 @@ func (e *endpointOptions) ToEndpointSpec() *swarm.EndpointSpec {
}
return &swarm.EndpointSpec{
Mode: swarm.ResolutionMode(e.mode),
Mode: swarm.ResolutionMode(strings.ToLower(e.mode)),
Ports: portConfigs,
}
}
@ -332,6 +357,27 @@ func convertPortToPortConfig(
return ports
}
type logDriverOptions struct {
name string
opts opts.ListOpts
}
func newLogDriverOptions() logDriverOptions {
return logDriverOptions{opts: opts.NewListOpts(runconfigopts.ValidateEnv)}
}
func (ldo *logDriverOptions) toLogDriver() *swarm.Driver {
if ldo.name == "" {
return nil
}
// set the log driver only if specified.
return &swarm.Driver{
Name: ldo.name,
Options: runconfigopts.ConvertKVStringsToMap(ldo.opts.GetAll()),
}
}
// ValidatePort validates a string is in the expected format for a port definition
func ValidatePort(value string) (string, error) {
portMappings, err := nat.ParsePortSpec(value)
@ -344,15 +390,15 @@ func ValidatePort(value string) (string, error) {
}
type serviceOptions struct {
name string
labels opts.ListOpts
image string
command []string
args []string
env opts.ListOpts
workdir string
user string
mounts MountOpt
name string
labels opts.ListOpts
containerLabels opts.ListOpts
image string
args []string
env opts.ListOpts
workdir string
user string
mounts MountOpt
resources resourceOptions
stopGrace DurationOpt
@ -365,15 +411,21 @@ type serviceOptions struct {
update updateOptions
networks []string
endpoint endpointOptions
registryAuth bool
logDriver logDriverOptions
}
func newServiceOptions() *serviceOptions {
return &serviceOptions{
labels: opts.NewListOpts(runconfigopts.ValidateEnv),
env: opts.NewListOpts(runconfigopts.ValidateEnv),
labels: opts.NewListOpts(runconfigopts.ValidateEnv),
containerLabels: opts.NewListOpts(runconfigopts.ValidateEnv),
env: opts.NewListOpts(runconfigopts.ValidateEnv),
endpoint: endpointOptions{
ports: opts.NewListOpts(ValidatePort),
},
logDriver: newLogDriverOptions(),
}
}
@ -388,9 +440,9 @@ func (opts *serviceOptions) ToService() (swarm.ServiceSpec, error) {
TaskTemplate: swarm.TaskSpec{
ContainerSpec: swarm.ContainerSpec{
Image: opts.image,
Command: opts.command,
Args: opts.args,
Env: opts.env.GetAll(),
Labels: runconfigopts.ConvertKVStringsToMap(opts.containerLabels.GetAll()),
Dir: opts.workdir,
User: opts.user,
Mounts: opts.mounts.Value(),
@ -401,11 +453,13 @@ func (opts *serviceOptions) ToService() (swarm.ServiceSpec, error) {
Placement: &swarm.Placement{
Constraints: opts.constraints,
},
LogDriver: opts.logDriver.toLogDriver(),
},
Mode: swarm.ServiceMode{},
UpdateConfig: &swarm.UpdateConfig{
Parallelism: opts.update.parallelism,
Delay: opts.update.delay,
Parallelism: opts.update.parallelism,
Delay: opts.update.delay,
FailureAction: opts.update.onFailure,
},
Networks: convertNetworks(opts.networks),
EndpointSpec: opts.endpoint.ToEndpointSpec(),
@ -428,60 +482,78 @@ func (opts *serviceOptions) ToService() (swarm.ServiceSpec, error) {
return service, nil
}
// addServiceFlags adds all flags that are common to both `create` and `update.
// addServiceFlags adds all flags that are common to both `create` and `update`.
// Any flags that are not common are added separately in the individual command
func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
flags := cmd.Flags()
flags.StringVar(&opts.name, flagName, "", "Service name")
flags.VarP(&opts.labels, flagLabel, "l", "Service labels")
flags.VarP(&opts.env, "env", "e", "Set environment variables")
flags.StringVarP(&opts.workdir, "workdir", "w", "", "Working directory inside the container")
flags.StringVarP(&opts.user, "user", "u", "", "Username or UID")
flags.VarP(&opts.mounts, flagMount, "m", "Attach a mount to the service")
flags.StringVarP(&opts.user, flagUser, "u", "", "Username or UID")
flags.Var(&opts.resources.limitCPU, flagLimitCPU, "Limit CPUs")
flags.Var(&opts.resources.limitMemBytes, flagLimitMemory, "Limit Memory")
flags.Var(&opts.resources.resCPU, flagReserveCPU, "Reserve CPUs")
flags.Var(&opts.resources.resMemBytes, flagReserveMemory, "Reserve Memory")
flags.Var(&opts.stopGrace, "stop-grace-period", "Time to wait before force killing a container")
flags.Var(&opts.stopGrace, flagStopGracePeriod, "Time to wait before force killing a container")
flags.StringVar(&opts.mode, flagMode, "replicated", "Service mode (replicated or global)")
flags.Var(&opts.replicas, flagReplicas, "Number of tasks")
flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", "Restart when condition is met (none, on_failure, or any)")
flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", "Restart when condition is met (none, on-failure, or any)")
flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts")
flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up")
flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evalulate the restart policy")
flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy")
flags.StringSliceVar(&opts.constraints, flagConstraint, []string{}, "Placement constraints")
flags.Uint64Var(&opts.update.parallelism, flagUpdateParallelism, 1, "Maximum number of tasks updated simultaneously")
flags.Uint64Var(&opts.update.parallelism, flagUpdateParallelism, 1, "Maximum number of tasks updated simultaneously (0 to update all at once)")
flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates")
flags.StringVar(&opts.update.onFailure, flagUpdateFailureAction, "pause", "Action on update failure (pause|continue)")
flags.StringSliceVar(&opts.networks, flagNetwork, []string{}, "Network attachments")
flags.StringVar(&opts.endpoint.mode, flagEndpointMode, "", "Endpoint mode(Valid values: VIP, DNSRR)")
flags.VarP(&opts.endpoint.ports, flagPublish, "p", "Publish a port as a node port")
flags.StringVar(&opts.endpoint.mode, flagEndpointMode, "", "Endpoint mode (vip or dnsrr)")
flags.BoolVar(&opts.registryAuth, flagRegistryAuth, false, "Send registry authentication details to swarm agents")
flags.StringVar(&opts.logDriver.name, flagLogDriver, "", "Logging driver for service")
flags.Var(&opts.logDriver.opts, flagLogOpt, "Logging driver options")
}
const (
flagConstraint = "constraint"
flagName = "name"
flagLabel = "label"
flagLimitCPU = "limit-cpu"
flagLimitMemory = "limit-memory"
flagReserveCPU = "reserve-cpu"
flagReserveMemory = "reserve-memory"
flagMount = "mount"
flagMode = "mode"
flagReplicas = "replicas"
flagPublish = "publish"
flagNetwork = "network"
flagRestartCondition = "restart-condition"
flagRestartDelay = "restart-delay"
flagRestartMaxAttempts = "restart-max-attempts"
flagRestartWindow = "restart-window"
flagEndpointMode = "endpoint-mode"
flagUpdateParallelism = "update-parallelism"
flagUpdateDelay = "update-delay"
flagConstraint = "constraint"
flagConstraintRemove = "constraint-rm"
flagConstraintAdd = "constraint-add"
flagContainerLabel = "container-label"
flagContainerLabelRemove = "container-label-rm"
flagContainerLabelAdd = "container-label-add"
flagEndpointMode = "endpoint-mode"
flagEnv = "env"
flagEnvRemove = "env-rm"
flagEnvAdd = "env-add"
flagLabel = "label"
flagLabelRemove = "label-rm"
flagLabelAdd = "label-add"
flagLimitCPU = "limit-cpu"
flagLimitMemory = "limit-memory"
flagMode = "mode"
flagMount = "mount"
flagMountRemove = "mount-rm"
flagMountAdd = "mount-add"
flagName = "name"
flagNetwork = "network"
flagPublish = "publish"
flagPublishRemove = "publish-rm"
flagPublishAdd = "publish-add"
flagReplicas = "replicas"
flagReserveCPU = "reserve-cpu"
flagReserveMemory = "reserve-memory"
flagRestartCondition = "restart-condition"
flagRestartDelay = "restart-delay"
flagRestartMaxAttempts = "restart-max-attempts"
flagRestartWindow = "restart-window"
flagStopGracePeriod = "stop-grace-period"
flagUpdateDelay = "update-delay"
flagUpdateFailureAction = "update-failure-action"
flagUpdateParallelism = "update-parallelism"
flagUser = "user"
flagRegistryAuth = "with-registry-auth"
flagLogDriver = "log-driver"
flagLogOpt = "log-opt"
)

View file

@ -0,0 +1,176 @@
package service
import (
"testing"
"time"
"github.com/docker/docker/pkg/testutil/assert"
"github.com/docker/engine-api/types/swarm"
)
func TestMemBytesString(t *testing.T) {
var mem memBytes = 1048576
assert.Equal(t, mem.String(), "1 MiB")
}
func TestMemBytesSetAndValue(t *testing.T) {
var mem memBytes
assert.NilError(t, mem.Set("5kb"))
assert.Equal(t, mem.Value(), int64(5120))
}
func TestNanoCPUsString(t *testing.T) {
var cpus nanoCPUs = 6100000000
assert.Equal(t, cpus.String(), "6.100")
}
func TestNanoCPUsSetAndValue(t *testing.T) {
var cpus nanoCPUs
assert.NilError(t, cpus.Set("0.35"))
assert.Equal(t, cpus.Value(), int64(350000000))
}
func TestDurationOptString(t *testing.T) {
dur := time.Duration(300 * 10e8)
duration := DurationOpt{value: &dur}
assert.Equal(t, duration.String(), "5m0s")
}
func TestDurationOptSetAndValue(t *testing.T) {
var duration DurationOpt
assert.NilError(t, duration.Set("300s"))
assert.Equal(t, *duration.Value(), time.Duration(300*10e8))
}
func TestUint64OptString(t *testing.T) {
value := uint64(2345678)
opt := Uint64Opt{value: &value}
assert.Equal(t, opt.String(), "2345678")
opt = Uint64Opt{}
assert.Equal(t, opt.String(), "none")
}
func TestUint64OptSetAndValue(t *testing.T) {
var opt Uint64Opt
assert.NilError(t, opt.Set("14445"))
assert.Equal(t, *opt.Value(), uint64(14445))
}
func TestMountOptString(t *testing.T) {
mount := MountOpt{
values: []swarm.Mount{
{
Type: swarm.MountTypeBind,
Source: "/home/path",
Target: "/target",
},
{
Type: swarm.MountTypeVolume,
Source: "foo",
Target: "/target/foo",
},
},
}
expected := "bind /home/path /target, volume foo /target/foo"
assert.Equal(t, mount.String(), expected)
}
func TestMountOptSetNoError(t *testing.T) {
for _, testcase := range []string{
// tests several aliases that should have same result.
"type=bind,target=/target,source=/source",
"type=bind,src=/source,dst=/target",
"type=bind,source=/source,dst=/target",
"type=bind,src=/source,target=/target",
} {
var mount MountOpt
assert.NilError(t, mount.Set(testcase))
mounts := mount.Value()
assert.Equal(t, len(mounts), 1)
assert.Equal(t, mounts[0], swarm.Mount{
Type: swarm.MountTypeBind,
Source: "/source",
Target: "/target",
})
}
}
// TestMountOptDefaultType ensures that a mount without the type defaults to a
// volume mount.
func TestMountOptDefaultType(t *testing.T) {
var mount MountOpt
assert.NilError(t, mount.Set("target=/target,source=/foo"))
assert.Equal(t, mount.values[0].Type, swarm.MountTypeVolume)
}
func TestMountOptSetErrorNoTarget(t *testing.T) {
var mount MountOpt
assert.Error(t, mount.Set("type=volume,source=/foo"), "target is required")
}
func TestMountOptSetErrorInvalidKey(t *testing.T) {
var mount MountOpt
assert.Error(t, mount.Set("type=volume,bogus=foo"), "unexpected key 'bogus'")
}
func TestMountOptSetErrorInvalidField(t *testing.T) {
var mount MountOpt
assert.Error(t, mount.Set("type=volume,bogus"), "invalid field 'bogus'")
}
func TestMountOptSetErrorInvalidReadOnly(t *testing.T) {
var mount MountOpt
assert.Error(t, mount.Set("type=volume,readonly=no"), "invalid value for readonly: no")
assert.Error(t, mount.Set("type=volume,readonly=invalid"), "invalid value for readonly: invalid")
}
func TestMountOptDefaultEnableReadOnly(t *testing.T) {
var m MountOpt
assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo"))
assert.Equal(t, m.values[0].ReadOnly, false)
m = MountOpt{}
assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly"))
assert.Equal(t, m.values[0].ReadOnly, true)
m = MountOpt{}
assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly=1"))
assert.Equal(t, m.values[0].ReadOnly, true)
m = MountOpt{}
assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly=0"))
assert.Equal(t, m.values[0].ReadOnly, false)
}
func TestMountOptVolumeNoCopy(t *testing.T) {
var m MountOpt
assert.Error(t, m.Set("type=volume,target=/foo,volume-nocopy"), "source is required")
m = MountOpt{}
assert.NilError(t, m.Set("type=volume,target=/foo,source=foo"))
assert.Equal(t, m.values[0].VolumeOptions == nil, true)
m = MountOpt{}
assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy=true"))
assert.Equal(t, m.values[0].VolumeOptions != nil, true)
assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)
m = MountOpt{}
assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy"))
assert.Equal(t, m.values[0].VolumeOptions != nil, true)
assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)
m = MountOpt{}
assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy=1"))
assert.Equal(t, m.values[0].VolumeOptions != nil, true)
assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)
}
func TestMountOptTypeConflict(t *testing.T) {
var m MountOpt
assert.Error(t, m.Set("type=bind,target=/foo,source=/foo,volume-nocopy=true"), "cannot mix")
assert.Error(t, m.Set("type=volume,target=/foo,source=/foo,bind-propagation=rprivate"), "cannot mix")
}

View file

@ -5,55 +5,60 @@ import (
"github.com/docker/docker/api/client"
"github.com/docker/docker/api/client/idresolver"
"github.com/docker/docker/api/client/node"
"github.com/docker/docker/api/client/task"
"github.com/docker/docker/cli"
"github.com/docker/docker/opts"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/cobra"
)
type tasksOptions struct {
type psOptions struct {
serviceID string
all bool
noResolve bool
filter opts.FilterOpt
}
func newTasksCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := tasksOptions{filter: opts.NewFilterOpt()}
func newPSCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := psOptions{filter: opts.NewFilterOpt()}
cmd := &cobra.Command{
Use: "tasks [OPTIONS] SERVICE",
Use: "ps [OPTIONS] SERVICE",
Short: "List the tasks of a service",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.serviceID = args[0]
return runTasks(dockerCli, opts)
return runPS(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.all, "all", "a", false, "Display all tasks")
flags.BoolVarP(&opts.noResolve, "no-resolve", "n", false, "Do not map IDs to Names")
flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
return cmd
}
func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
func runPS(dockerCli *client.DockerCli, opts psOptions) error {
client := dockerCli.Client()
ctx := context.Background()
service, err := client.ServiceInspect(ctx, opts.serviceID)
service, _, err := client.ServiceInspectWithRaw(ctx, opts.serviceID)
if err != nil {
return err
}
filter := opts.filter.Value()
filter.Add("service", service.ID)
if !opts.all && !filter.Include("desired_state") {
filter.Add("desired_state", string(swarm.TaskStateRunning))
filter.Add("desired_state", string(swarm.TaskStateAccepted))
if filter.Include("node") {
nodeFilters := filter.Get("node")
for _, nodeFilter := range nodeFilters {
nodeReference, err := node.Reference(client, ctx, nodeFilter)
if err != nil {
return err
}
filter.Del("node", nodeFilter)
filter.Add("node", nodeReference)
}
}
tasks, err := client.TaskList(ctx, types.TaskListOptions{Filter: filter})

View file

@ -13,9 +13,9 @@ import (
func newRemoveCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "rm [OPTIONS] SERVICE",
Use: "rm [OPTIONS] SERVICE [SERVICE...]",
Aliases: []string{"remove"},
Short: "Remove a service",
Short: "Remove one or more services",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runRemove(dockerCli, args)

View file

@ -9,12 +9,13 @@ import (
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
func newScaleCommand(dockerCli *client.DockerCli) *cobra.Command {
return &cobra.Command{
Use: "scale SERVICE=SCALE [SERVICE=SCALE...]",
Use: "scale SERVICE=REPLICAS [SERVICE=REPLICAS...]",
Short: "Scale one or multiple services",
Args: scaleArgs,
RunE: func(cmd *cobra.Command, args []string) error {
@ -61,7 +62,8 @@ func runServiceScale(dockerCli *client.DockerCli, serviceID string, scale string
client := dockerCli.Client()
ctx := context.Background()
service, err := client.ServiceInspect(ctx, serviceID)
service, _, err := client.ServiceInspectWithRaw(ctx, serviceID)
if err != nil {
return err
}
@ -76,7 +78,7 @@ func runServiceScale(dockerCli *client.DockerCli, serviceID string, scale string
}
serviceMode.Replicated.Replicas = &uintScale
err = client.ServiceUpdate(ctx, service.ID, service.Version, service.Spec)
err = client.ServiceUpdate(ctx, service.ID, service.Version, service.Spec, types.ServiceUpdateOptions{})
if err != nil {
return err
}

View file

@ -2,6 +2,8 @@ package service
import (
"fmt"
"sort"
"strings"
"time"
"golang.org/x/net/context"
@ -10,47 +12,82 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/opts"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/swarm"
"github.com/docker/go-connections/nat"
shlex "github.com/flynn-archive/go-shlex"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
func newUpdateCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := newServiceOptions()
var flags *pflag.FlagSet
cmd := &cobra.Command{
Use: "update [OPTIONS] SERVICE",
Short: "Update a service",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runUpdate(dockerCli, flags, args[0])
return runUpdate(dockerCli, cmd.Flags(), args[0])
},
}
flags = cmd.Flags()
flags := cmd.Flags()
flags.String("image", "", "Service image tag")
flags.StringSlice("command", []string{}, "Service command")
flags.StringSlice("arg", []string{}, "Service command args")
flags.String("args", "", "Service command args")
addServiceFlags(cmd, opts)
flags.Var(newListOptsVar(), flagEnvRemove, "Remove an environment variable")
flags.Var(newListOptsVar(), flagLabelRemove, "Remove a label by its key")
flags.Var(newListOptsVar(), flagContainerLabelRemove, "Remove a container label by its key")
flags.Var(newListOptsVar(), flagMountRemove, "Remove a mount by its target path")
flags.Var(newListOptsVar(), flagPublishRemove, "Remove a published port by its target port")
flags.Var(newListOptsVar(), flagConstraintRemove, "Remove a constraint")
flags.Var(&opts.labels, flagLabelAdd, "Add or update service labels")
flags.Var(&opts.containerLabels, flagContainerLabelAdd, "Add or update container labels")
flags.Var(&opts.env, flagEnvAdd, "Add or update environment variables")
flags.Var(&opts.mounts, flagMountAdd, "Add or update a mount on a service")
flags.StringSliceVar(&opts.constraints, flagConstraintAdd, []string{}, "Add or update placement constraints")
flags.Var(&opts.endpoint.ports, flagPublishAdd, "Add or update a published port")
return cmd
}
func newListOptsVar() *opts.ListOpts {
return opts.NewListOptsRef(&[]string{}, nil)
}
func runUpdate(dockerCli *client.DockerCli, flags *pflag.FlagSet, serviceID string) error {
client := dockerCli.Client()
apiClient := dockerCli.Client()
ctx := context.Background()
updateOpts := types.ServiceUpdateOptions{}
service, err := client.ServiceInspect(ctx, serviceID)
service, _, err := apiClient.ServiceInspectWithRaw(ctx, serviceID)
if err != nil {
return err
}
err = mergeService(&service.Spec, flags)
err = updateService(flags, &service.Spec)
if err != nil {
return err
}
err = client.ServiceUpdate(ctx, service.ID, service.Version, service.Spec)
// only send auth if flag was set
sendAuth, err := flags.GetBool(flagRegistryAuth)
if err != nil {
return err
}
if sendAuth {
// Retrieve encoded auth token from the image reference
// This would be the old image if it didn't change in this update
image := service.Spec.TaskTemplate.ContainerSpec.Image
encodedAuth, err := dockerCli.RetrieveAuthTokenFromImage(ctx, image)
if err != nil {
return err
}
updateOpts.EncodedRegistryAuth = encodedAuth
}
err = apiClient.ServiceUpdate(ctx, service.ID, service.Version, service.Spec, updateOpts)
if err != nil {
return err
}
@ -59,90 +96,79 @@ func runUpdate(dockerCli *client.DockerCli, flags *pflag.FlagSet, serviceID stri
return nil
}
func mergeService(spec *swarm.ServiceSpec, flags *pflag.FlagSet) error {
mergeString := func(flag string, field *string) {
func updateService(flags *pflag.FlagSet, spec *swarm.ServiceSpec) error {
updateString := func(flag string, field *string) {
if flags.Changed(flag) {
*field, _ = flags.GetString(flag)
}
}
mergeListOpts := func(flag string, field *[]string) {
if flags.Changed(flag) {
value := flags.Lookup(flag).Value.(*opts.ListOpts)
*field = value.GetAll()
}
}
mergeSlice := func(flag string, field *[]string) {
if flags.Changed(flag) {
*field, _ = flags.GetStringSlice(flag)
}
}
mergeInt64Value := func(flag string, field *int64) {
updateInt64Value := func(flag string, field *int64) {
if flags.Changed(flag) {
*field = flags.Lookup(flag).Value.(int64Value).Value()
}
}
mergeDuration := func(flag string, field *time.Duration) {
updateDuration := func(flag string, field *time.Duration) {
if flags.Changed(flag) {
*field, _ = flags.GetDuration(flag)
}
}
mergeDurationOpt := func(flag string, field *time.Duration) {
updateDurationOpt := func(flag string, field **time.Duration) {
if flags.Changed(flag) {
*field = *flags.Lookup(flag).Value.(*DurationOpt).Value()
val := *flags.Lookup(flag).Value.(*DurationOpt).Value()
*field = &val
}
}
mergeUint64 := func(flag string, field *uint64) {
updateUint64 := func(flag string, field *uint64) {
if flags.Changed(flag) {
*field, _ = flags.GetUint64(flag)
}
}
mergeUint64Opt := func(flag string, field *uint64) {
updateUint64Opt := func(flag string, field **uint64) {
if flags.Changed(flag) {
*field = *flags.Lookup(flag).Value.(*Uint64Opt).Value()
val := *flags.Lookup(flag).Value.(*Uint64Opt).Value()
*field = &val
}
}
cspec := &spec.TaskTemplate.ContainerSpec
task := &spec.TaskTemplate
mergeString(flagName, &spec.Name)
mergeLabels(flags, &spec.Labels)
mergeString("image", &cspec.Image)
mergeSlice("command", &cspec.Command)
mergeSlice("arg", &cspec.Command)
mergeListOpts("env", &cspec.Env)
mergeString("workdir", &cspec.Dir)
mergeString("user", &cspec.User)
mergeMounts(flags, &cspec.Mounts)
taskResources := func() *swarm.ResourceRequirements {
if task.Resources == nil {
task.Resources = &swarm.ResourceRequirements{}
}
return task.Resources
}
updateString(flagName, &spec.Name)
updateLabels(flags, &spec.Labels)
updateContainerLabels(flags, &cspec.Labels)
updateString("image", &cspec.Image)
updateStringToSlice(flags, "args", &cspec.Args)
updateEnvironment(flags, &cspec.Env)
updateString("workdir", &cspec.Dir)
updateString(flagUser, &cspec.User)
updateMounts(flags, &cspec.Mounts)
if flags.Changed(flagLimitCPU) || flags.Changed(flagLimitMemory) {
if task.Resources == nil {
task.Resources = &swarm.ResourceRequirements{}
}
task.Resources.Limits = &swarm.Resources{}
mergeInt64Value(flagLimitCPU, &task.Resources.Limits.NanoCPUs)
mergeInt64Value(flagLimitMemory, &task.Resources.Limits.MemoryBytes)
taskResources().Limits = &swarm.Resources{}
updateInt64Value(flagLimitCPU, &task.Resources.Limits.NanoCPUs)
updateInt64Value(flagLimitMemory, &task.Resources.Limits.MemoryBytes)
}
if flags.Changed(flagReserveCPU) || flags.Changed(flagReserveMemory) {
if task.Resources == nil {
task.Resources = &swarm.ResourceRequirements{}
}
task.Resources.Reservations = &swarm.Resources{}
mergeInt64Value(flagReserveCPU, &task.Resources.Reservations.NanoCPUs)
mergeInt64Value(flagReserveMemory, &task.Resources.Reservations.MemoryBytes)
taskResources().Reservations = &swarm.Resources{}
updateInt64Value(flagReserveCPU, &task.Resources.Reservations.NanoCPUs)
updateInt64Value(flagReserveMemory, &task.Resources.Reservations.MemoryBytes)
}
mergeDurationOpt("stop-grace-period", cspec.StopGracePeriod)
updateDurationOpt(flagStopGracePeriod, &cspec.StopGracePeriod)
if flags.Changed(flagRestartCondition) || flags.Changed(flagRestartDelay) || flags.Changed(flagRestartMaxAttempts) || flags.Changed(flagRestartWindow) {
if anyChanged(flags, flagRestartCondition, flagRestartDelay, flagRestartMaxAttempts, flagRestartWindow) {
if task.RestartPolicy == nil {
task.RestartPolicy = &swarm.RestartPolicy{}
}
@ -151,125 +177,296 @@ func mergeService(spec *swarm.ServiceSpec, flags *pflag.FlagSet) error {
value, _ := flags.GetString(flagRestartCondition)
task.RestartPolicy.Condition = swarm.RestartPolicyCondition(value)
}
mergeDurationOpt(flagRestartDelay, task.RestartPolicy.Delay)
mergeUint64Opt(flagRestartMaxAttempts, task.RestartPolicy.MaxAttempts)
mergeDurationOpt((flagRestartWindow), task.RestartPolicy.Window)
updateDurationOpt(flagRestartDelay, &task.RestartPolicy.Delay)
updateUint64Opt(flagRestartMaxAttempts, &task.RestartPolicy.MaxAttempts)
updateDurationOpt(flagRestartWindow, &task.RestartPolicy.Window)
}
if flags.Changed(flagConstraint) {
task.Placement = &swarm.Placement{}
mergeSlice(flagConstraint, &task.Placement.Constraints)
if anyChanged(flags, flagConstraintAdd, flagConstraintRemove) {
if task.Placement == nil {
task.Placement = &swarm.Placement{}
}
updatePlacement(flags, task.Placement)
}
if err := mergeMode(flags, &spec.Mode); err != nil {
if err := updateReplicas(flags, &spec.Mode); err != nil {
return err
}
if flags.Changed(flagUpdateParallelism) || flags.Changed(flagUpdateDelay) {
if anyChanged(flags, flagUpdateParallelism, flagUpdateDelay, flagUpdateFailureAction) {
if spec.UpdateConfig == nil {
spec.UpdateConfig = &swarm.UpdateConfig{}
}
mergeUint64(flagUpdateParallelism, &spec.UpdateConfig.Parallelism)
mergeDuration(flagUpdateDelay, &spec.UpdateConfig.Delay)
updateUint64(flagUpdateParallelism, &spec.UpdateConfig.Parallelism)
updateDuration(flagUpdateDelay, &spec.UpdateConfig.Delay)
updateString(flagUpdateFailureAction, &spec.UpdateConfig.FailureAction)
}
mergeNetworks(flags, &spec.Networks)
if flags.Changed(flagEndpointMode) {
value, _ := flags.GetString(flagEndpointMode)
spec.EndpointSpec.Mode = swarm.ResolutionMode(value)
}
if flags.Changed(flagPublish) {
if spec.EndpointSpec == nil {
spec.EndpointSpec = &swarm.EndpointSpec{}
}
mergePorts(flags, &spec.EndpointSpec.Ports)
spec.EndpointSpec.Mode = swarm.ResolutionMode(value)
}
if anyChanged(flags, flagPublishAdd, flagPublishRemove) {
if spec.EndpointSpec == nil {
spec.EndpointSpec = &swarm.EndpointSpec{}
}
if err := updatePorts(flags, &spec.EndpointSpec.Ports); err != nil {
return err
}
}
if err := updateLogDriver(flags, &spec.TaskTemplate); err != nil {
return err
}
return nil
}
func mergeLabels(flags *pflag.FlagSet, field *map[string]string) {
if !flags.Changed(flagLabel) {
return
}
if *field == nil {
*field = make(map[string]string)
}
values := flags.Lookup(flagLabel).Value.(*opts.ListOpts).GetAll()
for key, value := range runconfigopts.ConvertKVStringsToMap(values) {
(*field)[key] = value
}
}
// TODO: should this override by destination path, or does swarm handle that?
func mergeMounts(flags *pflag.FlagSet, mounts *[]swarm.Mount) {
if !flags.Changed(flagMount) {
return
}
values := flags.Lookup(flagMount).Value.(*MountOpt).Value()
*mounts = append(*mounts, values...)
}
// TODO: should this override by name, or does swarm handle that?
func mergePorts(flags *pflag.FlagSet, portConfig *[]swarm.PortConfig) {
if !flags.Changed(flagPublish) {
return
}
values := flags.Lookup(flagPublish).Value.(*opts.ListOpts).GetAll()
ports, portBindings, _ := nat.ParsePortSpecs(values)
for port := range ports {
*portConfig = append(*portConfig, convertPortToPortConfig(port, portBindings)...)
}
}
func mergeNetworks(flags *pflag.FlagSet, attachments *[]swarm.NetworkAttachmentConfig) {
if !flags.Changed(flagNetwork) {
return
}
networks, _ := flags.GetStringSlice(flagNetwork)
for _, network := range networks {
*attachments = append(*attachments, swarm.NetworkAttachmentConfig{Target: network})
}
}
func mergeMode(flags *pflag.FlagSet, serviceMode *swarm.ServiceMode) error {
if !flags.Changed(flagMode) && !flags.Changed(flagReplicas) {
func updateStringToSlice(flags *pflag.FlagSet, flag string, field *[]string) error {
if !flags.Changed(flag) {
return nil
}
var mode string
if flags.Changed(flagMode) {
mode, _ = flags.GetString(flagMode)
value, _ := flags.GetString(flag)
valueSlice, err := shlex.Split(value)
*field = valueSlice
return err
}
func anyChanged(flags *pflag.FlagSet, fields ...string) bool {
for _, flag := range fields {
if flags.Changed(flag) {
return true
}
}
return false
}
func updatePlacement(flags *pflag.FlagSet, placement *swarm.Placement) {
field, _ := flags.GetStringSlice(flagConstraintAdd)
placement.Constraints = append(placement.Constraints, field...)
toRemove := buildToRemoveSet(flags, flagConstraintRemove)
placement.Constraints = removeItems(placement.Constraints, toRemove, itemKey)
}
func updateContainerLabels(flags *pflag.FlagSet, field *map[string]string) {
if flags.Changed(flagContainerLabelAdd) {
if *field == nil {
*field = map[string]string{}
}
values := flags.Lookup(flagContainerLabelAdd).Value.(*opts.ListOpts).GetAll()
for key, value := range runconfigopts.ConvertKVStringsToMap(values) {
(*field)[key] = value
}
}
if !(mode == "replicated" || serviceMode.Replicated != nil) && flags.Changed(flagReplicas) {
if *field != nil && flags.Changed(flagContainerLabelRemove) {
toRemove := flags.Lookup(flagContainerLabelRemove).Value.(*opts.ListOpts).GetAll()
for _, label := range toRemove {
delete(*field, label)
}
}
}
func updateLabels(flags *pflag.FlagSet, field *map[string]string) {
if flags.Changed(flagLabelAdd) {
if *field == nil {
*field = map[string]string{}
}
values := flags.Lookup(flagLabelAdd).Value.(*opts.ListOpts).GetAll()
for key, value := range runconfigopts.ConvertKVStringsToMap(values) {
(*field)[key] = value
}
}
if *field != nil && flags.Changed(flagLabelRemove) {
toRemove := flags.Lookup(flagLabelRemove).Value.(*opts.ListOpts).GetAll()
for _, label := range toRemove {
delete(*field, label)
}
}
}
func updateEnvironment(flags *pflag.FlagSet, field *[]string) {
envSet := map[string]string{}
for _, v := range *field {
envSet[envKey(v)] = v
}
if flags.Changed(flagEnvAdd) {
value := flags.Lookup(flagEnvAdd).Value.(*opts.ListOpts)
for _, v := range value.GetAll() {
envSet[envKey(v)] = v
}
}
*field = []string{}
for _, v := range envSet {
*field = append(*field, v)
}
toRemove := buildToRemoveSet(flags, flagEnvRemove)
*field = removeItems(*field, toRemove, envKey)
}
func envKey(value string) string {
kv := strings.SplitN(value, "=", 2)
return kv[0]
}
func itemKey(value string) string {
return value
}
func buildToRemoveSet(flags *pflag.FlagSet, flag string) map[string]struct{} {
var empty struct{}
toRemove := make(map[string]struct{})
if !flags.Changed(flag) {
return toRemove
}
toRemoveSlice := flags.Lookup(flag).Value.(*opts.ListOpts).GetAll()
for _, key := range toRemoveSlice {
toRemove[key] = empty
}
return toRemove
}
func removeItems(
seq []string,
toRemove map[string]struct{},
keyFunc func(string) string,
) []string {
newSeq := []string{}
for _, item := range seq {
if _, exists := toRemove[keyFunc(item)]; !exists {
newSeq = append(newSeq, item)
}
}
return newSeq
}
func updateMounts(flags *pflag.FlagSet, mounts *[]swarm.Mount) {
if flags.Changed(flagMountAdd) {
values := flags.Lookup(flagMountAdd).Value.(*MountOpt).Value()
*mounts = append(*mounts, values...)
}
toRemove := buildToRemoveSet(flags, flagMountRemove)
newMounts := []swarm.Mount{}
for _, mount := range *mounts {
if _, exists := toRemove[mount.Target]; !exists {
newMounts = append(newMounts, mount)
}
}
*mounts = newMounts
}
type byPortConfig []swarm.PortConfig
func (r byPortConfig) Len() int { return len(r) }
func (r byPortConfig) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r byPortConfig) Less(i, j int) bool {
// We convert PortConfig into `port/protocol`, e.g., `80/tcp`
// In updatePorts we already filter out with map so there is duplicate entries
return portConfigToString(&r[i]) < portConfigToString(&r[j])
}
func portConfigToString(portConfig *swarm.PortConfig) string {
protocol := portConfig.Protocol
if protocol == "" {
protocol = "tcp"
}
return fmt.Sprintf("%v/%s", portConfig.PublishedPort, protocol)
}
func updatePorts(flags *pflag.FlagSet, portConfig *[]swarm.PortConfig) error {
// The key of the map is `port/protocol`, e.g., `80/tcp`
portSet := map[string]swarm.PortConfig{}
// Check to see if there are any conflict in flags.
if flags.Changed(flagPublishAdd) {
values := flags.Lookup(flagPublishAdd).Value.(*opts.ListOpts).GetAll()
ports, portBindings, _ := nat.ParsePortSpecs(values)
for port := range ports {
newConfigs := convertPortToPortConfig(port, portBindings)
for _, entry := range newConfigs {
if v, ok := portSet[portConfigToString(&entry)]; ok && v != entry {
return fmt.Errorf("conflicting port mapping between %v:%v/%s and %v:%v/%s", entry.PublishedPort, entry.TargetPort, entry.Protocol, v.PublishedPort, v.TargetPort, v.Protocol)
}
portSet[portConfigToString(&entry)] = entry
}
}
}
// Override previous PortConfig in service if there is any duplicate
for _, entry := range *portConfig {
if _, ok := portSet[portConfigToString(&entry)]; !ok {
portSet[portConfigToString(&entry)] = entry
}
}
toRemove := flags.Lookup(flagPublishRemove).Value.(*opts.ListOpts).GetAll()
newPorts := []swarm.PortConfig{}
portLoop:
for _, port := range portSet {
for _, rawTargetPort := range toRemove {
targetPort := nat.Port(rawTargetPort)
if equalPort(targetPort, port) {
continue portLoop
}
}
newPorts = append(newPorts, port)
}
// Sort the PortConfig to avoid unnecessary updates
sort.Sort(byPortConfig(newPorts))
*portConfig = newPorts
return nil
}
func equalPort(targetPort nat.Port, port swarm.PortConfig) bool {
return (string(port.Protocol) == targetPort.Proto() &&
port.TargetPort == uint32(targetPort.Int()))
}
func updateReplicas(flags *pflag.FlagSet, serviceMode *swarm.ServiceMode) error {
if !flags.Changed(flagReplicas) {
return nil
}
if serviceMode == nil || serviceMode.Replicated == nil {
return fmt.Errorf("replicas can only be used with replicated mode")
}
serviceMode.Replicated.Replicas = flags.Lookup(flagReplicas).Value.(*Uint64Opt).Value()
return nil
}
if mode == "global" {
serviceMode.Replicated = nil
serviceMode.Global = &swarm.GlobalService{}
// updateLogDriver updates the log driver only if the log driver flag is set.
// All options will be replaced with those provided on the command line.
func updateLogDriver(flags *pflag.FlagSet, taskTemplate *swarm.TaskSpec) error {
if !flags.Changed(flagLogDriver) {
return nil
}
if flags.Changed(flagReplicas) {
replicas := flags.Lookup(flagReplicas).Value.(*Uint64Opt).Value()
serviceMode.Replicated = &swarm.ReplicatedService{Replicas: replicas}
serviceMode.Global = nil
name, err := flags.GetString(flagLogDriver)
if err != nil {
return err
}
if name == "" {
return nil
}
if mode == "replicated" {
if serviceMode.Replicated != nil {
return nil
}
serviceMode.Replicated = &swarm.ReplicatedService{Replicas: &DefaultReplicas}
serviceMode.Global = nil
taskTemplate.LogDriver = &swarm.Driver{
Name: name,
Options: runconfigopts.ConvertKVStringsToMap(flags.Lookup(flagLogOpt).Value.(*opts.ListOpts).GetAll()),
}
return nil

View file

@ -0,0 +1,180 @@
package service
import (
"sort"
"testing"
"github.com/docker/docker/pkg/testutil/assert"
"github.com/docker/engine-api/types/swarm"
)
func TestUpdateServiceArgs(t *testing.T) {
flags := newUpdateCommand(nil).Flags()
flags.Set("args", "the \"new args\"")
spec := &swarm.ServiceSpec{}
cspec := &spec.TaskTemplate.ContainerSpec
cspec.Args = []string{"old", "args"}
updateService(flags, spec)
assert.EqualStringSlice(t, cspec.Args, []string{"the", "new args"})
}
func TestUpdateLabels(t *testing.T) {
flags := newUpdateCommand(nil).Flags()
flags.Set("label-add", "toadd=newlabel")
flags.Set("label-rm", "toremove")
labels := map[string]string{
"toremove": "thelabeltoremove",
"tokeep": "value",
}
updateLabels(flags, &labels)
assert.Equal(t, len(labels), 2)
assert.Equal(t, labels["tokeep"], "value")
assert.Equal(t, labels["toadd"], "newlabel")
}
func TestUpdateLabelsRemoveALabelThatDoesNotExist(t *testing.T) {
flags := newUpdateCommand(nil).Flags()
flags.Set("label-rm", "dne")
labels := map[string]string{"foo": "theoldlabel"}
updateLabels(flags, &labels)
assert.Equal(t, len(labels), 1)
}
func TestUpdatePlacement(t *testing.T) {
flags := newUpdateCommand(nil).Flags()
flags.Set("constraint-add", "node=toadd")
flags.Set("constraint-rm", "node!=toremove")
placement := &swarm.Placement{
Constraints: []string{"node!=toremove", "container=tokeep"},
}
updatePlacement(flags, placement)
assert.Equal(t, len(placement.Constraints), 2)
assert.Equal(t, placement.Constraints[0], "container=tokeep")
assert.Equal(t, placement.Constraints[1], "node=toadd")
}
func TestUpdateEnvironment(t *testing.T) {
flags := newUpdateCommand(nil).Flags()
flags.Set("env-add", "toadd=newenv")
flags.Set("env-rm", "toremove")
envs := []string{"toremove=theenvtoremove", "tokeep=value"}
updateEnvironment(flags, &envs)
assert.Equal(t, len(envs), 2)
// Order has been removed in updateEnvironment (map)
sort.Strings(envs)
assert.Equal(t, envs[0], "toadd=newenv")
assert.Equal(t, envs[1], "tokeep=value")
}
func TestUpdateEnvironmentWithDuplicateValues(t *testing.T) {
flags := newUpdateCommand(nil).Flags()
flags.Set("env-add", "foo=newenv")
flags.Set("env-add", "foo=dupe")
flags.Set("env-rm", "foo")
envs := []string{"foo=value"}
updateEnvironment(flags, &envs)
assert.Equal(t, len(envs), 0)
}
func TestUpdateEnvironmentWithDuplicateKeys(t *testing.T) {
// Test case for #25404
flags := newUpdateCommand(nil).Flags()
flags.Set("env-add", "A=b")
envs := []string{"A=c"}
updateEnvironment(flags, &envs)
assert.Equal(t, len(envs), 1)
assert.Equal(t, envs[0], "A=b")
}
func TestUpdateMounts(t *testing.T) {
flags := newUpdateCommand(nil).Flags()
flags.Set("mount-add", "type=volume,target=/toadd")
flags.Set("mount-rm", "/toremove")
mounts := []swarm.Mount{
{Target: "/toremove", Type: swarm.MountTypeBind},
{Target: "/tokeep", Type: swarm.MountTypeBind},
}
updateMounts(flags, &mounts)
assert.Equal(t, len(mounts), 2)
assert.Equal(t, mounts[0].Target, "/tokeep")
assert.Equal(t, mounts[1].Target, "/toadd")
}
func TestUpdatePorts(t *testing.T) {
flags := newUpdateCommand(nil).Flags()
flags.Set("publish-add", "1000:1000")
flags.Set("publish-rm", "333/udp")
portConfigs := []swarm.PortConfig{
{TargetPort: 333, Protocol: swarm.PortConfigProtocolUDP},
{TargetPort: 555},
}
err := updatePorts(flags, &portConfigs)
assert.Equal(t, err, nil)
assert.Equal(t, len(portConfigs), 2)
// Do a sort to have the order (might have changed by map)
targetPorts := []int{int(portConfigs[0].TargetPort), int(portConfigs[1].TargetPort)}
sort.Ints(targetPorts)
assert.Equal(t, targetPorts[0], 555)
assert.Equal(t, targetPorts[1], 1000)
}
func TestUpdatePortsDuplicateEntries(t *testing.T) {
// Test case for #25375
flags := newUpdateCommand(nil).Flags()
flags.Set("publish-add", "80:80")
portConfigs := []swarm.PortConfig{
{TargetPort: 80, PublishedPort: 80},
}
err := updatePorts(flags, &portConfigs)
assert.Equal(t, err, nil)
assert.Equal(t, len(portConfigs), 1)
assert.Equal(t, portConfigs[0].TargetPort, uint32(80))
}
func TestUpdatePortsDuplicateKeys(t *testing.T) {
// Test case for #25375
flags := newUpdateCommand(nil).Flags()
flags.Set("publish-add", "80:20")
portConfigs := []swarm.PortConfig{
{TargetPort: 80, PublishedPort: 80},
}
err := updatePorts(flags, &portConfigs)
assert.Equal(t, err, nil)
assert.Equal(t, len(portConfigs), 1)
assert.Equal(t, portConfigs[0].TargetPort, uint32(20))
}
func TestUpdatePortsConflictingFlags(t *testing.T) {
// Test case for #25375
flags := newUpdateCommand(nil).Flags()
flags.Set("publish-add", "80:80")
flags.Set("publish-add", "80:20")
portConfigs := []swarm.PortConfig{
{TargetPort: 80, PublishedPort: 80},
}
err := updatePorts(flags, &portConfigs)
assert.Error(t, err, "conflicting port mapping")
}

View file

@ -24,12 +24,12 @@ func NewStackCommand(dockerCli *client.DockerCli) *cobra.Command {
newConfigCommand(dockerCli),
newDeployCommand(dockerCli),
newRemoveCommand(dockerCli),
newTasksCommand(dockerCli),
newPSCommand(dockerCli),
)
return cmd
}
// NewTopLevelDeployCommand return a command for `docker deploy`
// NewTopLevelDeployCommand returns a command for `docker deploy`
func NewTopLevelDeployCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := newDeployCommand(dockerCli)
// Remove the aliases at the top level

View file

@ -7,12 +7,12 @@ import (
"github.com/spf13/cobra"
)
// NewStackCommand returns nocommand
// NewStackCommand returns no command
func NewStackCommand(dockerCli *client.DockerCli) *cobra.Command {
return &cobra.Command{}
}
// NewTopLevelDeployCommand return no command
// NewTopLevelDeployCommand returns no command
func NewTopLevelDeployCommand(dockerCli *client.DockerCli) *cobra.Command {
return &cobra.Command{}
}

View file

@ -21,8 +21,9 @@ const (
)
type deployOptions struct {
bundlefile string
namespace string
bundlefile string
namespace string
sendRegistryAuth bool
}
func newDeployCommand(dockerCli *client.DockerCli) *cobra.Command {
@ -31,7 +32,7 @@ func newDeployCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "deploy [OPTIONS] STACK",
Aliases: []string{"up"},
Short: "Create and update a stack",
Short: "Create and update a stack from a Distributed Application Bundle (DAB)",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.namespace = args[0]
@ -41,6 +42,7 @@ func newDeployCommand(dockerCli *client.DockerCli) *cobra.Command {
flags := cmd.Flags()
addBundlefileFlag(&opts.bundlefile, flags)
addRegistryAuthFlag(&opts.sendRegistryAuth, flags)
return cmd
}
@ -56,7 +58,7 @@ func runDeploy(dockerCli *client.DockerCli, opts deployOptions) error {
if err := updateNetworks(ctx, dockerCli, networks, opts.namespace); err != nil {
return err
}
return deployServices(ctx, dockerCli, bundle.Services, opts.namespace)
return deployServices(ctx, dockerCli, bundle.Services, opts.namespace, opts.sendRegistryAuth)
}
func getUniqueNetworkNames(services map[string]bundlefile.Service) []string {
@ -129,6 +131,7 @@ func deployServices(
dockerCli *client.DockerCli,
services map[string]bundlefile.Service,
namespace string,
sendAuth bool,
) error {
apiClient := dockerCli.Client()
out := dockerCli.Out()
@ -181,21 +184,40 @@ func deployServices(
cspec.User = *service.User
}
encodedAuth := ""
if sendAuth {
// Retrieve encoded auth token from the image reference
image := serviceSpec.TaskTemplate.ContainerSpec.Image
encodedAuth, err = dockerCli.RetrieveAuthTokenFromImage(ctx, image)
if err != nil {
return err
}
}
if service, exists := existingServiceMap[name]; exists {
fmt.Fprintf(out, "Updating service %s (id: %s)\n", name, service.ID)
updateOpts := types.ServiceUpdateOptions{}
if sendAuth {
updateOpts.EncodedRegistryAuth = encodedAuth
}
if err := apiClient.ServiceUpdate(
ctx,
service.ID,
service.Version,
serviceSpec,
updateOpts,
); err != nil {
return err
}
} else {
fmt.Fprintf(out, "Creating service %s\n", name)
if _, err := apiClient.ServiceCreate(ctx, serviceSpec); err != nil {
createOpts := types.ServiceCreateOptions{}
if sendAuth {
createOpts.EncodedRegistryAuth = encodedAuth
}
if _, err := apiClient.ServiceCreate(ctx, serviceSpec, createOpts); err != nil {
return err
}
}

View file

@ -12,26 +12,36 @@ import (
)
func addBundlefileFlag(opt *string, flags *pflag.FlagSet) {
flags.StringVarP(
flags.StringVar(
opt,
"bundle", "f", "",
"Path to a bundle (Default: STACK.dsb)")
"file", "",
"Path to a Distributed Application Bundle file (Default: STACK.dab)")
}
func addRegistryAuthFlag(opt *bool, flags *pflag.FlagSet) {
flags.BoolVar(opt, "with-registry-auth", false, "Send registry authentication details to Swarm agents")
}
func loadBundlefile(stderr io.Writer, namespace string, path string) (*bundlefile.Bundlefile, error) {
defaultPath := fmt.Sprintf("%s.dsb", namespace)
defaultPath := fmt.Sprintf("%s.dab", namespace)
if path == "" {
path = defaultPath
}
if _, err := os.Stat(path); err != nil {
return nil, fmt.Errorf(
"Bundle %s not found. Specify the path with -f or --bundle",
"Bundle %s not found. Specify the path with --file",
path)
}
fmt.Fprintf(stderr, "Loading bundle from %s\n", path)
bundle, err := bundlefile.LoadFile(path)
reader, err := os.Open(path)
if err != nil {
return nil, err
}
defer reader.Close()
bundle, err := bundlefile.LoadFile(reader)
if err != nil {
return nil, fmt.Errorf("Error reading %s: %v\n", path, err)
}

View file

@ -3,6 +3,8 @@
package stack
import (
"fmt"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
@ -15,42 +17,43 @@ import (
"github.com/spf13/cobra"
)
type tasksOptions struct {
type psOptions struct {
all bool
filter opts.FilterOpt
namespace string
noResolve bool
}
func newTasksCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := tasksOptions{filter: opts.NewFilterOpt()}
func newPSCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := psOptions{filter: opts.NewFilterOpt()}
cmd := &cobra.Command{
Use: "tasks [OPTIONS] STACK",
Use: "ps [OPTIONS] STACK",
Short: "List the tasks in the stack",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.namespace = args[0]
return runTasks(dockerCli, opts)
return runPS(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.all, "all", "a", false, "Display all tasks")
flags.BoolVarP(&opts.noResolve, "no-resolve", "n", false, "Do not map IDs to Names")
flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
return cmd
}
func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
func runPS(dockerCli *client.DockerCli, opts psOptions) error {
namespace := opts.namespace
client := dockerCli.Client()
ctx := context.Background()
filter := opts.filter.Value()
filter.Add("label", labelNamespace+"="+opts.namespace)
if !opts.all && !filter.Include("desired_state") {
filter.Add("desired_state", string(swarm.TaskStateRunning))
filter.Add("desired_state", string(swarm.TaskStateAccepted))
if !opts.all && !filter.Include("desired-state") {
filter.Add("desired-state", string(swarm.TaskStateRunning))
filter.Add("desired-state", string(swarm.TaskStateAccepted))
}
tasks, err := client.TaskList(ctx, types.TaskListOptions{Filter: filter})
@ -58,5 +61,10 @@ func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
return err
}
if len(tasks) == 0 {
fmt.Fprintf(dockerCli.Out(), "Nothing found in stack: %s\n", namespace)
return nil
}
return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve))
}

View file

@ -63,6 +63,11 @@ func runRemove(dockerCli *client.DockerCli, opts removeOptions) error {
}
}
if len(services) == 0 && len(networks) == 0 {
fmt.Fprintf(dockerCli.Out(), "Nothing found in stack: %s\n", namespace)
return nil
}
if hasError {
return fmt.Errorf("Failed to remove some resources")
}

View file

@ -22,9 +22,9 @@ func NewSwarmCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd.AddCommand(
newInitCommand(dockerCli),
newJoinCommand(dockerCli),
newJoinTokenCommand(dockerCli),
newUpdateCommand(dockerCli),
newLeaveCommand(dockerCli),
newInspectCommand(dockerCli),
)
return cmd
}

View file

@ -1,7 +1,9 @@
package swarm
import (
"errors"
"fmt"
"strings"
"golang.org/x/net/context"
@ -9,53 +11,71 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
const (
generatedSecretEntropyBytes = 16
generatedSecretBase = 36
// floor(log(2^128-1, 36)) + 1
maxGeneratedSecretLength = 25
)
type initOptions struct {
listenAddr NodeAddrOption
autoAccept AutoAcceptOption
swarmOptions
listenAddr NodeAddrOption
// Not a NodeAddrOption because it has no default port.
advertiseAddr string
forceNewCluster bool
secret string
}
func newInitCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := initOptions{
listenAddr: NewNodeAddrOption(),
autoAccept: NewAutoAcceptOption(),
listenAddr: NewListenAddrOption(),
}
cmd := &cobra.Command{
Use: "init",
Short: "Initialize a Swarm.",
Use: "init [OPTIONS]",
Short: "Initialize a swarm",
Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return runInit(dockerCli, opts)
return runInit(dockerCli, cmd.Flags(), opts)
},
}
flags := cmd.Flags()
flags.Var(&opts.listenAddr, "listen-addr", "Listen address")
flags.Var(&opts.autoAccept, "auto-accept", "Auto acceptance policy (worker, manager, or none)")
flags.StringVar(&opts.secret, "secret", "", "Set secret value needed to accept nodes into cluster")
flags.Var(&opts.listenAddr, flagListenAddr, "Listen address (format: <ip|interface>[:port])")
flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[:port])")
flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state.")
addSwarmFlags(flags, &opts.swarmOptions)
return cmd
}
func runInit(dockerCli *client.DockerCli, opts initOptions) error {
func runInit(dockerCli *client.DockerCli, flags *pflag.FlagSet, opts initOptions) error {
client := dockerCli.Client()
ctx := context.Background()
req := swarm.InitRequest{
ListenAddr: opts.listenAddr.String(),
AdvertiseAddr: opts.advertiseAddr,
ForceNewCluster: opts.forceNewCluster,
Spec: opts.swarmOptions.ToSpec(),
}
req.Spec.AcceptancePolicy.Policies = opts.autoAccept.Policies(opts.secret)
nodeID, err := client.SwarmInit(ctx, req)
if err != nil {
if strings.Contains(err.Error(), "could not choose an IP address to advertise") || strings.Contains(err.Error(), "could not find the system's IP address") {
return errors.New(err.Error() + " - specify one with --advertise-addr")
}
return err
}
fmt.Printf("Swarm initialized: current node (%s) is now a manager.\n", nodeID)
fmt.Fprintf(dockerCli.Out(), "Swarm initialized: current node (%s) is now a manager.\n\n", nodeID)
if err := printJoinCommand(ctx, dockerCli, nodeID, true, false); err != nil {
return err
}
fmt.Fprint(dockerCli.Out(), "To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.\n\n")
return nil
}

View file

@ -1,56 +0,0 @@
package swarm
import (
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/api/client/inspect"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type inspectOptions struct {
format string
// pretty bool
}
func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts inspectOptions
cmd := &cobra.Command{
Use: "inspect [OPTIONS]",
Short: "Inspect the Swarm",
Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
// if opts.pretty && len(opts.format) > 0 {
// return fmt.Errorf("--format is incompatible with human friendly format")
// }
return runInspect(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given go template")
//flags.BoolVarP(&opts.pretty, "pretty", "h", false, "Print the information in a human friendly format.")
return cmd
}
func runInspect(dockerCli *client.DockerCli, opts inspectOptions) error {
client := dockerCli.Client()
ctx := context.Background()
swarm, err := client.SwarmInspect(ctx)
if err != nil {
return err
}
getRef := func(_ string) (interface{}, []byte, error) {
return swarm, nil, nil
}
// if !opts.pretty {
return inspect.Inspect(dockerCli.Out(), []string{""}, opts.format, getRef)
// }
//return printHumanFriendly(dockerCli.Out(), opts.refs, getRef)
}

View file

@ -2,6 +2,7 @@ package swarm
import (
"fmt"
"strings"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
@ -13,19 +14,19 @@ import (
type joinOptions struct {
remote string
listenAddr NodeAddrOption
manager bool
secret string
CACertHash string
// Not a NodeAddrOption because it has no default port.
advertiseAddr string
token string
}
func newJoinCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := joinOptions{
listenAddr: NodeAddrOption{addr: defaultListenAddr},
listenAddr: NewListenAddrOption(),
}
cmd := &cobra.Command{
Use: "join [OPTIONS] HOST:PORT",
Short: "Join a Swarm as a node and/or manager.",
Short: "Join a swarm as a node and/or manager",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.remote = args[0]
@ -34,10 +35,9 @@ func newJoinCommand(dockerCli *client.DockerCli) *cobra.Command {
}
flags := cmd.Flags()
flags.Var(&opts.listenAddr, "listen-addr", "Listen address")
flags.BoolVar(&opts.manager, "manager", false, "Try joining as a manager.")
flags.StringVar(&opts.secret, "secret", "", "Secret for node acceptance")
flags.StringVar(&opts.CACertHash, "ca-hash", "", "Hash of the Root Certificate Authority certificate used for trusted join")
flags.Var(&opts.listenAddr, flagListenAddr, "Listen address (format: <ip|interface>[:port])")
flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[:port])")
flags.StringVar(&opts.token, flagToken, "", "Token for entry into the swarm")
return cmd
}
@ -46,20 +46,30 @@ func runJoin(dockerCli *client.DockerCli, opts joinOptions) error {
ctx := context.Background()
req := swarm.JoinRequest{
Manager: opts.manager,
Secret: opts.secret,
ListenAddr: opts.listenAddr.String(),
RemoteAddrs: []string{opts.remote},
CACertHash: opts.CACertHash,
JoinToken: opts.token,
ListenAddr: opts.listenAddr.String(),
AdvertiseAddr: opts.advertiseAddr,
RemoteAddrs: []string{opts.remote},
}
err := client.SwarmJoin(ctx, req)
if err != nil {
return err
}
if opts.manager {
fmt.Fprintln(dockerCli.Out(), "This node joined a Swarm as a manager.")
} else {
fmt.Fprintln(dockerCli.Out(), "This node joined a Swarm as a worker.")
info, err := client.Info(ctx)
if err != nil {
return err
}
_, _, err = client.NodeInspectWithRaw(ctx, info.Swarm.NodeID)
if err != nil {
// TODO(aaronl): is there a better way to do this?
if strings.Contains(err.Error(), "This node is not a swarm manager.") {
fmt.Fprintln(dockerCli.Out(), "This node joined a swarm as a worker.")
}
} else {
fmt.Fprintln(dockerCli.Out(), "This node joined a swarm as a manager.")
}
return nil
}

View file

@ -0,0 +1,105 @@
package swarm
import (
"errors"
"fmt"
"github.com/spf13/cobra"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types/swarm"
"golang.org/x/net/context"
)
func newJoinTokenCommand(dockerCli *client.DockerCli) *cobra.Command {
var rotate, quiet bool
cmd := &cobra.Command{
Use: "join-token [-q] [--rotate] (worker|manager)",
Short: "Manage join tokens",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
worker := args[0] == "worker"
manager := args[0] == "manager"
if !worker && !manager {
return errors.New("unknown role " + args[0])
}
client := dockerCli.Client()
ctx := context.Background()
if rotate {
var flags swarm.UpdateFlags
swarm, err := client.SwarmInspect(ctx)
if err != nil {
return err
}
flags.RotateWorkerToken = worker
flags.RotateManagerToken = manager
err = client.SwarmUpdate(ctx, swarm.Version, swarm.Spec, flags)
if err != nil {
return err
}
if !quiet {
fmt.Fprintf(dockerCli.Out(), "Succesfully rotated %s join token.\n\n", args[0])
}
}
swarm, err := client.SwarmInspect(ctx)
if err != nil {
return err
}
if quiet {
if worker {
fmt.Fprintln(dockerCli.Out(), swarm.JoinTokens.Worker)
} else {
fmt.Fprintln(dockerCli.Out(), swarm.JoinTokens.Manager)
}
} else {
info, err := client.Info(ctx)
if err != nil {
return err
}
return printJoinCommand(ctx, dockerCli, info.Swarm.NodeID, worker, manager)
}
return nil
},
}
flags := cmd.Flags()
flags.BoolVar(&rotate, flagRotate, false, "Rotate join token")
flags.BoolVarP(&quiet, flagQuiet, "q", false, "Only display token")
return cmd
}
func printJoinCommand(ctx context.Context, dockerCli *client.DockerCli, nodeID string, worker bool, manager bool) error {
client := dockerCli.Client()
swarm, err := client.SwarmInspect(ctx)
if err != nil {
return err
}
node, _, err := client.NodeInspectWithRaw(ctx, nodeID)
if err != nil {
return err
}
if node.ManagerStatus != nil {
if worker {
fmt.Fprintf(dockerCli.Out(), "To add a worker to this swarm, run the following command:\n\n docker swarm join \\\n --token %s \\\n %s\n\n", swarm.JoinTokens.Worker, node.ManagerStatus.Addr)
}
if manager {
fmt.Fprintf(dockerCli.Out(), "To add a manager to this swarm, run the following command:\n\n docker swarm join \\\n --token %s \\\n %s\n\n", swarm.JoinTokens.Manager, node.ManagerStatus.Addr)
}
}
return nil
}

View file

@ -18,8 +18,8 @@ func newLeaveCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := leaveOptions{}
cmd := &cobra.Command{
Use: "leave",
Short: "Leave a Swarm.",
Use: "leave [OPTIONS]",
Short: "Leave the swarm (workers only)",
Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return runLeave(dockerCli, opts)
@ -27,7 +27,7 @@ func newLeaveCommand(dockerCli *client.DockerCli) *cobra.Command {
}
flags := cmd.Flags()
flags.BoolVar(&opts.force, "force", false, "Force leave ignoring warnings.")
flags.BoolVar(&opts.force, "force", false, "Force this node to leave the swarm, ignoring warnings")
return cmd
}
@ -39,6 +39,6 @@ func runLeave(dockerCli *client.DockerCli, opts leaveOptions) error {
return err
}
fmt.Fprintln(dockerCli.Out(), "Node left the default swarm.")
fmt.Fprintln(dockerCli.Out(), "Node left the swarm.")
return nil
}

View file

@ -1,26 +1,37 @@
package swarm
import (
"encoding/csv"
"errors"
"fmt"
"strings"
"time"
"github.com/docker/docker/opts"
"github.com/docker/engine-api/types/swarm"
"github.com/spf13/pflag"
)
const (
defaultListenAddr = "0.0.0.0:2377"
// WORKER constant for worker name
WORKER = "WORKER"
// MANAGER constant for manager name
MANAGER = "MANAGER"
flagCertExpiry = "cert-expiry"
flagDispatcherHeartbeat = "dispatcher-heartbeat"
flagListenAddr = "listen-addr"
flagAdvertiseAddr = "advertise-addr"
flagQuiet = "quiet"
flagRotate = "rotate"
flagToken = "token"
flagTaskHistoryLimit = "task-history-limit"
flagExternalCA = "external-ca"
)
var (
defaultPolicies = []swarm.Policy{
{Role: WORKER, Autoaccept: true},
{Role: MANAGER, Autoaccept: false},
}
)
type swarmOptions struct {
taskHistoryLimit int64
dispatcherHeartbeat time.Duration
nodeCertExpiry time.Duration
externalCA ExternalCAOption
}
// NodeAddrOption is a pflag.Value for listen and remote addresses
type NodeAddrOption struct {
@ -29,21 +40,16 @@ type NodeAddrOption struct {
// String prints the representation of this flag
func (a *NodeAddrOption) String() string {
return a.addr
return a.Value()
}
// Set the value for this flag
func (a *NodeAddrOption) Set(value string) error {
if !strings.Contains(value, ":") {
return fmt.Errorf("Invalud url, a host and port are required")
addr, err := opts.ParseTCPAddr(value, a.addr)
if err != nil {
return err
}
parts := strings.Split(value, ":")
if len(parts) != 2 {
return fmt.Errorf("Invalud url, too many colons")
}
a.addr = value
a.addr = addr
return nil
}
@ -52,69 +58,122 @@ func (a *NodeAddrOption) Type() string {
return "node-addr"
}
// Value returns the value of this option as addr:port
func (a *NodeAddrOption) Value() string {
return strings.TrimPrefix(a.addr, "tcp://")
}
// NewNodeAddrOption returns a new node address option
func NewNodeAddrOption() NodeAddrOption {
return NodeAddrOption{addr: defaultListenAddr}
func NewNodeAddrOption(addr string) NodeAddrOption {
return NodeAddrOption{addr}
}
// AutoAcceptOption is a value type for auto-accept policy
type AutoAcceptOption struct {
values map[string]bool
// NewListenAddrOption returns a NodeAddrOption with default values
func NewListenAddrOption() NodeAddrOption {
return NewNodeAddrOption(defaultListenAddr)
}
// String prints a string representation of this option
func (o *AutoAcceptOption) String() string {
keys := []string{}
for key := range o.values {
keys = append(keys, key)
}
return strings.Join(keys, " ")
// ExternalCAOption is a Value type for parsing external CA specifications.
type ExternalCAOption struct {
values []*swarm.ExternalCA
}
// Set sets a new value on this option
func (o *AutoAcceptOption) Set(value string) error {
value = strings.ToUpper(value)
switch value {
case "", "NONE":
if accept, ok := o.values[WORKER]; ok && accept {
return fmt.Errorf("value NONE is incompatible with %s", WORKER)
}
if accept, ok := o.values[MANAGER]; ok && accept {
return fmt.Errorf("value NONE is incompatible with %s", MANAGER)
}
o.values[WORKER] = false
o.values[MANAGER] = false
case WORKER, MANAGER:
if accept, ok := o.values[value]; ok && !accept {
return fmt.Errorf("value NONE is incompatible with %s", value)
}
o.values[value] = true
default:
return fmt.Errorf("must be one of %s, %s, NONE", WORKER, MANAGER)
// Set parses an external CA option.
func (m *ExternalCAOption) Set(value string) error {
parsed, err := parseExternalCA(value)
if err != nil {
return err
}
m.values = append(m.values, parsed)
return nil
}
// Type returns the type of this option
func (o *AutoAcceptOption) Type() string {
return "auto-accept"
// Type returns the type of this option.
func (m *ExternalCAOption) Type() string {
return "external-ca"
}
// Policies returns a representation of this option for the api
func (o *AutoAcceptOption) Policies(secret string) []swarm.Policy {
policies := []swarm.Policy{}
for _, p := range defaultPolicies {
if len(o.values) != 0 {
p.Autoaccept = o.values[string(p.Role)]
}
p.Secret = secret
policies = append(policies, p)
// String returns a string repr of this option.
func (m *ExternalCAOption) String() string {
externalCAs := []string{}
for _, externalCA := range m.values {
repr := fmt.Sprintf("%s: %s", externalCA.Protocol, externalCA.URL)
externalCAs = append(externalCAs, repr)
}
return policies
return strings.Join(externalCAs, ", ")
}
// NewAutoAcceptOption returns a new auto-accept option
func NewAutoAcceptOption() AutoAcceptOption {
return AutoAcceptOption{values: make(map[string]bool)}
// Value returns the external CAs
func (m *ExternalCAOption) Value() []*swarm.ExternalCA {
return m.values
}
// parseExternalCA parses an external CA specification from the command line,
// such as protocol=cfssl,url=https://example.com.
func parseExternalCA(caSpec string) (*swarm.ExternalCA, error) {
csvReader := csv.NewReader(strings.NewReader(caSpec))
fields, err := csvReader.Read()
if err != nil {
return nil, err
}
externalCA := swarm.ExternalCA{
Options: make(map[string]string),
}
var (
hasProtocol bool
hasURL bool
)
for _, field := range fields {
parts := strings.SplitN(field, "=", 2)
if len(parts) != 2 {
return nil, fmt.Errorf("invalid field '%s' must be a key=value pair", field)
}
key, value := parts[0], parts[1]
switch strings.ToLower(key) {
case "protocol":
hasProtocol = true
if strings.ToLower(value) == string(swarm.ExternalCAProtocolCFSSL) {
externalCA.Protocol = swarm.ExternalCAProtocolCFSSL
} else {
return nil, fmt.Errorf("unrecognized external CA protocol %s", value)
}
case "url":
hasURL = true
externalCA.URL = value
default:
externalCA.Options[key] = value
}
}
if !hasProtocol {
return nil, errors.New("the external-ca option needs a protocol= parameter")
}
if !hasURL {
return nil, errors.New("the external-ca option needs a url= parameter")
}
return &externalCA, nil
}
func addSwarmFlags(flags *pflag.FlagSet, opts *swarmOptions) {
flags.Int64Var(&opts.taskHistoryLimit, flagTaskHistoryLimit, 5, "Task history retention limit")
flags.DurationVar(&opts.dispatcherHeartbeat, flagDispatcherHeartbeat, time.Duration(5*time.Second), "Dispatcher heartbeat period")
flags.DurationVar(&opts.nodeCertExpiry, flagCertExpiry, time.Duration(90*24*time.Hour), "Validity period for node certificates")
flags.Var(&opts.externalCA, flagExternalCA, "Specifications of one or more certificate signing endpoints")
}
func (opts *swarmOptions) ToSpec() swarm.Spec {
spec := swarm.Spec{}
spec.Orchestration.TaskHistoryRetentionLimit = opts.taskHistoryLimit
spec.Dispatcher.HeartbeatPeriod = uint64(opts.dispatcherHeartbeat.Nanoseconds())
spec.CAConfig.NodeCertExpiry = opts.nodeCertExpiry
spec.CAConfig.ExternalCAs = opts.externalCA.Value()
return spec
}

View file

@ -0,0 +1,37 @@
package swarm
import (
"testing"
"github.com/docker/docker/pkg/testutil/assert"
)
func TestNodeAddrOptionSetHostAndPort(t *testing.T) {
opt := NewNodeAddrOption("old:123")
addr := "newhost:5555"
assert.NilError(t, opt.Set(addr))
assert.Equal(t, opt.Value(), addr)
}
func TestNodeAddrOptionSetHostOnly(t *testing.T) {
opt := NewListenAddrOption()
assert.NilError(t, opt.Set("newhost"))
assert.Equal(t, opt.Value(), "newhost:2377")
}
func TestNodeAddrOptionSetHostOnlyIPv6(t *testing.T) {
opt := NewListenAddrOption()
assert.NilError(t, opt.Set("::1"))
assert.Equal(t, opt.Value(), "[::1]:2377")
}
func TestNodeAddrOptionSetPortOnly(t *testing.T) {
opt := NewListenAddrOption()
assert.NilError(t, opt.Set(":4545"))
assert.Equal(t, opt.Value(), "0.0.0.0:4545")
}
func TestNodeAddrOptionSetInvalidFormat(t *testing.T) {
opt := NewListenAddrOption()
assert.Error(t, opt.Set("http://localhost:4545"), "Invalid")
}

Some files were not shown because too many files have changed in this diff Show more