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
12336 changed files with 808769 additions and 2224000 deletions

View file

@ -1,21 +0,0 @@
{
"name": "moby",
"build": {
"context": "..",
"dockerfile": "../Dockerfile",
"target": "devcontainer"
},
"workspaceFolder": "/go/src/github.com/docker/docker",
"workspaceMount": "source=${localWorkspaceFolder},target=/go/src/github.com/docker/docker,type=bind,consistency=cached",
"remoteUser": "root",
"runArgs": ["--privileged"],
"customizations": {
"vscode": {
"extensions": [
"golang.go"
]
}
}
}

View file

@ -1,4 +1,3 @@
.git bundles
bundles/ .gopath
cli/winresources/**/winres.json vendor/pkg
cli/winresources/**/*.syso

3
.gitattributes vendored
View file

@ -1,3 +0,0 @@
Dockerfile* linguist-language=Dockerfile
vendor.mod linguist-language=Go-Module
vendor.sum linguist-language=Go-Checksums

13
.github/CODEOWNERS vendored
View file

@ -1,13 +0,0 @@
# GitHub code owners
# See https://help.github.com/articles/about-codeowners/
#
# KEEP THIS FILE SORTED. Order is important. Last match takes precedence.
builder/** @tonistiigi
contrib/mkimage/** @tianon
daemon/graphdriver/overlay2/** @dmcgowan
daemon/graphdriver/windows/** @johnstep
daemon/logger/awslogs/** @samuelkarp
hack/** @tianon
plugin/** @cpuguy83
project/** @thaJeztah

51
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,51 @@
<!--
If you are reporting a new issue, make sure that we do not have any duplicates
already open. You can ensure this by searching the issue list for this
repository. If there is a duplicate, please close your issue and add a comment
to the existing issue instead.
If you suspect your issue is a bug, please edit your issue description to
include the BUG REPORT INFORMATION shown below. If you fail to provide this
information within 7 days, we cannot debug your issue and will close it. We
will, however, reopen it if you later provide the information.
For more information about reporting issues, see
https://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues
---------------------------------------------------
BUG REPORT INFORMATION
---------------------------------------------------
Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
-->
**Output of `docker version`:**
```
(paste your output here)
```
**Output of `docker info`:**
```
(paste your output here)
```
**Additional environment details (AWS, VirtualBox, physical, etc.):**
**Steps to reproduce the issue:**
1.
2.
3.
**Describe the results you received:**
**Describe the results you expected:**
**Additional information you deem important (e.g. issue happens only occasionally):**

View file

@ -1,146 +0,0 @@
name: Bug report
description: Create a report to help us improve
labels:
- kind/bug
- status/0-triage
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report a bug!
If this is a security issue please report it to the [Docker Security team](mailto:security@docker.com).
- type: textarea
id: description
attributes:
label: Description
description: Please give a clear and concise description of the bug
validations:
required: true
- type: textarea
id: repro
attributes:
label: Reproduce
description: Steps to reproduce the bug
placeholder: |
1. docker run ...
2. docker kill ...
3. docker rm ...
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: What is the expected behavior?
placeholder: |
E.g. "`docker rm` should remove the container and cleanup all associated data"
- type: textarea
id: version
attributes:
label: docker version
description: Output of `docker version`
render: bash
placeholder: |
Client:
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c70180fde3601def79a59cc3e996aa553c9b9
Built: Mon Jun 6 21:36:39 UTC 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b84221c8560e7a3dee2a653353429e7628424
Built: Mon Jun 6 22:32:38 2022
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit: a916309fff0f838eb94e928713dbc3c0d0ac7aa4
docker-init:
Version: 0.19.0
GitCommit:
validations:
required: true
- type: textarea
id: info
attributes:
label: docker info
description: Output of `docker info`
render: bash
placeholder: |
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., 0.8.2)
compose: Docker Compose (Docker Inc., 2.6.0)
Server:
Containers: 4
Running: 2
Paused: 0
Stopped: 2
Images: 80
Server Version: 20.10.17
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: false
userxattr: false
Logging Driver: local
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
Default Runtime: runc
Init Binary: docker-init
containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc version: a916309fff0f838eb94e928713dbc3c0d0ac7aa4
init version:
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 5.13.0-1031-azure
Operating System: Ubuntu 20.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.63GiB
Name: dev
ID: UC44:2RFL:7NQ5:GGFW:34O5:DYRE:CLOH:VLGZ:64AZ:GFXC:PY6H:SAHY
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 46
Goroutines: 134
System Time: 2022-07-06T18:07:54.812439392Z
EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: true
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional Info
description: Additional info you want to provide such as logs, system info, environment, etc.
validations:
required: false

View file

@ -1,8 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Security and Vulnerabilities
url: https://github.com/moby/moby/blob/master/SECURITY.md
about: Please report any security issues or vulnerabilities responsibly to the Docker security team. Please do not use the public issue tracker.
- name: Questions and Discussions
url: https://github.com/moby/moby/discussions/new
about: Use Github Discussions to ask questions and/or open discussion topics.

View file

@ -1,13 +0,0 @@
name: Feature request
description: Missing functionality? Come tell us about it!
labels:
- kind/feature
- status/0-triage
body:
- type: textarea
id: description
attributes:
label: Description
description: What is the feature you want to see?
validations:
required: true

View file

@ -1,6 +1,6 @@
<!-- <!--
Please make sure you've read and understood our contributing guidelines; Please make sure you've read and understood our contributing guidelines;
https://github.com/moby/moby/blob/master/CONTRIBUTING.md https://github.com/docker/docker/blob/master/CONTRIBUTING.md
** Make sure all your commits include a signature generated with `git commit -s` ** ** Make sure all your commits include a signature generated with `git commit -s` **
@ -22,12 +22,9 @@ Please provide the following information:
**- Description for the changelog** **- Description for the changelog**
<!-- <!--
Write a short (one line) summary that describes the changes in this Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog. pull request for inclusion in the changelog:
It must be placed inside the below triple backticks section:
--> -->
```markdown changelog
```
**- A picture of a cute animal (not mandatory but encouraged)** **- A picture of a cute animal (not mandatory but encouraged)**

View file

@ -1,27 +0,0 @@
name: 'Setup Runner'
description: 'Composite action to set up the GitHub Runner for jobs in the test.yml workflow'
runs:
using: composite
steps:
- run: |
sudo modprobe ip_vs
sudo modprobe ipv6
sudo modprobe ip6table_filter
sudo modprobe -r overlay
sudo modprobe overlay redirect_dir=off
shell: bash
- run: |
if [ ! -e /etc/docker/daemon.json ]; then
echo '{}' | sudo tee /etc/docker/daemon.json >/dev/null
fi
DOCKERD_CONFIG=$(jq '.+{"experimental":true,"live-restore":true,"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' /etc/docker/daemon.json)
sudo tee /etc/docker/daemon.json <<<"$DOCKERD_CONFIG" >/dev/null
sudo service docker restart
shell: bash
- run: |
./contrib/check-config.sh || true
shell: bash
- run: |
docker info
shell: bash

View file

@ -1,14 +0,0 @@
name: 'Setup Tracing'
description: 'Composite action to set up the tracing for test jobs'
runs:
using: composite
steps:
- run: |
set -e
# Jaeger is set up on Windows through an inline run step. If you update Jaeger here, don't forget to update
# the version set in .github/workflows/.windows.yml.
docker run -d --net=host --name jaeger -e COLLECTOR_OTLP_ENABLED=true jaegertracing/all-in-one:1.46
docker0_ip="$(ip -f inet addr show docker0 | grep -Po 'inet \K[\d.]+')"
echo "OTEL_EXPORTER_OTLP_ENDPOINT=http://${docker0_ip}:4318" >> "${GITHUB_ENV}"
shell: bash

View file

@ -1,48 +0,0 @@
# reusable workflow
name: .dco
# TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025
on:
workflow_call:
env:
ALPINE_VERSION: 3.16
jobs:
run:
runs-on: ubuntu-20.04
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Dump context
uses: actions/github-script@v7
with:
script: |
console.log(JSON.stringify(context, null, 2));
-
name: Get base ref
id: base-ref
uses: actions/github-script@v7
with:
result-encoding: string
script: |
if (/^refs\/pull\//.test(context.ref) && context.payload?.pull_request?.base?.ref != undefined) {
return context.payload.pull_request.base.ref;
}
return context.ref.replace(/^refs\/heads\//g, '');
-
name: Validate
run: |
docker run --rm \
-v "$(pwd):/workspace" \
-e VALIDATE_REPO \
-e VALIDATE_BRANCH \
alpine:${{ env.ALPINE_VERSION }} sh -c 'apk add --no-cache -q bash git openssh-client && git config --system --add safe.directory /workspace && cd /workspace && hack/validate/dco'
env:
VALIDATE_REPO: ${{ github.server_url }}/${{ github.repository }}.git
VALIDATE_BRANCH: ${{ steps.base-ref.outputs.result }}

View file

@ -1,35 +0,0 @@
# reusable workflow
name: .test-prepare
# TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025
on:
workflow_call:
outputs:
matrix:
description: Test matrix
value: ${{ jobs.run.outputs.matrix }}
jobs:
run:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Create matrix
id: set
uses: actions/github-script@v7
with:
script: |
let matrix = ['graphdriver'];
if ("${{ contains(github.event.pull_request.labels.*.name, 'containerd-integration') || github.event_name != 'pull_request' }}" == "true") {
matrix.push('snapshotter');
}
await core.group(`Set matrix`, async () => {
core.info(`matrix: ${JSON.stringify(matrix)}`);
core.setOutput('matrix', JSON.stringify(matrix));
});

View file

@ -1,445 +0,0 @@
# reusable workflow
name: .test
# TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025
on:
workflow_call:
inputs:
storage:
required: true
type: string
default: "graphdriver"
env:
GO_VERSION: "1.21.9"
GOTESTLIST_VERSION: v0.3.1
TESTSTAT_VERSION: v0.1.25
ITG_CLI_MATRIX_SIZE: 6
DOCKER_EXPERIMENTAL: 1
DOCKER_GRAPHDRIVER: ${{ inputs.storage == 'snapshotter' && 'overlayfs' || 'overlay2' }}
TEST_INTEGRATION_USE_SNAPSHOTTER: ${{ inputs.storage == 'snapshotter' && '1' || '' }}
jobs:
unit:
runs-on: ubuntu-20.04
continue-on-error: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 120
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up runner
uses: ./.github/actions/setup-runner
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build dev image
uses: docker/bake-action@v4
with:
targets: dev
set: |
dev.cache-from=type=gha,scope=dev
-
name: Test
run: |
make -o build test-unit
-
name: Prepare reports
if: always()
run: |
mkdir -p bundles /tmp/reports
find bundles -path '*/root/*overlay2' -prune -o -type f \( -name '*-report.json' -o -name '*.log' -o -name '*.out' -o -name '*.prof' -o -name '*-report.xml' \) -print | xargs sudo tar -czf /tmp/reports.tar.gz
tar -xzf /tmp/reports.tar.gz -C /tmp/reports
sudo chown -R $(id -u):$(id -g) /tmp/reports
tree -nh /tmp/reports
-
name: Send to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./bundles
env_vars: RUNNER_OS
flags: unit
token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533
-
name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-unit-${{ inputs.storage }}
path: /tmp/reports/*
retention-days: 1
unit-report:
runs-on: ubuntu-20.04
continue-on-error: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 10
if: always()
needs:
- unit
steps:
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Download reports
uses: actions/download-artifact@v4
with:
name: test-reports-unit-${{ inputs.storage }}
path: /tmp/reports
-
name: Install teststat
run: |
go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
-
name: Create summary
run: |
find /tmp/reports -type f -name '*-go-test-report.json' -exec teststat -markdown {} \+ >> $GITHUB_STEP_SUMMARY
docker-py:
runs-on: ubuntu-20.04
continue-on-error: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 120
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up runner
uses: ./.github/actions/setup-runner
-
name: Set up tracing
uses: ./.github/actions/setup-tracing
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build dev image
uses: docker/bake-action@v4
with:
targets: dev
set: |
dev.cache-from=type=gha,scope=dev
-
name: Test
run: |
make -o build test-docker-py
-
name: Prepare reports
if: always()
run: |
mkdir -p bundles /tmp/reports
find bundles -path '*/root/*overlay2' -prune -o -type f \( -name '*-report.json' -o -name '*.log' -o -name '*.out' -o -name '*.prof' -o -name '*-report.xml' \) -print | xargs sudo tar -czf /tmp/reports.tar.gz
tar -xzf /tmp/reports.tar.gz -C /tmp/reports
sudo chown -R $(id -u):$(id -g) /tmp/reports
tree -nh /tmp/reports
curl -sSLf localhost:16686/api/traces?service=integration-test-client > /tmp/reports/jaeger-trace.json
-
name: Test daemon logs
if: always()
run: |
cat bundles/test-docker-py/docker.log
-
name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-docker-py-${{ inputs.storage }}
path: /tmp/reports/*
retention-days: 1
integration-flaky:
runs-on: ubuntu-20.04
continue-on-error: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 120
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up runner
uses: ./.github/actions/setup-runner
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build dev image
uses: docker/bake-action@v4
with:
targets: dev
set: |
dev.cache-from=type=gha,scope=dev
-
name: Test
run: |
make -o build test-integration-flaky
env:
TEST_SKIP_INTEGRATION_CLI: 1
integration:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
mode:
- ""
- rootless
- systemd
#- rootless-systemd FIXME: https://github.com/moby/moby/issues/44084
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up runner
uses: ./.github/actions/setup-runner
-
name: Set up tracing
uses: ./.github/actions/setup-tracing
-
name: Prepare
run: |
CACHE_DEV_SCOPE=dev
if [[ "${{ matrix.mode }}" == *"rootless"* ]]; then
echo "DOCKER_ROOTLESS=1" >> $GITHUB_ENV
fi
if [[ "${{ matrix.mode }}" == *"systemd"* ]]; then
echo "SYSTEMD=true" >> $GITHUB_ENV
CACHE_DEV_SCOPE="${CACHE_DEV_SCOPE}systemd"
fi
echo "CACHE_DEV_SCOPE=${CACHE_DEV_SCOPE}" >> $GITHUB_ENV
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build dev image
uses: docker/bake-action@v4
with:
targets: dev
set: |
dev.cache-from=type=gha,scope=${{ env.CACHE_DEV_SCOPE }}
-
name: Test
run: |
make -o build test-integration
env:
TEST_SKIP_INTEGRATION_CLI: 1
TESTCOVERAGE: 1
-
name: Prepare reports
if: always()
run: |
reportsName=${{ matrix.os }}
if [ -n "${{ matrix.mode }}" ]; then
reportsName="$reportsName-${{ matrix.mode }}"
fi
reportsPath="/tmp/reports/$reportsName"
echo "TESTREPORTS_NAME=$reportsName" >> $GITHUB_ENV
mkdir -p bundles $reportsPath
find bundles -path '*/root/*overlay2' -prune -o -type f \( -name '*-report.json' -o -name '*.log' -o -name '*.out' -o -name '*.prof' -o -name '*-report.xml' \) -print | xargs sudo tar -czf /tmp/reports.tar.gz
tar -xzf /tmp/reports.tar.gz -C $reportsPath
sudo chown -R $(id -u):$(id -g) $reportsPath
tree -nh $reportsPath
curl -sSLf localhost:16686/api/traces?service=integration-test-client > $reportsPath/jaeger-trace.json
-
name: Send to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./bundles/test-integration
env_vars: RUNNER_OS
flags: integration,${{ matrix.mode }}
token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533
-
name: Test daemon logs
if: always()
run: |
cat bundles/test-integration/docker.log
-
name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-integration-${{ inputs.storage }}-${{ env.TESTREPORTS_NAME }}
path: /tmp/reports/*
retention-days: 1
integration-report:
runs-on: ubuntu-20.04
continue-on-error: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 10
if: always()
needs:
- integration
steps:
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Download reports
uses: actions/download-artifact@v4
with:
path: /tmp/reports
pattern: test-reports-integration-${{ inputs.storage }}-*
merge-multiple: true
-
name: Install teststat
run: |
go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
-
name: Create summary
run: |
find /tmp/reports -type f -name '*-go-test-report.json' -exec teststat -markdown {} \+ >> $GITHUB_STEP_SUMMARY
integration-cli-prepare:
runs-on: ubuntu-20.04
continue-on-error: ${{ github.event_name != 'pull_request' }}
outputs:
matrix: ${{ steps.tests.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Install gotestlist
run:
go install github.com/crazy-max/gotestlist/cmd/gotestlist@${{ env.GOTESTLIST_VERSION }}
-
name: Create matrix
id: tests
working-directory: ./integration-cli
run: |
# This step creates a matrix for integration-cli tests. Tests suites
# are distributed in integration-cli job through a matrix. There is
# also overrides being added to the matrix like "./..." to run
# "Test integration" step exclusively and specific tests suites that
# take a long time to run.
matrix="$(gotestlist -d ${{ env.ITG_CLI_MATRIX_SIZE }} -o "./..." -o "DockerSwarmSuite" -o "DockerNetworkSuite|DockerExternalVolumeSuite" ./...)"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
-
name: Show matrix
run: |
echo ${{ steps.tests.outputs.matrix }}
integration-cli:
runs-on: ubuntu-20.04
continue-on-error: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 120
needs:
- integration-cli-prepare
strategy:
fail-fast: false
matrix:
test: ${{ fromJson(needs.integration-cli-prepare.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up runner
uses: ./.github/actions/setup-runner
-
name: Set up tracing
uses: ./.github/actions/setup-tracing
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build dev image
uses: docker/bake-action@v4
with:
targets: dev
set: |
dev.cache-from=type=gha,scope=dev
-
name: Test
run: |
make -o build test-integration
env:
TEST_SKIP_INTEGRATION: 1
TESTCOVERAGE: 1
TESTFLAGS: "-test.run (${{ matrix.test }})/"
-
name: Prepare reports
if: always()
run: |
reportsName=$(echo -n "${{ matrix.test }}" | sha256sum | cut -d " " -f 1)
reportsPath=/tmp/reports/$reportsName
echo "TESTREPORTS_NAME=$reportsName" >> $GITHUB_ENV
mkdir -p bundles $reportsPath
echo "${{ matrix.test }}" | tr -s '|' '\n' | tee -a "$reportsPath/tests.txt"
find bundles -path '*/root/*overlay2' -prune -o -type f \( -name '*-report.json' -o -name '*.log' -o -name '*.out' -o -name '*.prof' -o -name '*-report.xml' \) -print | xargs sudo tar -czf /tmp/reports.tar.gz
tar -xzf /tmp/reports.tar.gz -C $reportsPath
sudo chown -R $(id -u):$(id -g) $reportsPath
tree -nh $reportsPath
curl -sSLf localhost:16686/api/traces?service=integration-test-client > $reportsPath/jaeger-trace.json
-
name: Send to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./bundles/test-integration
env_vars: RUNNER_OS
flags: integration-cli
token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533
-
name: Test daemon logs
if: always()
run: |
cat bundles/test-integration/docker.log
-
name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-integration-cli-${{ inputs.storage }}-${{ env.TESTREPORTS_NAME }}
path: /tmp/reports/*
retention-days: 1
integration-cli-report:
runs-on: ubuntu-20.04
continue-on-error: ${{ github.event_name != 'pull_request' }}
timeout-minutes: 10
if: always()
needs:
- integration-cli
steps:
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Download reports
uses: actions/download-artifact@v4
with:
path: /tmp/reports
pattern: test-reports-integration-cli-${{ inputs.storage }}-*
merge-multiple: true
-
name: Install teststat
run: |
go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
-
name: Create summary
run: |
find /tmp/reports -type f -name '*-go-test-report.json' -exec teststat -markdown {} \+ >> $GITHUB_STEP_SUMMARY

View file

@ -1,551 +0,0 @@
# reusable workflow
name: .windows
# TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025
on:
workflow_call:
inputs:
os:
required: true
type: string
storage:
required: true
type: string
default: "graphdriver"
send_coverage:
required: false
type: boolean
default: false
env:
GO_VERSION: "1.21.9"
GOTESTLIST_VERSION: v0.3.1
TESTSTAT_VERSION: v0.1.25
WINDOWS_BASE_IMAGE: mcr.microsoft.com/windows/servercore
WINDOWS_BASE_TAG_2019: ltsc2019
WINDOWS_BASE_TAG_2022: ltsc2022
TEST_IMAGE_NAME: moby:test
TEST_CTN_NAME: moby
DOCKER_BUILDKIT: 0
ITG_CLI_MATRIX_SIZE: 6
jobs:
build:
runs-on: ${{ inputs.os }}
env:
GOPATH: ${{ github.workspace }}\go
GOBIN: ${{ github.workspace }}\go\bin
BIN_OUT: ${{ github.workspace }}\out
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/docker/docker
-
name: Env
run: |
Get-ChildItem Env: | Out-String
-
name: Init
run: |
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
If ("${{ inputs.os }}" -eq "windows-2019") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
-
name: Cache
uses: actions/cache@v4
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
${{ github.workspace }}\go-build
${{ env.GOPATH }}\pkg\mod
key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
restore-keys: |
${{ inputs.os }}-${{ github.job }}-
-
name: Docker info
run: |
docker info
-
name: Build base image
run: |
& docker build `
--build-arg WINDOWS_BASE_IMAGE `
--build-arg WINDOWS_BASE_IMAGE_TAG `
--build-arg GO_VERSION `
-t ${{ env.TEST_IMAGE_NAME }} `
-f Dockerfile.windows .
-
name: Build binaries
run: |
& docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
-v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
-v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -Daemon -Client
-
name: Copy artifacts
run: |
New-Item -ItemType "directory" -Path "${{ env.BIN_OUT }}"
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\docker\docker\bundles\docker.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\docker\docker\bundles\dockerd.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\bin\gotestsum.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd-shim-runhcs-v1.exe" ${{ env.BIN_OUT }}\
-
name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ inputs.storage }}-${{ inputs.os }}
path: ${{ env.BIN_OUT }}/*
if-no-files-found: error
retention-days: 2
unit-test:
runs-on: ${{ inputs.os }}
timeout-minutes: 120
env:
GOPATH: ${{ github.workspace }}\go
GOBIN: ${{ github.workspace }}\go\bin
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/docker/docker
-
name: Env
run: |
Get-ChildItem Env: | Out-String
-
name: Init
run: |
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
New-Item -ItemType "directory" -Path "bundles"
If ("${{ inputs.os }}" -eq "windows-2019") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
-
name: Cache
uses: actions/cache@v4
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
${{ github.workspace }}\go-build
${{ env.GOPATH }}\pkg\mod
key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
restore-keys: |
${{ inputs.os }}-${{ github.job }}-
-
name: Docker info
run: |
docker info
-
name: Build base image
run: |
& docker build `
--build-arg WINDOWS_BASE_IMAGE `
--build-arg WINDOWS_BASE_IMAGE_TAG `
--build-arg GO_VERSION `
-t ${{ env.TEST_IMAGE_NAME }} `
-f Dockerfile.windows .
-
name: Test
run: |
& docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
-v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
-v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
-v "${{ env.GOPATH }}\src\github.com\docker\docker\bundles:C:\gopath\src\github.com\docker\docker\bundles" `
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit
-
name: Send to Codecov
if: inputs.send_coverage
uses: codecov/codecov-action@v4
with:
working-directory: ${{ env.GOPATH }}\src\github.com\docker\docker
directory: bundles
env_vars: RUNNER_OS
flags: unit
token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533
-
name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.os }}-${{ inputs.storage }}-unit-reports
path: ${{ env.GOPATH }}\src\github.com\docker\docker\bundles\*
retention-days: 1
unit-test-report:
runs-on: ubuntu-latest
if: always()
needs:
- unit-test
steps:
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.os }}-${{ inputs.storage }}-unit-reports
path: /tmp/artifacts
-
name: Install teststat
run: |
go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
-
name: Create summary
run: |
find /tmp/artifacts -type f -name '*-go-test-report.json' -exec teststat -markdown {} \+ >> $GITHUB_STEP_SUMMARY
integration-test-prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.tests.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Install gotestlist
run:
go install github.com/crazy-max/gotestlist/cmd/gotestlist@${{ env.GOTESTLIST_VERSION }}
-
name: Create matrix
id: tests
working-directory: ./integration-cli
run: |
# This step creates a matrix for integration-cli tests. Tests suites
# are distributed in integration-test job through a matrix. There is
# also an override being added to the matrix like "./..." to run
# "Test integration" step exclusively.
matrix="$(gotestlist -d ${{ env.ITG_CLI_MATRIX_SIZE }} -o "./..." ./...)"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
-
name: Show matrix
run: |
echo ${{ steps.tests.outputs.matrix }}
integration-test:
runs-on: ${{ inputs.os }}
continue-on-error: ${{ inputs.storage == 'snapshotter' && github.event_name != 'pull_request' }}
timeout-minutes: 120
needs:
- build
- integration-test-prepare
strategy:
fail-fast: false
matrix:
storage:
- ${{ inputs.storage }}
runtime:
- builtin
- containerd
test: ${{ fromJson(needs.integration-test-prepare.outputs.matrix) }}
exclude:
- storage: snapshotter
runtime: builtin
env:
GOPATH: ${{ github.workspace }}\go
GOBIN: ${{ github.workspace }}\go\bin
BIN_OUT: ${{ github.workspace }}\out
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/docker/docker
-
name: Set up Jaeger
run: |
# Jaeger is set up on Linux through the setup-tracing action. If you update Jaeger here, don't forget to
# update the version set in .github/actions/setup-tracing/action.yml.
Invoke-WebRequest -Uri "https://github.com/jaegertracing/jaeger/releases/download/v1.46.0/jaeger-1.46.0-windows-amd64.tar.gz" -OutFile ".\jaeger-1.46.0-windows-amd64.tar.gz"
tar -zxvf ".\jaeger-1.46.0-windows-amd64.tar.gz"
Start-Process '.\jaeger-1.46.0-windows-amd64\jaeger-all-in-one.exe'
echo "OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
-
name: Env
run: |
Get-ChildItem Env: | Out-String
-
name: Download artifacts
uses: actions/download-artifact@v4
with:
name: build-${{ inputs.storage }}-${{ inputs.os }}
path: ${{ env.BIN_OUT }}
-
name: Init
run: |
New-Item -ItemType "directory" -Path "bundles"
If ("${{ inputs.os }}" -eq "windows-2019") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
Write-Output "${{ env.BIN_OUT }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$testName = ([System.BitConverter]::ToString((New-Object System.Security.Cryptography.SHA256Managed).ComputeHash([System.Text.Encoding]::UTF8.GetBytes("${{ matrix.test }}"))) -replace '-').ToLower()
echo "TESTREPORTS_NAME=$testName" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
-
# removes docker service that is currently installed on the runner. we
# could use Uninstall-Package but not yet available on Windows runners.
# more info: https://github.com/actions/virtual-environments/blob/d3a5bad25f3b4326c5666bab0011ac7f1beec95e/images/win/scripts/Installers/Install-Docker.ps1#L11
name: Removing current daemon
run: |
if (Get-Service docker -ErrorAction SilentlyContinue) {
$dockerVersion = (docker version -f "{{.Server.Version}}")
Write-Host "Current installed Docker version: $dockerVersion"
# remove service
Stop-Service -Force -Name docker
Remove-Service -Name docker
# removes event log entry. we could use "Remove-EventLog -LogName -Source docker"
# but this cmd is not available atm
$ErrorActionPreference = "SilentlyContinue"
& reg delete "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\docker" /f 2>&1 | Out-Null
$ErrorActionPreference = "Stop"
Write-Host "Service removed"
}
-
name: Starting containerd
if: matrix.runtime == 'containerd'
run: |
Write-Host "Generating config"
& "${{ env.BIN_OUT }}\containerd.exe" config default | Out-File "$env:TEMP\ctn.toml" -Encoding ascii
Write-Host "Creating service"
New-Item -ItemType Directory "$env:TEMP\ctn-root" -ErrorAction SilentlyContinue | Out-Null
New-Item -ItemType Directory "$env:TEMP\ctn-state" -ErrorAction SilentlyContinue | Out-Null
Start-Process -Wait "${{ env.BIN_OUT }}\containerd.exe" `
-ArgumentList "--log-level=debug", `
"--config=$env:TEMP\ctn.toml", `
"--address=\\.\pipe\containerd-containerd", `
"--root=$env:TEMP\ctn-root", `
"--state=$env:TEMP\ctn-state", `
"--log-file=$env:TEMP\ctn.log", `
"--register-service"
Write-Host "Starting service"
Start-Service -Name containerd
Start-Sleep -Seconds 5
Write-Host "Service started successfully!"
-
name: Starting test daemon
run: |
Write-Host "Creating service"
If ("${{ matrix.runtime }}" -eq "containerd") {
$runtimeArg="--containerd=\\.\pipe\containerd-containerd"
echo "DOCKER_WINDOWS_CONTAINERD_RUNTIME=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
New-Item -ItemType Directory "$env:TEMP\moby-root" -ErrorAction SilentlyContinue | Out-Null
New-Item -ItemType Directory "$env:TEMP\moby-exec" -ErrorAction SilentlyContinue | Out-Null
Start-Process -Wait -NoNewWindow "${{ env.BIN_OUT }}\dockerd" `
-ArgumentList $runtimeArg, "--debug", `
"--host=npipe:////./pipe/docker_engine", `
"--data-root=$env:TEMP\moby-root", `
"--exec-root=$env:TEMP\moby-exec", `
"--pidfile=$env:TEMP\docker.pid", `
"--register-service"
If ("${{ inputs.storage }}" -eq "snapshotter") {
# Make the env-var visible to the service-managed dockerd, as there's no CLI flag for this option.
& reg add "HKLM\SYSTEM\CurrentControlSet\Services\docker" /v Environment /t REG_MULTI_SZ /s '@' /d TEST_INTEGRATION_USE_SNAPSHOTTER=1
echo "TEST_INTEGRATION_USE_SNAPSHOTTER=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
Write-Host "Starting service"
Start-Service -Name docker
Write-Host "Service started successfully!"
-
name: Waiting for test daemon to start
run: |
$tries=20
Write-Host "Waiting for the test daemon to start..."
While ($true) {
$ErrorActionPreference = "SilentlyContinue"
& "${{ env.BIN_OUT }}\docker" version
$ErrorActionPreference = "Stop"
If ($LastExitCode -eq 0) {
break
}
$tries--
If ($tries -le 0) {
Throw "Failed to get a response from the daemon"
}
Write-Host -NoNewline "."
Start-Sleep -Seconds 1
}
Write-Host "Test daemon started and replied!"
env:
DOCKER_HOST: npipe:////./pipe/docker_engine
-
name: Docker info
run: |
& "${{ env.BIN_OUT }}\docker" info
env:
DOCKER_HOST: npipe:////./pipe/docker_engine
-
name: Building contrib/busybox
run: |
& "${{ env.BIN_OUT }}\docker" build -t busybox `
--build-arg WINDOWS_BASE_IMAGE `
--build-arg WINDOWS_BASE_IMAGE_TAG `
.\contrib\busybox\
env:
DOCKER_HOST: npipe:////./pipe/docker_engine
-
name: List images
run: |
& "${{ env.BIN_OUT }}\docker" images
env:
DOCKER_HOST: npipe:////./pipe/docker_engine
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Test integration
if: matrix.test == './...'
run: |
.\hack\make.ps1 -TestIntegration
env:
DOCKER_HOST: npipe:////./pipe/docker_engine
GO111MODULE: "off"
TEST_CLIENT_BINARY: ${{ env.BIN_OUT }}\docker
-
name: Test integration-cli
if: matrix.test != './...'
run: |
.\hack\make.ps1 -TestIntegrationCli
env:
DOCKER_HOST: npipe:////./pipe/docker_engine
GO111MODULE: "off"
TEST_CLIENT_BINARY: ${{ env.BIN_OUT }}\docker
INTEGRATION_TESTRUN: ${{ matrix.test }}
-
name: Send to Codecov
if: inputs.send_coverage
uses: codecov/codecov-action@v4
with:
working-directory: ${{ env.GOPATH }}\src\github.com\docker\docker
directory: bundles
env_vars: RUNNER_OS
flags: integration,${{ matrix.runtime }}
token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533
-
name: Docker info
run: |
& "${{ env.BIN_OUT }}\docker" info
env:
DOCKER_HOST: npipe:////./pipe/docker_engine
-
name: Stop containerd
if: always() && matrix.runtime == 'containerd'
run: |
$ErrorActionPreference = "SilentlyContinue"
Stop-Service -Force -Name containerd
$ErrorActionPreference = "Stop"
-
name: Containerd logs
if: always() && matrix.runtime == 'containerd'
run: |
Copy-Item "$env:TEMP\ctn.log" -Destination ".\bundles\containerd.log"
Get-Content "$env:TEMP\ctn.log" | Out-Host
-
name: Stop daemon
if: always()
run: |
$ErrorActionPreference = "SilentlyContinue"
Stop-Service -Force -Name docker
$ErrorActionPreference = "Stop"
-
# as the daemon is registered as a service we have to check the event
# logs against the docker provider.
name: Daemon event logs
if: always()
run: |
Get-WinEvent -ea SilentlyContinue `
-FilterHashtable @{ProviderName= "docker"; LogName = "application"} |
Sort-Object @{Expression="TimeCreated";Descending=$false} |
ForEach-Object {"$($_.TimeCreated.ToUniversalTime().ToString("o")) [$($_.LevelDisplayName)] $($_.Message)"} |
Tee-Object -file ".\bundles\daemon.log"
-
name: Download Jaeger traces
if: always()
run: |
Invoke-WebRequest `
-Uri "http://127.0.0.1:16686/api/traces?service=integration-test-client" `
-OutFile ".\bundles\jaeger-trace.json"
-
name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.os }}-${{ inputs.storage }}-integration-reports-${{ matrix.runtime }}-${{ env.TESTREPORTS_NAME }}
path: ${{ env.GOPATH }}\src\github.com\docker\docker\bundles\*
retention-days: 1
integration-test-report:
runs-on: ubuntu-latest
continue-on-error: ${{ inputs.storage == 'snapshotter' && github.event_name != 'pull_request' }}
if: always()
needs:
- integration-test
strategy:
fail-fast: false
matrix:
storage:
- ${{ inputs.storage }}
runtime:
- builtin
- containerd
exclude:
- storage: snapshotter
runtime: builtin
steps:
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Download reports
uses: actions/download-artifact@v4
with:
path: /tmp/reports
pattern: ${{ inputs.os }}-${{ inputs.storage }}-integration-reports-${{ matrix.runtime }}-*
merge-multiple: true
-
name: Install teststat
run: |
go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
-
name: Create summary
run: |
find /tmp/reports -type f -name '*-go-test-report.json' -exec teststat -markdown {} \+ >> $GITHUB_STEP_SUMMARY

View file

@ -1,191 +0,0 @@
name: bin-image
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
tags:
- 'v*'
pull_request:
env:
MOBYBIN_REPO_SLUG: moby/moby-bin
DOCKER_GITCOMMIT: ${{ github.sha }}
VERSION: ${{ github.ref }}
PLATFORM: Moby Engine - Nightly
PRODUCT: moby-bin
PACKAGER_NAME: The Moby Project
jobs:
validate-dco:
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: ./.github/workflows/.dco.yml
prepare:
runs-on: ubuntu-20.04
outputs:
platforms: ${{ steps.platforms.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.MOBYBIN_REPO_SLUG }}
### versioning strategy
## push semver tag v23.0.0
# moby/moby-bin:23.0.0
# moby/moby-bin:latest
## push semver prelease tag v23.0.0-beta.1
# moby/moby-bin:23.0.0-beta.1
## push on master
# moby/moby-bin:master
## push on 23.0 branch
# moby/moby-bin:23.0
## any push
# moby/moby-bin:sha-ad132f5
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr
type=sha
-
name: Rename meta bake definition file
# see https://github.com/docker/metadata-action/issues/381#issuecomment-1918607161
run: |
bakeFile="${{ steps.meta.outputs.bake-file }}"
mv "${bakeFile#cwd://}" "/tmp/bake-meta.json"
-
name: Upload meta bake definition
uses: actions/upload-artifact@v4
with:
name: bake-meta
path: /tmp/bake-meta.json
if-no-files-found: error
retention-days: 1
-
name: Create platforms matrix
id: platforms
run: |
echo "matrix=$(docker buildx bake bin-image-cross --print | jq -cr '.target."bin-image-cross".platforms')" >>${GITHUB_OUTPUT}
build:
runs-on: ubuntu-20.04
needs:
- validate-dco
- prepare
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
strategy:
fail-fast: false
matrix:
platform: ${{ fromJson(needs.prepare.outputs.platforms) }}
steps:
-
name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Download meta bake definition
uses: actions/download-artifact@v4
with:
name: bake-meta
path: /tmp
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
if: github.event_name != 'pull_request' && github.repository == 'moby/moby'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_MOBYBIN_USERNAME }}
password: ${{ secrets.DOCKERHUB_MOBYBIN_TOKEN }}
-
name: Build
id: bake
uses: docker/bake-action@v4
with:
files: |
./docker-bake.hcl
/tmp/bake-meta.json
targets: bin-image
set: |
*.platform=${{ matrix.platform }}
*.output=type=image,name=${{ env.MOBYBIN_REPO_SLUG }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' && github.repository == 'moby/moby' }}
*.tags=
-
name: Export digest
if: github.event_name != 'pull_request' && github.repository == 'moby/moby'
run: |
mkdir -p /tmp/digests
digest="${{ fromJSON(steps.bake.outputs.metadata)['bin-image']['containerimage.digest'] }}"
touch "/tmp/digests/${digest#sha256:}"
-
name: Upload digest
if: github.event_name != 'pull_request' && github.repository == 'moby/moby'
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-20.04
needs:
- build
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && github.event_name != 'pull_request' && github.repository == 'moby/moby'
steps:
-
name: Download meta bake definition
uses: actions/download-artifact@v4
with:
name: bake-meta
path: /tmp
-
name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_MOBYBIN_USERNAME }}
password: ${{ secrets.DOCKERHUB_MOBYBIN_TOKEN }}
-
name: Create manifest list and push
working-directory: /tmp/digests
run: |
set -x
docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map("-t " + .) | join(" ")' /tmp/bake-meta.json) \
$(printf '${{ env.MOBYBIN_REPO_SLUG }}@sha256:%s ' *)
-
name: Inspect image
run: |
set -x
docker buildx imagetools inspect ${{ env.MOBYBIN_REPO_SLUG }}:$(jq -cr '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)

View file

@ -1,139 +0,0 @@
name: buildkit
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
pull_request:
env:
GO_VERSION: "1.21.9"
DESTDIR: ./build
jobs:
validate-dco:
uses: ./.github/workflows/.dco.yml
build:
runs-on: ubuntu-20.04
needs:
- validate-dco
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v4
with:
targets: binary
-
name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binary
path: ${{ env.DESTDIR }}
if-no-files-found: error
retention-days: 1
test:
runs-on: ubuntu-20.04
timeout-minutes: 120
needs:
- build
env:
TEST_IMAGE_BUILD: "0"
TEST_IMAGE_ID: "buildkit-tests"
strategy:
fail-fast: false
matrix:
worker:
- dockerd
- dockerd-containerd
pkg:
- client
- cmd/buildctl
- solver
- frontend
- frontend/dockerfile
typ:
- integration
steps:
-
name: Prepare
run: |
disabledFeatures="cache_backend_azblob,cache_backend_s3"
if [ "${{ matrix.worker }}" = "dockerd" ]; then
disabledFeatures="${disabledFeatures},merge_diff"
fi
echo "BUILDKIT_TEST_DISABLE_FEATURES=${disabledFeatures}" >> $GITHUB_ENV
# Expose `ACTIONS_RUNTIME_TOKEN` and `ACTIONS_CACHE_URL`, which is used
# in BuildKit's test suite to skip/unskip cache exporters:
# https://github.com/moby/buildkit/blob/567a99433ca23402d5e9b9f9124005d2e59b8861/client/client_test.go#L5407-L5411
-
name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
-
name: Checkout
uses: actions/checkout@v4
with:
path: moby
-
name: BuildKit ref
run: |
echo "$(./hack/buildkit-ref)" >> $GITHUB_ENV
working-directory: moby
-
name: Checkout BuildKit ${{ env.BUILDKIT_REF }}
uses: actions/checkout@v4
with:
repository: ${{ env.BUILDKIT_REPO }}
ref: ${{ env.BUILDKIT_REF }}
path: buildkit
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Download binary artifacts
uses: actions/download-artifact@v4
with:
name: binary
path: ./buildkit/build/moby/
-
name: Update daemon.json
run: |
sudo rm -f /etc/docker/daemon.json
sudo service docker restart
docker version
docker info
-
name: Build test image
uses: docker/bake-action@v4
with:
workdir: ./buildkit
targets: integration-tests
set: |
*.output=type=docker,name=${{ env.TEST_IMAGE_ID }}
-
name: Test
run: |
./hack/test ${{ matrix.typ }}
env:
CONTEXT: "."
TEST_DOCKERD: "1"
TEST_DOCKERD_BINARY: "./build/moby/dockerd"
TESTPKGS: "./${{ matrix.pkg }}"
TESTFLAGS: "-v --parallel=1 --timeout=30m --run=//worker=${{ matrix.worker }}$"
working-directory: buildkit

View file

@ -1,113 +0,0 @@
name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
pull_request:
env:
DESTDIR: ./build
jobs:
validate-dco:
uses: ./.github/workflows/.dco.yml
build:
runs-on: ubuntu-20.04
needs:
- validate-dco
strategy:
fail-fast: false
matrix:
target:
- binary
- dynbinary
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v4
with:
targets: ${{ matrix.target }}
-
name: List artifacts
run: |
tree -nh ${{ env.DESTDIR }}
-
name: Check artifacts
run: |
find ${{ env.DESTDIR }} -type f -exec file -e ascii -- {} +
prepare-cross:
runs-on: ubuntu-latest
needs:
- validate-dco
outputs:
matrix: ${{ steps.platforms.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Create matrix
id: platforms
run: |
matrix="$(docker buildx bake binary-cross --print | jq -cr '.target."binary-cross".platforms')"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
-
name: Show matrix
run: |
echo ${{ steps.platforms.outputs.matrix }}
cross:
runs-on: ubuntu-20.04
needs:
- validate-dco
- prepare-cross
strategy:
fail-fast: false
matrix:
platform: ${{ fromJson(needs.prepare-cross.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v4
with:
targets: all
set: |
*.platform=${{ matrix.platform }}
-
name: List artifacts
run: |
tree -nh ${{ env.DESTDIR }}
-
name: Check artifacts
run: |
find ${{ env.DESTDIR }} -type f -exec file -e ascii -- {} +

View file

@ -1,177 +0,0 @@
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
pull_request:
env:
GO_VERSION: "1.21.9"
GIT_PAGER: "cat"
PAGER: "cat"
jobs:
validate-dco:
uses: ./.github/workflows/.dco.yml
build-dev:
runs-on: ubuntu-20.04
needs:
- validate-dco
strategy:
fail-fast: false
matrix:
mode:
- ""
- systemd
steps:
-
name: Prepare
run: |
if [ "${{ matrix.mode }}" = "systemd" ]; then
echo "SYSTEMD=true" >> $GITHUB_ENV
fi
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build dev image
uses: docker/bake-action@v4
with:
targets: dev
set: |
*.cache-from=type=gha,scope=dev${{ matrix.mode }}
*.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max
*.output=type=cacheonly
test:
needs:
- build-dev
- validate-dco
uses: ./.github/workflows/.test.yml
secrets: inherit
strategy:
fail-fast: false
matrix:
storage:
- graphdriver
- snapshotter
with:
storage: ${{ matrix.storage }}
validate-prepare:
runs-on: ubuntu-20.04
needs:
- validate-dco
outputs:
matrix: ${{ steps.scripts.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Create matrix
id: scripts
run: |
scripts=$(cd ./hack/validate && jq -nc '$ARGS.positional - ["all", "default", "dco"] | map(select(test("[.]")|not)) + ["generate-files"]' --args *)
echo "matrix=$scripts" >> $GITHUB_OUTPUT
-
name: Show matrix
run: |
echo ${{ steps.scripts.outputs.matrix }}
validate:
runs-on: ubuntu-20.04
timeout-minutes: 120
needs:
- validate-prepare
- build-dev
strategy:
fail-fast: true
matrix:
script: ${{ fromJson(needs.validate-prepare.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up runner
uses: ./.github/actions/setup-runner
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build dev image
uses: docker/bake-action@v4
with:
targets: dev
set: |
dev.cache-from=type=gha,scope=dev
-
name: Validate
run: |
make -o build validate-${{ matrix.script }}
smoke-prepare:
runs-on: ubuntu-20.04
needs:
- validate-dco
outputs:
matrix: ${{ steps.platforms.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Create matrix
id: platforms
run: |
matrix="$(docker buildx bake binary-smoketest --print | jq -cr '.target."binary-smoketest".platforms')"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
-
name: Show matrix
run: |
echo ${{ steps.platforms.outputs.matrix }}
smoke:
runs-on: ubuntu-20.04
needs:
- smoke-prepare
strategy:
fail-fast: false
matrix:
platform: ${{ fromJson(needs.smoke-prepare.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Test
uses: docker/bake-action@v4
with:
targets: binary-smoketest
set: |
*.platform=${{ matrix.platform }}

View file

@ -1,62 +0,0 @@
name: validate-pr
on:
pull_request:
types: [opened, edited, labeled, unlabeled]
jobs:
check-area-label:
runs-on: ubuntu-20.04
steps:
- name: Missing `area/` label
if: contains(join(github.event.pull_request.labels.*.name, ','), 'impact/') && !contains(join(github.event.pull_request.labels.*.name, ','), 'area/')
run: |
echo "::error::Every PR with an 'impact/*' label should also have an 'area/*' label"
exit 1
- name: OK
run: exit 0
check-changelog:
if: contains(join(github.event.pull_request.labels.*.name, ','), 'impact/')
runs-on: ubuntu-20.04
env:
PR_BODY: |
${{ github.event.pull_request.body }}
steps:
- name: Check changelog description
run: |
# Extract the `markdown changelog` note code block
block=$(echo -n "$PR_BODY" | tr -d '\r' | awk '/^```markdown changelog$/{flag=1;next}/^```$/{flag=0}flag')
# Strip empty lines
desc=$(echo "$block" | awk NF)
if [ -z "$desc" ]; then
echo "::error::Changelog section is empty. Please provide a description for the changelog."
exit 1
fi
len=$(echo -n "$desc" | wc -c)
if [[ $len -le 6 ]]; then
echo "::error::Description looks too short: $desc"
exit 1
fi
echo "This PR will be included in the release notes with the following note:"
echo "$desc"
check-pr-branch:
runs-on: ubuntu-20.04
env:
PR_TITLE: ${{ github.event.pull_request.title }}
steps:
# Backports or PR that target a release branch directly should mention the target branch in the title, for example:
# [X.Y backport] Some change that needs backporting to X.Y
# [X.Y] Change directly targeting the X.Y branch
- name: Get branch from PR title
id: title_branch
run: echo "$PR_TITLE" | sed -n 's/^\[\([0-9]*\.[0-9]*\)[^]]*\].*/branch=\1/p' >> $GITHUB_OUTPUT
- name: Check release branch
if: github.event.pull_request.base.ref != steps.title_branch.outputs.branch && !(github.event.pull_request.base.ref == 'master' && steps.title_branch.outputs.branch == '')
run: echo "::error::PR title suggests targetting the ${{ steps.title_branch.outputs.branch }} branch, but is opened against ${{ github.event.pull_request.base.ref }}" && exit 1

View file

@ -1,33 +0,0 @@
name: windows-2019
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
jobs:
validate-dco:
uses: ./.github/workflows/.dco.yml
test-prepare:
uses: ./.github/workflows/.test-prepare.yml
needs:
- validate-dco
run:
needs:
- test-prepare
uses: ./.github/workflows/.windows.yml
secrets: inherit
strategy:
fail-fast: false
matrix:
storage: ${{ fromJson(needs.test-prepare.outputs.matrix) }}
with:
os: windows-2019
storage: ${{ matrix.storage }}
send_coverage: false

View file

@ -1,36 +0,0 @@
name: windows-2022
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
pull_request:
jobs:
validate-dco:
uses: ./.github/workflows/.dco.yml
test-prepare:
uses: ./.github/workflows/.test-prepare.yml
needs:
- validate-dco
run:
needs:
- test-prepare
uses: ./.github/workflows/.windows.yml
secrets: inherit
strategy:
fail-fast: false
matrix:
storage: ${{ fromJson(needs.test-prepare.outputs.matrix) }}
with:
os: windows-2022
storage: ${{ matrix.storage }}
send_coverage: true

48
.gitignore vendored
View file

@ -1,28 +1,30 @@
# If you want to ignore files created by your editor/tools, please consider a # Docker project generated files to ignore
# [global .gitignore](https://help.github.com/articles/ignoring-files). # if you want to ignore files created by your editor/tools,
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
*~ *.exe
*.bak *.exe~
*.orig *.orig
*.test
.*.swp .*.swp
.DS_Store .DS_Store
thumbs.db # a .bashrc may be added to customize the build environment
# local repository customization
.envrc
.bashrc .bashrc
.editorconfig .gopath/
autogen/
# build artifacts
bundles/ bundles/
cli/winresources/*/*.syso cmd/dockerd/dockerd
cli/winresources/*/winres.json cmd/docker/docker
contrib/builder/rpm/*/changelog dockerversion/version_autogen.go
docs/AWS_S3_BUCKET
# ci artifacts docs/GITCOMMIT
*.exe docs/GIT_BRANCH
*.gz docs/VERSION
go-test-report.json docs/_build
junit-report.xml docs/_static
profile.out docs/_templates
test.main docs/changed-files
# generated by man/md2man-all.sh
man/man1
man/man5
man/man8
vendor/pkg/

View file

@ -1,137 +0,0 @@
linters:
enable:
- depguard
- dupword # Checks for duplicate words in the source code.
- goimports
- gosec
- gosimple
- govet
- importas
- ineffassign
- misspell
- revive
- staticcheck
- typecheck
- unconvert
- unused
disable:
- errcheck
run:
concurrency: 2
modules-download-mode: vendor
skip-dirs:
- docs
linters-settings:
dupword:
ignore:
- "true" # some tests use this as expected output
- "false" # some tests use this as expected output
- "root" # for tests using "ls" output with files owned by "root:root"
importas:
# Do not allow unaliased imports of aliased packages.
no-unaliased: true
alias:
# Enforce alias to prevent it accidentally being used instead of our
# own errdefs package (or vice-versa).
- pkg: github.com/containerd/containerd/errdefs
alias: cerrdefs
- pkg: github.com/opencontainers/image-spec/specs-go/v1
alias: ocispec
govet:
check-shadowing: false
depguard:
rules:
main:
deny:
- pkg: io/ioutil
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
- pkg: "github.com/stretchr/testify/assert"
desc: Use "gotest.tools/v3/assert" instead
- pkg: "github.com/stretchr/testify/require"
desc: Use "gotest.tools/v3/assert" instead
- pkg: "github.com/stretchr/testify/suite"
desc: Do not use
revive:
rules:
# FIXME make sure all packages have a description. Currently, there's many packages without.
- name: package-comments
disabled: true
issues:
# The default exclusion rules are a bit too permissive, so copying the relevant ones below
exclude-use-default: false
exclude-rules:
# We prefer to use an "exclude-list" so that new "default" exclusions are not
# automatically inherited. We can decide whether or not to follow upstream
# defaults when updating golang-ci-lint versions.
# Unfortunately, this means we have to copy the whole exclusion pattern, as
# (unlike the "include" option), the "exclude" option does not take exclusion
# ID's.
#
# These exclusion patterns are copied from the default excluses at:
# https://github.com/golangci/golangci-lint/blob/v1.46.2/pkg/config/issues.go#L10-L104
# EXC0001
- text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*print(f|ln)?|os\\.(Un)?Setenv). is not checked"
linters:
- errcheck
# EXC0006
- text: "Use of unsafe calls should be audited"
linters:
- gosec
# EXC0007
- text: "Subprocess launch(ed with variable|ing should be audited)"
linters:
- gosec
# EXC0008
# TODO: evaluate these and fix where needed: G307: Deferring unsafe method "*os.File" on type "Close" (gosec)
- text: "(G104|G307)"
linters:
- gosec
# EXC0009
- text: "(Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)"
linters:
- gosec
# EXC0010
- text: "Potential file inclusion via variable"
linters:
- gosec
# Looks like the match in "EXC0007" above doesn't catch this one
# TODO: consider upstreaming this to golangci-lint's default exclusion rules
- text: "G204: Subprocess launched with a potential tainted input or cmd arguments"
linters:
- gosec
# Looks like the match in "EXC0009" above doesn't catch this one
# TODO: consider upstreaming this to golangci-lint's default exclusion rules
- text: "G306: Expect WriteFile permissions to be 0600 or less"
linters:
- gosec
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- errcheck
- gosec
# Suppress golint complaining about generated types in api/types/
- text: "type name will be used as (container|volume)\\.(Container|Volume).* by other packages, and that stutters; consider calling this"
path: "api/types/(volume|container)/"
linters:
- revive
# FIXME temporarily suppress these (see https://github.com/gotestyourself/gotest.tools/issues/272)
- text: "SA1019: (assert|cmp|is)\\.ErrorType is deprecated"
linters:
- staticcheck
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0

989
.mailmap
View file

@ -1,755 +1,254 @@
# This file lists the canonical name and email of contributors, and is used to # Generate AUTHORS: hack/generate-authors.sh
# generate AUTHORS (in hack/generate-authors.sh).
#
# To find new duplicates, regenerate AUTHORS and scan for name duplicates, or
# run the following to find email duplicates:
# git log --format='%aE - %aN' | sort -uf | awk -v IGNORECASE=1 '$1 in a {print a[$1]; print}; {a[$1]=$0}'
#
# For an explanation of this file format, consult gitmailmap(5).
Aaron L. Xu <liker.xu@foxmail.com> # Tip for finding duplicates (besides scanning the output of AUTHORS for name
Aaron L. Xu <liker.xu@foxmail.com> <likexu@harmonycloud.cn> # duplicates that aren't also email duplicates): scan the output of:
Aaron Lehmann <alehmann@netflix.com> # git log --format='%aE - %aN' | sort -uf
Aaron Lehmann <alehmann@netflix.com> <aaron.lehmann@docker.com> #
Abhinandan Prativadi <aprativadi@gmail.com> # For explanation on this file format: man git-shortlog
Abhinandan Prativadi <aprativadi@gmail.com> <abhi@docker.com>
Abhinandan Prativadi <aprativadi@gmail.com> abhi <user.email> Patrick Stapleton <github@gdi2290.com>
Abhishek Chanda <abhishek.becs@gmail.com> Shishir Mahajan <shishir.mahajan@redhat.com> <smahajan@redhat.com>
Abhishek Chanda <abhishek.becs@gmail.com> <abhishek.chanda@emc.com> Erwin van der Koogh <info@erronis.nl>
Ada Mancini <ada@docker.com>
Adam Dobrawy <naczelnik@jawnosc.tk>
Adam Dobrawy <naczelnik@jawnosc.tk> <ad-m@users.noreply.github.com>
Adrien Gallouët <adrien@gallouet.fr> <angt@users.noreply.github.com>
Ahmed Kamal <email.ahmedkamal@googlemail.com> Ahmed Kamal <email.ahmedkamal@googlemail.com>
Ahmet Alp Balkan <ahmetb@microsoft.com> <ahmetalpbalkan@gmail.com> Tejesh Mehta <tejesh.mehta@gmail.com> <tj@init.me>
AJ Bowen <aj@soulshake.net> Cristian Staretu <cristian.staretu@gmail.com>
AJ Bowen <aj@soulshake.net> <aj@gandi.net> Cristian Staretu <cristian.staretu@gmail.com> <unclejacksons@gmail.com>
AJ Bowen <aj@soulshake.net> <amy@gandi.net> Cristian Staretu <cristian.staretu@gmail.com> <unclejack@users.noreply.github.com>
Akihiro Matsushima <amatsusbit@gmail.com> <amatsus@users.noreply.github.com> Marcus Linke <marcus.linke@gmx.de>
Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> Aleksandrs Fadins <aleks@s-ko.net>
Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> <suda.akihiro@lab.ntt.co.jp> Christopher Latham <sudosurootdev@gmail.com>
Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> <suda.kyoto@gmail.com> Hu Keping <hukeping@huawei.com>
Akshay Moghe <akshay.moghe@gmail.com> Wayne Chang <wayne@neverfear.org>
Albin Kerouanton <albinker@gmail.com> Chen Chao <cc272309126@gmail.com>
Albin Kerouanton <albinker@gmail.com> <albin@akerouanton.name> Daehyeok Mun <daehyeok@gmail.com>
Albin Kerouanton <albinker@gmail.com> <557933+akerouanton@users.noreply.github.com> <daehyeok@gmail.com> <daehyeok@daehyeokui-MacBook-Air.local>
<jt@yadutaf.fr> <admin@jtlebi.fr>
<jeff@docker.com> <jefferya@programmerq.net>
<charles.hooper@dotcloud.com> <chooper@plumata.com>
<daniel.mizyrycki@dotcloud.com> <daniel@dotcloud.com>
<daniel.mizyrycki@dotcloud.com> <mzdaniel@glidelink.net>
Guillaume J. Charmes <guillaume.charmes@docker.com> <charmes.guillaume@gmail.com>
<guillaume.charmes@docker.com> <guillaume@dotcloud.com>
<guillaume.charmes@docker.com> <guillaume@docker.com>
<guillaume.charmes@docker.com> <guillaume.charmes@dotcloud.com>
<guillaume.charmes@docker.com> <guillaume@charmes.net>
<kencochrane@gmail.com> <KenCochrane@gmail.com>
Thatcher Peskens <thatcher@docker.com>
Thatcher Peskens <thatcher@docker.com> <thatcher@dotcloud.com>
Thatcher Peskens <thatcher@docker.com> dhrp <thatcher@gmx.net>
Jérôme Petazzoni <jerome.petazzoni@dotcloud.com> jpetazzo <jerome.petazzoni@dotcloud.com>
Jérôme Petazzoni <jerome.petazzoni@dotcloud.com> <jp@enix.org>
Joffrey F <joffrey@docker.com>
Joffrey F <joffrey@docker.com> <joffrey@dotcloud.com>
Joffrey F <joffrey@docker.com> <f.joffrey@gmail.com>
Tim Terhorst <mynamewastaken+git@gmail.com>
Andy Smith <github@anarkystic.com>
<kalessin@kalessin.fr> <louis@dotcloud.com>
<victor.vieux@docker.com> <victor.vieux@dotcloud.com>
<victor.vieux@docker.com> <victor@dotcloud.com>
<victor.vieux@docker.com> <dev@vvieux.com>
<victor.vieux@docker.com> <victor@docker.com>
<victor.vieux@docker.com> <vieux@docker.com>
<victor.vieux@docker.com> <victorvieux@gmail.com>
<dominik@honnef.co> <dominikh@fork-bomb.org>
<ehanchrow@ine.com> <eric.hanchrow@gmail.com>
Walter Stanish <walter@pratyeka.org>
<daniel@gasienica.ch> <dgasienica@zynga.com>
Roberto Hashioka <roberto_hashioka@hotmail.com>
Konstantin Pelykh <kpelykh@zettaset.com>
David Sissitka <me@dsissitka.com>
Nolan Darilek <nolan@thewordnerd.info>
<mastahyeti@gmail.com> <mastahyeti@users.noreply.github.com>
Benoit Chesneau <bchesneau@gmail.com>
Jordan Arentsen <blissdev@gmail.com>
Daniel Garcia <daniel@danielgarcia.info>
Miguel Angel Fernández <elmendalerenda@gmail.com>
Bhiraj Butala <abhiraj.butala@gmail.com>
Faiz Khan <faizkhan00@gmail.com>
Victor Lyuboslavsky <victor@victoreda.com>
Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Matthew Mueller <mattmuelle@gmail.com>
<mosoni@ebay.com> <mohitsoni1989@gmail.com>
Shih-Yuan Lee <fourdollars@gmail.com>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> root <root@vagrant-ubuntu-12.10.vagrantup.com>
Jean-Baptiste Dalido <jeanbaptiste@appgratis.com>
<proppy@google.com> <proppy@aminche.com>
<michael@docker.com> <michael@crosbymichael.com>
<michael@docker.com> <crosby.michael@gmail.com>
<michael@docker.com> <crosbymichael@gmail.com>
<github@developersupport.net> <github@metaliveblog.com>
<brandon@ifup.org> <brandon@ifup.co>
<dano@spotify.com> <daniel.norberg@gmail.com>
<danny@codeaholics.org> <Danny.Yates@mailonline.co.uk>
<gurjeet@singh.im> <singh.gurjeet@gmail.com>
<shawn@churchofgit.com> <shawnlandden@gmail.com>
<sjoerd-github@linuxonly.nl> <sjoerd@byte.nl>
<solomon@docker.com> <solomon.hykes@dotcloud.com>
<solomon@docker.com> <solomon@dotcloud.com>
<solomon@docker.com> <s@docker.com>
Sven Dowideit <SvenDowideit@home.org.au>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@fosiki.com>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@docker.com>
Sven Dowideit <SvenDowideit@home.org.au> <¨SvenDowideit@home.org.au¨>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@home.org.au>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@users.noreply.github.com>
Sven Dowideit <SvenDowideit@home.org.au> <sven@t440s.home.gateway>
<alexl@redhat.com> <alexander.larsson@gmail.com>
Alexander Morozov <lk4d4@docker.com> <lk4d4math@gmail.com>
Alexander Morozov <lk4d4@docker.com>
<git.nivoc@neverbox.com> <kuehnle@online.de>
O.S. Tezer <ostezer@gmail.com>
<ostezer@gmail.com> <ostezer@users.noreply.github.com>
Roberto G. Hashioka <roberto.hashioka@docker.com> <roberto_hashioka@hotmail.com>
<justin.p.simonelis@gmail.com> <justin.simonelis@PTS-JSIMON2.toronto.exclamation.com>
<taim@bosboot.org> <maztaim@users.noreply.github.com>
<viktor.vojnovski@amadeus.com> <vojnovski@gmail.com>
<vbatts@redhat.com> <vbatts@hashbangbash.com>
<altsysrq@gmail.com> <iamironbob@gmail.com>
Sridhar Ratnakumar <sridharr@activestate.com>
Sridhar Ratnakumar <sridharr@activestate.com> <github@srid.name>
Liang-Chi Hsieh <viirya@gmail.com>
Aleksa Sarai <asarai@suse.de> Aleksa Sarai <asarai@suse.de>
Aleksa Sarai <asarai@suse.de> <asarai@suse.com> Aleksa Sarai <asarai@suse.de> <asarai@suse.com>
Aleksa Sarai <asarai@suse.de> <cyphar@cyphar.com> Aleksa Sarai <asarai@suse.de> <cyphar@cyphar.com>
Aleksandrs Fadins <aleks@s-ko.net> Will Weaver <monkey@buildingbananas.com>
Alessandro Boch <aboch@tetrationanalytics.com> Timothy Hobbs <timothyhobbs@seznam.cz>
Alessandro Boch <aboch@tetrationanalytics.com> <aboch@docker.com>
Alessandro Boch <aboch@tetrationanalytics.com> <aboch@socketplane.io>
Alessandro Boch <aboch@tetrationanalytics.com> <aboch@users.noreply.github.com>
Alex Chan <alex@alexwlchan.net>
Alex Chan <alex@alexwlchan.net> <alex.chan@metaswitch.com>
Alex Chen <alexchenunix@gmail.com> <root@localhost.localdomain>
Alex Ellis <alexellis2@gmail.com>
Alex Goodman <wagoodman@gmail.com> <wagoodman@users.noreply.github.com>
Alexander Larsson <alexl@redhat.com> <alexander.larsson@gmail.com>
Alexander Morozov <lk4d4math@gmail.com>
Alexander Morozov <lk4d4math@gmail.com> <lk4d4@docker.com>
Alexandre Beslic <alexandre.beslic@gmail.com> <abronan@docker.com>
Alexandre González <agonzalezro@gmail.com>
Alexis Ries <ries.alexis@gmail.com>
Alexis Ries <ries.alexis@gmail.com> <alexis.ries.ext@orange.com>
Alexis Thomas <fr.alexisthomas@gmail.com>
Alicia Lauerman <alicia@eta.im> <allydevour@me.com>
Allen Sun <allensun.shl@alibaba-inc.com> <allen.sun@daocloud.io>
Allen Sun <allensun.shl@alibaba-inc.com> <shlallen1990@gmail.com>
Anca Iordache <anca.iordache@docker.com>
Andrea Denisse Gómez <crypto.andrea@protonmail.ch>
Andrew Kim <taeyeonkim90@gmail.com>
Andrew Kim <taeyeonkim90@gmail.com> <akim01@fortinet.com>
Andrew Weiss <andrew.weiss@docker.com> <andrew.weiss@microsoft.com>
Andrew Weiss <andrew.weiss@docker.com> <andrew.weiss@outlook.com>
Andrey Kolomentsev <andrey.kolomentsev@docker.com>
Andrey Kolomentsev <andrey.kolomentsev@docker.com> <andrey.kolomentsev@gmail.com>
André Martins <aanm90@gmail.com> <martins@noironetworks.com>
Andy Rothfusz <github@developersupport.net> <github@metaliveblog.com>
Andy Smith <github@anarkystic.com>
Andy Zhang <andy.zhangtao@hotmail.com>
Andy Zhang <andy.zhangtao@hotmail.com> <ztao@tibco-support.com>
Ankush Agarwal <ankushagarwal11@gmail.com> <ankushagarwal@users.noreply.github.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <amurdaca@redhat.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <me@runcom.ninja>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@linux.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@redhat.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@users.noreply.github.com>
Anuj Bahuguna <anujbahuguna.dev@gmail.com>
Anuj Bahuguna <anujbahuguna.dev@gmail.com> <abahuguna@fiberlink.com>
Anusha Ragunathan <anusha.ragunathan@docker.com> <anusha@docker.com>
Anyu Wang <wanganyu@outlook.com>
Arko Dasgupta <arko@tetrate.io>
Arko Dasgupta <arko@tetrate.io> <arko.dasgupta@docker.com>
Arko Dasgupta <arko@tetrate.io> <arkodg@users.noreply.github.com>
Arnaud Porterie <icecrime@gmail.com>
Arnaud Porterie <icecrime@gmail.com> <arnaud.porterie@docker.com>
Arnaud Rebillout <arnaud.rebillout@collabora.com>
Arnaud Rebillout <arnaud.rebillout@collabora.com> <elboulangero@gmail.com>
Arthur Gautier <baloo@gandi.net> <superbaloo+registrations.github@superbaloo.net>
Artur Meyster <arthurfbi@yahoo.com>
Avi Miller <avi.miller@oracle.com> <avi.miller@gmail.com>
Ben Bonnefoy <frenchben@docker.com>
Ben Golub <ben.golub@dotcloud.com>
Ben Toews <mastahyeti@gmail.com> <mastahyeti@users.noreply.github.com>
Benny Ng <benny.tpng@gmail.com>
Benoit Chesneau <bchesneau@gmail.com>
Bevisy Zhang <binbin36520@gmail.com>
Bhiraj Butala <abhiraj.butala@gmail.com>
Bhumika Bayani <bhumikabayani@gmail.com>
Bilal Amarni <bilal.amarni@gmail.com> <bamarni@users.noreply.github.com>
Bill Wang <ozbillwang@gmail.com> <SydOps@users.noreply.github.com>
Bily Zhang <xcoder@tenxcloud.com>
Bin Liu <liubin0329@gmail.com>
Bin Liu <liubin0329@gmail.com> <liubin0329@users.noreply.github.com>
Bingshen Wang <bingshen.wbs@alibaba-inc.com>
Bjorn Neergaard <bjorn@neersighted.com>
Bjorn Neergaard <bjorn@neersighted.com> <bjorn.neergaard@docker.com>
Bjorn Neergaard <bjorn@neersighted.com> <bneergaard@mirantis.com>
Boaz Shuster <ripcurld.github@gmail.com>
Bojun Zhu <bojun.zhu@foxmail.com>
Boqin Qin <bobbqqin@gmail.com>
Boshi Lian <farmer1992@gmail.com>
Brandon Philips <brandon.philips@coreos.com> <brandon@ifup.co>
Brandon Philips <brandon.philips@coreos.com> <brandon@ifup.org>
Brent Salisbury <brent.salisbury@docker.com> <brent@docker.com>
Brian Goff <cpuguy83@gmail.com>
Brian Goff <cpuguy83@gmail.com> <bgoff@cpuguy83-mbp.home>
Brian Goff <cpuguy83@gmail.com> <bgoff@cpuguy83-mbp.local>
Brian Goff <cpuguy83@gmail.com> <brian.goff@microsoft.com>
Brian Goff <cpuguy83@gmail.com> <cpuguy@hey.com>
Cameron Sparr <gh@sparr.email>
Carlos de Paula <me@carlosedp.com>
Chander Govindarajan <chandergovind@gmail.com>
Chao Wang <wangchao.fnst@cn.fujitsu.com> <chaowang@localhost.localdomain>
Charles Hooper <charles.hooper@dotcloud.com> <chooper@plumata.com>
Chen Chao <cc272309126@gmail.com>
Chen Chuanliang <chen.chuanliang@zte.com.cn>
Chen Mingjie <chenmingjie0828@163.com>
Chen Qiu <cheney-90@hotmail.com>
Chen Qiu <cheney-90@hotmail.com> <21321229@zju.edu.cn>
Chengfei Shang <cfshang@alauda.io>
Chris Dias <cdias@microsoft.com>
Chris McKinnel <chris.mckinnel@tangentlabs.co.uk>
Chris Price <cprice@mirantis.com>
Chris Price <cprice@mirantis.com> <chris.price@docker.com>
Chris Telfer <ctelfer@docker.com>
Chris Telfer <ctelfer@docker.com> <ctelfer@users.noreply.github.com>
Christopher Biscardi <biscarch@sketcht.com>
Christopher Latham <sudosurootdev@gmail.com>
Christy Norman <christy@linux.vnet.ibm.com>
Chun Chen <ramichen@tencent.com> <chenchun.feed@gmail.com>
Corbin Coleman <corbin.coleman@docker.com>
Cristian Ariza <dev@cristianrz.com>
Cristian Staretu <cristian.staretu@gmail.com>
Cristian Staretu <cristian.staretu@gmail.com> <unclejack@users.noreply.github.com>
Cristian Staretu <cristian.staretu@gmail.com> <unclejacksons@gmail.com>
cui fliter <imcusg@gmail.com>
cui fliter <imcusg@gmail.com> cuishuang <imcusg@gmail.com>
CUI Wei <ghostplant@qq.com> cuiwei13 <cuiwei13@pku.edu.cn>
Daehyeok Mun <daehyeok@gmail.com>
Daehyeok Mun <daehyeok@gmail.com> <daehyeok@daehyeok-ui-MacBook-Air.local>
Daehyeok Mun <daehyeok@gmail.com> <daehyeok@daehyeokui-MacBook-Air.local>
Dan Feldman <danf@jfrog.com>
Daniel Dao <dqminh@cloudflare.com>
Daniel Dao <dqminh@cloudflare.com> <dqminh89@gmail.com>
Daniel Garcia <daniel@danielgarcia.info>
Daniel Gasienica <daniel@gasienica.ch> <dgasienica@zynga.com>
Daniel Goosen <daniel.goosen@surveysampling.com> <djgoosen@users.noreply.github.com>
Daniel Grunwell <mwgrunny@gmail.com>
Daniel Hiltgen <daniel.hiltgen@docker.com> <dhiltgen@users.noreply.github.com>
Daniel J Walsh <dwalsh@redhat.com>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> <daniel@dotcloud.com>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> <mzdaniel@glidelink.net>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> <root@vagrant-ubuntu-12.10.vagrantup.com>
Daniel Nephin <dnephin@docker.com> <dnephin@gmail.com>
Daniel Norberg <dano@spotify.com> <daniel.norberg@gmail.com>
Daniel Watkins <daniel@daniel-watkins.co.uk>
Daniel Zhang <jmzwcn@gmail.com>
Danny Yates <danny@codeaholics.org> <Danny.Yates@mailonline.co.uk>
Darren Shepherd <darren.s.shepherd@gmail.com> <darren@rancher.com>
Dattatraya Kumbhar <dattatraya.kumbhar@gslab.com>
Dave Goodchild <buddhamagnet@gmail.com>
Dave Henderson <dhenderson@gmail.com> <Dave.Henderson@ca.ibm.com>
Dave Tucker <dt@docker.com> <dave@dtucker.co.uk>
David Dooling <dooling@gmail.com>
David Dooling <dooling@gmail.com> <david.dooling@docker.com>
David M. Karr <davidmichaelkarr@gmail.com>
David Sheets <dsheets@docker.com> <sheets@alum.mit.edu>
David Sissitka <me@dsissitka.com>
David Williamson <david.williamson@docker.com> <davidwilliamson@users.noreply.github.com>
Derek Ch <denc716@gmail.com>
Derek McGowan <derek@mcg.dev>
Derek McGowan <derek@mcg.dev> <derek@mcgstyle.net>
Deshi Xiao <dxiao@redhat.com> <dsxiao@dataman-inc.com>
Deshi Xiao <dxiao@redhat.com> <xiaods@gmail.com>
Dhilip Kumars <dhilip.kumar.s@huawei.com>
Diego Siqueira <dieg0@live.com>
Diogo Monica <diogo@docker.com> <diogo.monica@gmail.com>
Dmitry Sharshakov <d3dx12.xx@gmail.com>
Dmitry Sharshakov <d3dx12.xx@gmail.com> <sh7dm@outlook.com>
Dmytro Iakovliev <dmytro.iakovliev@zodiacsystems.com>
Dominic Yin <yindongchao@inspur.com>
Dominik Honnef <dominik@honnef.co> <dominikh@fork-bomb.org>
Doug Davis <dug@us.ibm.com> <duglin@users.noreply.github.com>
Doug Tangren <d.tangren@gmail.com>
Drew Erny <derny@mirantis.com>
Drew Erny <derny@mirantis.com> <drew.erny@docker.com>
Elan Ruusamäe <glen@pld-linux.org>
Elan Ruusamäe <glen@pld-linux.org> <glen@delfi.ee>
Elango Sivanandam <elango.siva@docker.com>
Elango Sivanandam <elango.siva@docker.com> <elango@docker.com>
Eli Uriegas <seemethere101@gmail.com>
Eli Uriegas <seemethere101@gmail.com> <eli.uriegas@docker.com>
Eric G. Noriega <enoriega@vizuri.com> <egnoriega@users.noreply.github.com>
Eric Hanchrow <ehanchrow@ine.com> <eric.hanchrow@gmail.com>
Eric Rosenberg <ehaydenr@gmail.com> <ehaydenr@users.noreply.github.com>
Erica Windisch <erica@windisch.us> <eric@windisch.us>
Erica Windisch <erica@windisch.us> <ewindisch@docker.com>
Erik Hollensbe <github@hollensbe.org> <erik+github@hollensbe.org>
Erwin van der Koogh <info@erronis.nl>
Ethan Bell <ebgamer29@gmail.com>
Euan Kemp <euan.kemp@coreos.com> <euank@amazon.com>
Eugen Krizo <eugen.krizo@gmail.com>
Evan Hazlett <ejhazlett@gmail.com> <ehazlett@users.noreply.github.com>
Evelyn Xu <evelynhsu21@gmail.com>
Evgeny Shmarnev <shmarnev@gmail.com>
Faiz Khan <faizkhan00@gmail.com>
Fangming Fang <fangming.fang@arm.com>
Felix Hupfeld <felix@quobyte.com> <quofelix@users.noreply.github.com>
Felix Ruess <felix.ruess@gmail.com> <felix.ruess@roboception.de>
Feng Yan <fy2462@gmail.com>
Fengtu Wang <wangfengtu@huawei.com> <wangfengtu@huawei.com>
Filipe Pina <hzlu1ot0@duck.com>
Filipe Pina <hzlu1ot0@duck.com> <636320+fopina@users.noreply.github.com>
Francisco Carriedo <fcarriedo@gmail.com>
Frank Rosquin <frank.rosquin+github@gmail.com> <frank.rosquin@gmail.com>
Frank Yang <yyb196@gmail.com>
Frederick F. Kautz IV <fkautz@redhat.com> <fkautz@alumni.cmu.edu>
Fu JinLin <withlin@yeah.net>
Gabriel Goller <gabrielgoller123@gmail.com>
Gabriel Nicolas Avellaneda <avellaneda.gabriel@gmail.com>
Gaetan de Villele <gdevillele@gmail.com>
Gang Qiao <qiaohai8866@gmail.com> <1373319223@qq.com>
Geon Kim <geon0250@gmail.com>
George Kontridze <george@bugsnag.com>
Gerwim Feiken <g.feiken@tfe.nl> <gerwim@gmail.com>
Giampaolo Mancini <giampaolo@trampolineup.com>
Giovan Isa Musthofa <giovanism@outlook.co.id>
Gopikannan Venugopalsamy <gopikannan.venugopalsamy@gmail.com>
Gou Rao <gou@portworx.com> <gourao@users.noreply.github.com>
Grant Millar <rid@cylo.io>
Grant Millar <rid@cylo.io> <grant@cylo.io>
Grant Millar <rid@cylo.io> <grant@seednet.eu>
Greg Stephens <greg@udon.org>
Guillaume J. Charmes <guillaume.charmes@docker.com> <charmes.guillaume@gmail.com>
Guillaume J. Charmes <guillaume.charmes@docker.com> <guillaume.charmes@dotcloud.com>
Guillaume J. Charmes <guillaume.charmes@docker.com> <guillaume@charmes.net>
Guillaume J. Charmes <guillaume.charmes@docker.com> <guillaume@docker.com>
Guillaume J. Charmes <guillaume.charmes@docker.com> <guillaume@dotcloud.com>
Gunadhya S. <6939749+gunadhya@users.noreply.github.com>
Guoqiang QI <guoqiang.qi1@gmail.com>
Guri <odg0318@gmail.com>
Gurjeet Singh <gurjeet@singh.im> <singh.gurjeet@gmail.com>
Gustav Sinder <gustav.sinder@gmail.com>
Günther Jungbluth <gunther@gameslabs.net>
Hakan Özler <hakan.ozler@kodcu.com>
Hao Shu Wei <haoshuwei24@gmail.com>
Hao Shu Wei <haoshuwei24@gmail.com> <haoshuwei1989@163.com>
Hao Shu Wei <haoshuwei24@gmail.com> <haosw@cn.ibm.com>
Harald Albers <github@albersweb.de> <albers@users.noreply.github.com>
Harald Niesche <harald@niesche.de>
Harold Cooper <hrldcpr@gmail.com>
Harry Zhang <harryz@hyper.sh>
Harry Zhang <harryz@hyper.sh> <harryzhang@zju.edu.cn>
Harry Zhang <harryz@hyper.sh> <resouer@163.com>
Harry Zhang <harryz@hyper.sh> <resouer@gmail.com>
Harshal Patil <harshal.patil@in.ibm.com> <harche@users.noreply.github.com>
He Simei <hesimei@zju.edu.cn>
Helen Xie <chenjg@harmonycloud.cn>
Hiroyuki Sasagawa <hs19870702@gmail.com>
Hollie Teal <hollie@docker.com>
Hollie Teal <hollie@docker.com> <hollie.teal@docker.com>
Hollie Teal <hollie@docker.com> <hollietealok@users.noreply.github.com>
hsinko <21551195@zju.edu.cn> <hsinko@users.noreply.github.com>
Hu Keping <hukeping@huawei.com>
Huajin Tong <fliterdashen@gmail.com>
Hui Kang <hkang.sunysb@gmail.com>
Hui Kang <hkang.sunysb@gmail.com> <kangh@us.ibm.com>
Huu Nguyen <huu@prismskylabs.com> <whoshuu@gmail.com>
Hyeongkyu Lee <hyeongkyu.lee@navercorp.com>
Hyzhou Zhy <hyzhou.zhy@alibaba-inc.com>
Hyzhou Zhy <hyzhou.zhy@alibaba-inc.com> <1187766782@qq.com>
Ian Campbell <ian.campbell@docker.com>
Ian Campbell <ian.campbell@docker.com> <ijc@docker.com>
Ilya Khlopotov <ilya.khlopotov@gmail.com>
Iskander Sharipov <quasilyte@gmail.com>
Ivan Babrou <ibobrik@gmail.com>
Ivan Markin <sw@nogoegst.net> <twim@riseup.net>
Jack Laxson <jackjrabbit@gmail.com>
Jacob Atzen <jacob@jacobatzen.dk> <jatzen@gmail.com>
Jacob Tomlinson <jacob@tom.linson.uk> <jacobtomlinson@users.noreply.github.com>
Jaivish Kothari <janonymous.codevulture@gmail.com>
Jake Moshenko <jake@devtable.com>
Jakub Drahos <jdrahos@pulsepoint.com>
Jakub Drahos <jdrahos@pulsepoint.com> <jack.drahos@gmail.com>
James Nesbitt <jnesbitt@mirantis.com>
James Nesbitt <jnesbitt@mirantis.com> <james.nesbitt@wunderkraut.com>
Jamie Hannaford <jamie@limetree.org> <jamie.hannaford@rackspace.com>
Jan Götte <jaseg@jaseg.net>
Jana Radhakrishnan <mrjana@docker.com>
Jana Radhakrishnan <mrjana@docker.com> <mrjana@socketplane.io>
Javier Bassi <javierbassi@gmail.com>
Javier Bassi <javierbassi@gmail.com> <CrimsonGlory@users.noreply.github.com>
Jay Lim <jay@imjching.com>
Jay Lim <jay@imjching.com> <imjching@hotmail.com>
Jean Rouge <rougej+github@gmail.com> <jer329@cornell.edu>
Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Jean-Baptiste Dalido <jeanbaptiste@appgratis.com>
Jean-Tiare Le Bigot <jt@yadutaf.fr> <admin@jtlebi.fr>
Jeff Anderson <jeff@docker.com> <jefferya@programmerq.net>
Jeff Nickoloff <jeff.nickoloff@gmail.com> <jeff@allingeek.com>
Jeroen Franse <jeroenfranse@gmail.com>
Jessica Frazelle <jess@oxide.computer>
Jessica Frazelle <jess@oxide.computer> <acidburn@docker.com>
Jessica Frazelle <jess@oxide.computer> <acidburn@google.com>
Jessica Frazelle <jess@oxide.computer> <acidburn@microsoft.com>
Jessica Frazelle <jess@oxide.computer> <jess@docker.com>
Jessica Frazelle <jess@oxide.computer> <jess@mesosphere.com>
Jessica Frazelle <jess@oxide.computer> <jessfraz@google.com>
Jessica Frazelle <jess@oxide.computer> <jfrazelle@users.noreply.github.com>
Jessica Frazelle <jess@oxide.computer> <me@jessfraz.com>
Jessica Frazelle <jess@oxide.computer> <princess@docker.com>
Jian Liao <jliao@alauda.io>
Jiang Jinyang <jjyruby@gmail.com>
Jiang Jinyang <jjyruby@gmail.com> <jiangjinyang@outlook.com>
Jim Galasyn <jim.galasyn@docker.com>
Jiuyue Ma <majiuyue@huawei.com>
Joey Geiger <jgeiger@gmail.com>
Joffrey F <joffrey@docker.com>
Joffrey F <joffrey@docker.com> <f.joffrey@gmail.com>
Joffrey F <joffrey@docker.com> <joffrey@dotcloud.com>
Johan Euphrosine <proppy@google.com> <proppy@aminche.com>
John Harris <john@johnharris.io>
John Howard <github@lowenna.com>
John Howard <github@lowenna.com> <10522484+lowenna@users.noreply.github.com>
John Howard <github@lowenna.com> <jhoward@microsoft.com>
John Howard <github@lowenna.com> <jhoward@ntdev.microsoft.com>
John Howard <github@lowenna.com> <jhowardmsft@users.noreply.github.com>
John Howard <github@lowenna.com> <john.howard@microsoft.com>
John Howard <github@lowenna.com> <john@lowenna.com>
John Stephens <johnstep@docker.com> <johnstep@users.noreply.github.com>
Jon Surrell <jon.surrell@gmail.com> <jon.surrell@automattic.com>
Jonathan Choy <jonathan.j.choy@gmail.com>
Jonathan Choy <jonathan.j.choy@gmail.com> <oni@tetsujinlabs.com>
Jordan Arentsen <blissdev@gmail.com>
Jordan Jennings <jjn2009@gmail.com> <jjn2009@users.noreply.github.com>
Jorit Kleine-Möllhoff <joppich@bricknet.de> <joppich@users.noreply.github.com>
Jose Diaz-Gonzalez <email@josediazgonzalez.com>
Jose Diaz-Gonzalez <email@josediazgonzalez.com> <jose@seatgeek.com>
Jose Diaz-Gonzalez <email@josediazgonzalez.com> <josegonzalez@users.noreply.github.com>
Josh Bonczkowski <josh.bonczkowski@gmail.com>
Josh Eveleth <joshe@opendns.com> <jeveleth@users.noreply.github.com>
Josh Hawn <josh.hawn@docker.com> <jlhawn@berkeley.edu>
Josh Horwitz <horwitz@addthis.com> <horwitzja@gmail.com>
Josh Soref <jsoref@gmail.com> <jsoref@users.noreply.github.com>
Josh Wilson <josh.wilson@fivestars.com> <jcwilson@users.noreply.github.com>
Joyce Jang <mail@joycejang.com>
Julien Bordellier <julienbordellier@gmail.com> <git@julienbordellier.com>
Julien Bordellier <julienbordellier@gmail.com> <me@julienbordellier.com>
Jun Du <dujun5@huawei.com>
Justin Cormack <justin.cormack@docker.com>
Justin Cormack <justin.cormack@docker.com> <justin.cormack@unikernel.com>
Justin Cormack <justin.cormack@docker.com> <justin@specialbusservice.com>
Justin Keller <85903732+jk-vb@users.noreply.github.com>
Justin Keller <85903732+jk-vb@users.noreply.github.com> <jkeller@vb-jkeller-mbp.local>
Justin Simonelis <justin.p.simonelis@gmail.com> <justin.simonelis@PTS-JSIMON2.toronto.exclamation.com>
Justin Terry <juterry@microsoft.com>
Jérôme Petazzoni <jerome.petazzoni@docker.com> <jerome.petazzoni@dotcloud.com>
Jérôme Petazzoni <jerome.petazzoni@docker.com> <jerome.petazzoni@gmail.com>
Jérôme Petazzoni <jerome.petazzoni@docker.com> <jp@enix.org>
K. Heller <pestophagous@gmail.com> <pestophagous@users.noreply.github.com>
Kai Qiang Wu (Kennan) <wkq5325@gmail.com>
Kai Qiang Wu (Kennan) <wkq5325@gmail.com> <wkqwu@cn.ibm.com>
Kamil Domański <kamil@domanski.co>
Kamjar Gerami <kami.gerami@gmail.com>
Karthik Nayak <karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> <Karthik.188@gmail.com>
Ken Cochrane <kencochrane@gmail.com> <KenCochrane@gmail.com>
Ken Herner <kherner@progress.com> <chosenken@gmail.com>
Ken Reese <krrgithub@gmail.com>
Kenfe-Mickaël Laventure <mickael.laventure@gmail.com>
Kevin Alvarez <github@crazymax.dev>
Kevin Alvarez <github@crazymax.dev> <1951866+crazy-max@users.noreply.github.com>
Kevin Alvarez <github@crazymax.dev> <crazy-max@users.noreply.github.com>
Kevin Feyrer <kevin.feyrer@btinternet.com> <kevinfeyrer@users.noreply.github.com>
Kevin Kern <kaiwentan@harmonycloud.cn>
Kevin Meredith <kevin.m.meredith@gmail.com>
Kir Kolyshkin <kolyshkin@gmail.com>
Kir Kolyshkin <kolyshkin@gmail.com> <kir@openvz.org>
Kir Kolyshkin <kolyshkin@gmail.com> <kolyshkin@users.noreply.github.com>
Konrad Kleine <konrad.wilhelm.kleine@gmail.com> <kwk@users.noreply.github.com>
Konstantin Gribov <grossws@gmail.com>
Konstantin Pelykh <kpelykh@zettaset.com>
Kotaro Yoshimatsu <kotaro.yoshimatsu@gmail.com>
Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp> <btkushuwahak@KUNAL-PC.swh.swh.nttdata.co.jp>
Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp> <kunal.kushwaha@gmail.com>
Kyle Squizzato <ksquizz@gmail.com>
Kyle Squizzato <ksquizz@gmail.com> <kyle.squizzato@docker.com>
Lajos Papp <lajos.papp@sequenceiq.com> <lalyos@yahoo.com>
Lei Gong <lgong@alauda.io>
Lei Jitang <leijitang@huawei.com>
Lei Jitang <leijitang@huawei.com> <leijitang@gmail.com>
Lei Jitang <leijitang@huawei.com> <leijitang@outlook.com>
Leiiwang <u2takey@gmail.com>
Liang Mingqiang <mqliang.zju@gmail.com>
Liang-Chi Hsieh <viirya@gmail.com>
Liao Qingwei <liaoqingwei@huawei.com>
Linus Heckemann <lheckemann@twig-world.com>
Linus Heckemann <lheckemann@twig-world.com> <anonymouse2048@gmail.com>
Lokesh Mandvekar <lsm5@fedoraproject.org> <lsm5@redhat.com>
Lorenzo Fontana <fontanalorenz@gmail.com> <fontanalorenzo@me.com>
Lorenzo Fontana <fontanalorenz@gmail.com> <lo@linux.com>
Louis Opter <kalessin@kalessin.fr>
Louis Opter <kalessin@kalessin.fr> <louis@dotcloud.com>
Luca Favatella <luca.favatella@erlang-solutions.com> <lucafavatella@users.noreply.github.com>
Luke Marsden <me@lukemarsden.net> <luke@digital-crocus.com>
Lyn <energylyn@zju.edu.cn>
Lynda O'Leary <lyndaoleary29@gmail.com>
Lynda O'Leary <lyndaoleary29@gmail.com> <lyndaoleary@hotmail.com>
Ma Müller <mueller-ma@users.noreply.github.com>
Madhan Raj Mookkandy <MadhanRaj.Mookkandy@microsoft.com>
Madhan Raj Mookkandy <MadhanRaj.Mookkandy@microsoft.com> <madhanm@corp.microsoft.com>
Madhan Raj Mookkandy <MadhanRaj.Mookkandy@microsoft.com> <madhanm@microsoft.com>
Madhu Venugopal <mavenugo@gmail.com> <madhu@docker.com>
Madhu Venugopal <mavenugo@gmail.com> <madhu@socketplane.io>
Mageee <fangpuyi@foxmail.com> <21521230.zju.edu.cn>
Mansi Nahar <mmn4185@rit.edu> <mansi.nahar@macbookpro-mansinahar.local>
Mansi Nahar <mmn4185@rit.edu> <mansinahar@users.noreply.github.com>
Marc Abramowitz <marc@marc-abramowitz.com> <msabramo@gmail.com>
Marcelo Horacio Fortino <info@fortinux.com> <fortinux@users.noreply.github.com>
Marcus Linke <marcus.linke@gmx.de>
Marianna Tessel <mtesselh@gmail.com>
Mark Oates <fl0yd@me.com>
Markan Patel <mpatel678@gmail.com>
Markus Kortlang <hyp3rdino@googlemail.com> <markus.kortlang@lhsystems.com>
Martin Redmond <redmond.martin@gmail.com> <martin@tinychat.com>
Martin Redmond <redmond.martin@gmail.com> <xgithub@redmond5.com>
Maru Newby <mnewby@thesprawl.net>
Mary Anthony <mary.anthony@docker.com> <mary@docker.com>
Mary Anthony <mary.anthony@docker.com> <moxieandmore@gmail.com>
Mary Anthony <mary.anthony@docker.com> moxiegirl <mary@docker.com>
Masato Ohba <over.rye@gmail.com>
Mathieu Paturel <mathieu.paturel@gmail.com>
Matt Bentley <matt.bentley@docker.com> <mbentley@mbentley.net>
Matt Schurenko <matt.schurenko@gmail.com>
Matt Williams <mattyw@me.com>
Matt Williams <mattyw@me.com> <gh@mattyw.net>
Matthew Heon <mheon@redhat.com> <mheon@mheonlaptop.redhat.com>
Matthew Mosesohn <raytrac3r@gmail.com>
Matthew Mueller <mattmuelle@gmail.com>
Matthias Kühnle <git.nivoc@neverbox.com> <kuehnle@online.de>
Mauricio Garavaglia <mauricio@medallia.com> <mauriciogaravaglia@gmail.com>
Maxwell <csuhp007@gmail.com>
Maxwell <csuhp007@gmail.com> <csuhqg@foxmail.com>
Menghui Chen <menghui.chen@alibaba-inc.com>
Michael Beskin <mrbeskin@gmail.com>
Michael Crosby <crosbymichael@gmail.com>
Michael Crosby <crosbymichael@gmail.com> <crosby.michael@gmail.com>
Michael Crosby <crosbymichael@gmail.com> <michael@crosbymichael.com>
Michael Crosby <crosbymichael@gmail.com> <michael@docker.com>
Michael Crosby <crosbymichael@gmail.com> <michael@thepasture.io>
Michael Hudson-Doyle <michael.hudson@canonical.com> <michael.hudson@linaro.org>
Michael Huettermann <michael@huettermann.net>
Michael Käufl <docker@c.michael-kaeufl.de> <michael-k@users.noreply.github.com>
Michael Nussbaum <michael.nussbaum@getbraintree.com>
Michael Nussbaum <michael.nussbaum@getbraintree.com> <code@getbraintree.com>
Michael Spetsiotis <michael_spets@hotmail.com>
Michael Stapelberg <michael+gh@stapelberg.de>
Michael Stapelberg <michael+gh@stapelberg.de> <stapelberg@google.com>
Michal Kostrzewa <michal.kostrzewa@codilime.com>
Michal Kostrzewa <michal.kostrzewa@codilime.com> <kostrzewa.michal@o2.pl>
Michal Minář <miminar@redhat.com>
Michał Gryko <github@odkurzacz.org>
Michiel de Jong <michiel@unhosted.org>
Mickaël Fortunato <morsi.morsicus@gmail.com>
Miguel Angel Alvarez Cabrerizo <doncicuto@gmail.com> <30386061+doncicuto@users.noreply.github.com>
Miguel Angel Fernández <elmendalerenda@gmail.com>
Mihai Borobocea <MihaiBorob@gmail.com> <MihaiBorobocea@gmail.com>
Mikael Davranche <mikael.davranche@corp.ovh.com>
Mikael Davranche <mikael.davranche@corp.ovh.com> <mikael.davranche@corp.ovh.net>
Mike Casas <mkcsas0@gmail.com> <mikecasas@users.noreply.github.com>
Mike Goelzer <mike.goelzer@docker.com> <mgoelzer@docker.com>
Milas Bowman <devnull@milas.dev>
Milas Bowman <devnull@milas.dev> <milasb@gmail.com>
Milas Bowman <devnull@milas.dev> <milas.bowman@docker.com>
Milind Chawre <milindchawre@gmail.com>
Misty Stanley-Jones <misty@docker.com> <misty@apache.org>
Mohammad Banikazemi <MBanikazemi@gmail.com>
Mohammad Banikazemi <MBanikazemi@gmail.com> <mb@us.ibm.com>
Mohd Sadiq <mohdsadiq058@gmail.com> <mohdsadiq058@gmail.com>
Mohd Sadiq <mohdsadiq058@gmail.com> <42430865+msadiq058@users.noreply.github.com>
Mohit Soni <mosoni@ebay.com> <mohitsoni1989@gmail.com>
Moorthy RS <rsmoorthy@gmail.com> <rsmoorthy@users.noreply.github.com>
Moysés Borges <moysesb@gmail.com>
Moysés Borges <moysesb@gmail.com> <moyses.furtado@wplex.com.br>
mrfly <mr.wrfly@gmail.com> <wrfly@users.noreply.github.com>
Nace Oroz <orkica@gmail.com>
Natasha Jarus <linuxmercedes@gmail.com>
Nathan LeClaire <nathan.leclaire@docker.com> <nathan.leclaire@gmail.com> Nathan LeClaire <nathan.leclaire@docker.com> <nathan.leclaire@gmail.com>
Nathan LeClaire <nathan.leclaire@docker.com> <nathanleclaire@gmail.com> Nathan LeClaire <nathan.leclaire@docker.com> <nathanleclaire@gmail.com>
Neil Horman <nhorman@tuxdriver.com> <nhorman@hmswarspite.think-freely.org> <github@hollensbe.org> <erik+github@hollensbe.org>
Nick Russo <nicholasjamesrusso@gmail.com> <nicholasrusso@icloud.com> <github@albersweb.de> <albers@users.noreply.github.com>
Nicolas Borboën <ponsfrilus@gmail.com> <ponsfrilus@users.noreply.github.com> <lsm5@fedoraproject.org> <lsm5@redhat.com>
Nigel Poulton <nigelpoulton@hotmail.com> <marc@marc-abramowitz.com> <msabramo@gmail.com>
Nik Nyby <nikolas@gnu.org> <nnyby@columbia.edu> Matthew Heon <mheon@redhat.com> <mheon@mheonlaptop.redhat.com>
Nolan Darilek <nolan@thewordnerd.info> <bernat@luffy.cx> <vincent@bernat.im>
O.S. Tezer <ostezer@gmail.com> <bernat@luffy.cx> <Vincent.Bernat@exoscale.ch>
O.S. Tezer <ostezer@gmail.com> <ostezer@users.noreply.github.com> <p@pwaller.net> <peter@scraperwiki.com>
Oh Jinkyun <tintypemolly@gmail.com> <tintypemolly@Ohui-MacBook-Pro.local> <andrew.weiss@outlook.com> <andrew.weiss@microsoft.com>
Oliver Reason <oli@overrateddev.co> Francisco Carriedo <fcarriedo@gmail.com>
Olli Janatuinen <olli.janatuinen@gmail.com> <julienbordellier@gmail.com> <git@julienbordellier.com>
Olli Janatuinen <olli.janatuinen@gmail.com> <olljanat@users.noreply.github.com> <ahmetb@microsoft.com> <ahmetalpbalkan@gmail.com>
Onur Filiz <onur.filiz@microsoft.com> <arnaud.porterie@docker.com> <icecrime@gmail.com>
Onur Filiz <onur.filiz@microsoft.com> <ofiliz@users.noreply.github.com> <baloo@gandi.net> <superbaloo+registrations.github@superbaloo.net>
Ouyang Liduo <oyld0210@163.com> Brian Goff <cpuguy83@gmail.com>
Patrick Stapleton <github@gdi2290.com> <cpuguy83@gmail.com> <bgoff@cpuguy83-mbp.home>
Paul Liljenberg <liljenberg.paul@gmail.com> <letters@paulnotcom.se> <eric@windisch.us> <ewindisch@docker.com>
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> <ptikhomirov@parallels.com> <frank.rosquin+github@gmail.com> <frank.rosquin@gmail.com>
Pawel Konczalski <mail@konczalski.de> Hollie Teal <hollie@docker.com>
Peter Choi <phkchoi89@gmail.com> <reikani@Peters-MacBook-Pro.local> <hollie@docker.com> <hollie.teal@docker.com>
Peter Dave Hello <hsu@peterdavehello.org> <PeterDaveHello@users.noreply.github.com> <hollie@docker.com> <hollietealok@users.noreply.github.com>
Peter Jaffe <pjaffe@nevo.com> <huu@prismskylabs.com> <whoshuu@gmail.com>
Peter Nagy <xificurC@gmail.com> <pnagy@gratex.com> Jessica Frazelle <jess@mesosphere.com>
Peter Waller <p@pwaller.net> <peter@scraperwiki.com> Jessica Frazelle <jess@mesosphere.com> <jfrazelle@users.noreply.github.com>
Phil Estes <estesp@gmail.com> Jessica Frazelle <jess@mesosphere.com> <acidburn@docker.com>
Phil Estes <estesp@gmail.com> <estesp@amazon.com> Jessica Frazelle <jess@mesosphere.com> <jess@docker.com>
Phil Estes <estesp@gmail.com> <estesp@linux.vnet.ibm.com> Jessica Frazelle <jess@mesosphere.com> <princess@docker.com>
Philip Alexander Etling <paetling@gmail.com> <konrad.wilhelm.kleine@gmail.com> <kwk@users.noreply.github.com>
Philipp Gillé <philipp.gille@gmail.com> <philippgille@users.noreply.github.com> <tintypemolly@gmail.com> <tintypemolly@Ohui-MacBook-Pro.local>
Prasanna Gautam <prasannagautam@gmail.com> <estesp@linux.vnet.ibm.com> <estesp@gmail.com>
Puneet Pruthi <puneet.pruthi@oracle.com> <github@gone.nl> <thaJeztah@users.noreply.github.com>
Puneet Pruthi <puneet.pruthi@oracle.com> <puneetpruthi@gmail.com> Thomas LEVEIL <thomasleveil@gmail.com> Thomas LÉVEIL <thomasleveil@users.noreply.github.com>
Qiang Huang <h.huangqiang@huawei.com> <oi@truffles.me.uk> <timruffles@googlemail.com>
Qiang Huang <h.huangqiang@huawei.com> <qhuang@10.0.2.15> <Vincent.Bernat@exoscale.ch> <bernat@luffy.cx>
Qin TianHuan <tianhuan@bingotree.cn> Antonio Murdaca <antonio.murdaca@gmail.com> <amurdaca@redhat.com>
Ray Tsang <rayt@google.com> <saturnism@users.noreply.github.com> Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@redhat.com>
Renaud Gaubert <rgaubert@nvidia.com> <renaud.gaubert@gmail.com> Antonio Murdaca <antonio.murdaca@gmail.com> <me@runcom.ninja>
Richard Scothern <richard.scothern@gmail.com> Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@linux.com>
Robert Terhaar <rterhaar@atlanticdynamic.com> <robbyt@users.noreply.github.com> Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@users.noreply.github.com>
Roberto G. Hashioka <roberto.hashioka@docker.com> <roberto_hashioka@hotmail.com> Darren Shepherd <darren.s.shepherd@gmail.com> <darren@rancher.com>
Roberto Muñoz Fernández <robertomf@gmail.com> <roberto.munoz.fernandez.contractor@bbva.com> Deshi Xiao <dxiao@redhat.com> <dsxiao@dataman-inc.com>
Robin Thoni <robin@rthoni.com> Deshi Xiao <dxiao@redhat.com> <xiaods@gmail.com>
Roman Dudin <katrmr@gmail.com> <decadent@users.noreply.github.com> Doug Davis <dug@us.ibm.com> <duglin@users.noreply.github.com>
Rong Zhang <rongzhang@alauda.io> Jacob Atzen <jacob@jacobatzen.dk> <jatzen@gmail.com>
Rongxiang Song <tinysong1226@gmail.com> Jeff Nickoloff <jeff.nickoloff@gmail.com> <jeff@allingeek.com>
Rony Weng <ronyweng@synology.com> John Howard (VM) <John.Howard@microsoft.com> <jhowardmsft@users.noreply.github.com>
Ross Boucher <rboucher@gmail.com> John Howard (VM) <John.Howard@microsoft.com>
Rui Cao <ruicao@alauda.io> John Howard (VM) <John.Howard@microsoft.com> <john.howard@microsoft.com>
Runshen Zhu <runshen.zhu@gmail.com> John Howard (VM) <John.Howard@microsoft.com> <jhoward@microsoft.com>
Ryan Stelly <ryan.stelly@live.com> Madhu Venugopal <madhu@socketplane.io> <madhu@docker.com>
Ryoga Saito <contact@proelbtn.com> Mary Anthony <mary.anthony@docker.com> <mary@docker.com>
Ryoga Saito <contact@proelbtn.com> <proelbtn@users.noreply.github.com> Mary Anthony <mary.anthony@docker.com> moxiegirl <mary@docker.com>
Sainath Grandhi <sainath.grandhi@intel.com> Mary Anthony <mary.anthony@docker.com> <moxieandmore@gmail.com>
Sainath Grandhi <sainath.grandhi@intel.com> <saiallforums@gmail.com> mattyw <mattyw@me.com> <gh@mattyw.net>
Sakeven Jiang <jc5930@sina.cn> resouer <resouer@163.com> <resouer@gmail.com>
Samuel Karp <me@samuelkarp.com> <skarp@amazon.com> AJ Bowen <aj@gandi.net> soulshake <amy@gandi.net>
Sandeep Bansal <sabansal@microsoft.com> AJ Bowen <aj@gandi.net> soulshake <aj@gandi.net>
Sandeep Bansal <sabansal@microsoft.com> <msabansal@microsoft.com>
Santhosh Manohar <santhosh@docker.com>
Sargun Dhillon <sargun@netflix.com> <sargun@sargun.me>
Satoshi Tagomori <tagomoris@gmail.com>
Sean Lee <seanlee@tw.ibm.com> <scaleoutsean@users.noreply.github.com>
Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn <github@gone.nl> <moby@example.com>
Sebastiaan van Stijn <github@gone.nl> <sebastiaan@ws-key-sebas3.dpi1.dpi>
Sebastiaan van Stijn <github@gone.nl> <thaJeztah@users.noreply.github.com>
Sebastian Thomschke <sebthom@users.noreply.github.com>
Seongyeol Lim <seongyeol37@gmail.com>
Serhii Nakon <serhii.n@thescimus.com>
Shaun Kaasten <shaunk@gmail.com>
Shawn Landden <shawn@churchofgit.com> <shawnlandden@gmail.com>
Shengbo Song <thomassong@tencent.com>
Shengbo Song <thomassong@tencent.com> <mymneo@163.com>
Shih-Yuan Lee <fourdollars@gmail.com>
Shishir Mahajan <shishir.mahajan@redhat.com> <smahajan@redhat.com>
Shu-Wai Chow <shu-wai.chow@seattlechildrens.org>
Shukui Yang <yangshukui@huawei.com>
Sidhartha Mani <sidharthamn@gmail.com>
Sjoerd Langkemper <sjoerd-github@linuxonly.nl> <sjoerd@byte.nl>
Smark Meng <smark@freecoop.net>
Smark Meng <smark@freecoop.net> <smarkm@users.noreply.github.com>
Solomon Hykes <solomon@docker.com> <s@docker.com>
Solomon Hykes <solomon@docker.com> <solomon.hykes@dotcloud.com>
Solomon Hykes <solomon@docker.com> <solomon@dotcloud.com>
Soshi Katsuta <soshi.katsuta@gmail.com>
Soshi Katsuta <soshi.katsuta@gmail.com> <katsuta_soshi@cyberagent.co.jp>
Sridhar Ratnakumar <sridharr@activestate.com>
Sridhar Ratnakumar <sridharr@activestate.com> <github@srid.name>
Srini Brahmaroutu <srbrahma@us.ibm.com> <sbrahma@us.ibm.com>
Srinivasan Srivatsan <srinivasan.srivatsan@hpe.com> <srinsriv@users.noreply.github.com>
Stefan Berger <stefanb@linux.vnet.ibm.com>
Stefan Berger <stefanb@linux.vnet.ibm.com> <stefanb@us.ibm.com>
Stefan J. Wernli <swernli@microsoft.com> <swernli@ntdev.microsoft.com>
Stefan S. <tronicum@user.github.com>
Stefan Scherer <stefan.scherer@docker.com>
Stefan Scherer <stefan.scherer@docker.com> <scherer_stefan@icloud.com>
Stephan Spindler <shutefan@gmail.com> <shutefan@users.noreply.github.com>
Stephen Day <stevvooe@gmail.com>
Stephen Day <stevvooe@gmail.com> <stephen.day@docker.com>
Stephen Day <stevvooe@gmail.com> <stevvooe@users.noreply.github.com>
Steve Desmond <steve@vtsv.ca> <stevedesmond-ca@users.noreply.github.com>
Sun Gengze <690388648@qq.com>
Sun Jianbo <wonderflow.sun@gmail.com>
Sun Jianbo <wonderflow.sun@gmail.com> <wonderflow@zju.edu.cn>
Sven Dowideit <SvenDowideit@home.org.au>
Sven Dowideit <SvenDowideit@home.org.au> <sven@t440s.home.gateway>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@docker.com>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@fosiki.com>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@home.org.au>
Sven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@users.noreply.github.com>
Sven Dowideit <SvenDowideit@home.org.au> <¨SvenDowideit@home.org.au¨>
Sylvain Baubeau <lebauce@gmail.com>
Sylvain Baubeau <lebauce@gmail.com> <sbaubeau@redhat.com>
Sylvain Bellemare <sylvain@ascribe.io>
Sylvain Bellemare <sylvain@ascribe.io> <sylvain.bellemare@ezeep.com>
Takuto Sato <tockn.jp@gmail.com>
Tangi Colin <tangicolin@gmail.com>
Tejesh Mehta <tejesh.mehta@gmail.com> <tj@init.me>
Terry Chu <zue.hterry@gmail.com>
Terry Chu <zue.hterry@gmail.com> <jubosh.tw@gmail.com>
Thatcher Peskens <thatcher@docker.com>
Thatcher Peskens <thatcher@docker.com> <thatcher@dotcloud.com>
Thatcher Peskens <thatcher@docker.com> <thatcher@gmx.net>
Thiago Alves Silva <thiago.alves@aurea.com>
Thiago Alves Silva <thiago.alves@aurea.com> <thiagoalves@users.noreply.github.com>
Thomas Gazagnaire <thomas@gazagnaire.org> <thomas@gazagnaire.com>
Thomas Ledos <thomas.ledos92@gmail.com>
Thomas Léveil <thomasleveil@gmail.com>
Thomas Léveil <thomasleveil@gmail.com> <thomasleveil@users.noreply.github.com>
Tibor Vass <teabee89@gmail.com> <tibor@docker.com> Tibor Vass <teabee89@gmail.com> <tibor@docker.com>
Tibor Vass <teabee89@gmail.com> <tiborvass@users.noreply.github.com> Tibor Vass <teabee89@gmail.com> <tiborvass@users.noreply.github.com>
Till Claassen <pixelistik@users.noreply.github.com> Vincent Bernat <bernat@luffy.cx> <Vincent.Bernat@exoscale.ch>
Tim Bart <tim@fewagainstmany.com>
Tim Bosse <taim@bosboot.org> <maztaim@users.noreply.github.com>
Tim Potter <tpot@hpe.com>
Tim Potter <tpot@hpe.com> <tpot@Tims-MacBook-Pro.local>
Tim Ruffles <oi@truffles.me.uk> <timruffles@googlemail.com>
Tim Terhorst <mynamewastaken+git@gmail.com>
Tim Wagner <tim.wagner@freenet.ag>
Tim Wagner <tim.wagner@freenet.ag> <33624860+herrwagner@users.noreply.github.com>
Tim Zju <21651152@zju.edu.cn>
Timothy Hobbs <timothyhobbs@seznam.cz>
Toli Kuznets <toli@docker.com>
Tom Barlow <tomwbarlow@gmail.com>
Tom Denham <tom@tomdee.co.uk>
Tom Denham <tom@tomdee.co.uk> <tom.denham@metaswitch.com>
Tom Sweeney <tsweeney@redhat.com>
Tom Wilkie <tom.wilkie@gmail.com>
Tom Wilkie <tom.wilkie@gmail.com> <tom@weave.works>
Tõnis Tiigi <tonistiigi@gmail.com>
Trace Andreason <tandreason@gmail.com>
Trapier Marshall <tmarshall@mirantis.com>
Trapier Marshall <tmarshall@mirantis.com> <trapier.marshall@docker.com>
Trishna Guha <trishnaguha17@gmail.com>
Tristan Carel <tristan@cogniteev.com>
Tristan Carel <tristan@cogniteev.com> <tristan.carel@gmail.com>
Tyler Brown <tylers.pile@gmail.com>
Umesh Yadav <umesh4257@gmail.com>
Umesh Yadav <umesh4257@gmail.com> <dungeonmaster18@users.noreply.github.com>
Victor Lyuboslavsky <victor@victoreda.com>
Victor Vieux <victor.vieux@docker.com> <dev@vvieux.com>
Victor Vieux <victor.vieux@docker.com> <victor.vieux@dotcloud.com>
Victor Vieux <victor.vieux@docker.com> <victor@docker.com>
Victor Vieux <victor.vieux@docker.com> <victor@dotcloud.com>
Victor Vieux <victor.vieux@docker.com> <victorvieux@gmail.com>
Victor Vieux <victor.vieux@docker.com> <vieux@docker.com>
Vikas Choudhary <choudharyvikas16@gmail.com>
Vikram bir Singh <vsingh@mirantis.com>
Vikram bir Singh <vsingh@mirantis.com> <vikrambir.singh@docker.com>
Viktor Vojnovski <viktor.vojnovski@amadeus.com> <vojnovski@gmail.com>
Vincent Batts <vbatts@redhat.com> <vbatts@hashbangbash.com>
Vincent Bernat <vincent@bernat.ch>
Vincent Bernat <vincent@bernat.ch> <bernat@luffy.cx>
Vincent Bernat <vincent@bernat.ch> <Vincent.Bernat@exoscale.ch>
Vincent Bernat <vincent@bernat.ch> <vincent@bernat.im>
Vincent Boulineau <vincent.boulineau@datadoghq.com>
Vincent Demeester <vincent.demeester@docker.com> <vincent+github@demeester.fr>
Vincent Demeester <vincent.demeester@docker.com> <vincent@demeester.fr>
Vincent Demeester <vincent.demeester@docker.com> <vincent@sbr.pm>
Vishnu Kannan <vishnuk@google.com>
Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Vitaly Ostrosablin <vostrosablin@virtuozzo.com> <tmp6154@yandex.ru>
Vladimir Rutsky <altsysrq@gmail.com> <iamironbob@gmail.com>
Vladislav Kolesnikov <vkolesnikov@beget.ru>
Vladislav Kolesnikov <vkolesnikov@beget.ru> <prime@vladqa.ru>
Walter Stanish <walter@pratyeka.org>
Wang Chao <chao.wang@ucloud.cn>
Wang Chao <chao.wang@ucloud.cn> <wcwxyz@gmail.com>
Wang Guoliang <liangcszzu@163.com>
Wang Jie <wangjie5@chinaskycloud.com>
Wang Ping <present.wp@icloud.com>
Wang Xing <hzwangxing@corp.netease.com> <root@localhost>
Wang Yuexiao <wang.yuexiao@zte.com.cn>
Wayne Chang <wayne@neverfear.org>
Wayne Song <wsong@docker.com> <wsong@users.noreply.github.com>
Wei Wu <wuwei4455@gmail.com> cizixs <cizixs@163.com>
Wei-Ting Kuo <waitingkuo0527@gmail.com>
Wen Cheng Ma <wenchma@cn.ibm.com>
Wenjun Tang <tangwj2@lenovo.com> <dodia@163.com>
Wewang Xiaorenfine <wang.xiaoren@zte.com.cn>
Will Weaver <monkey@buildingbananas.com>
Wing-Kam Wong <wingkwong.code@gmail.com>
WuLonghui <wlh6666@qq.com>
Xian Chaobo <xianchaobo@huawei.com>
Xian Chaobo <xianchaobo@huawei.com> <jimmyxian2004@yahoo.com.cn>
Xianglin Gao <xlgao@zju.edu.cn>
Xianjie <guxianjie@gmail.com>
Xianjie <guxianjie@gmail.com> <datastream@datastream-laptop.local>
Xianlu Bird <xianlubird@gmail.com>
Xiao YongBiao <xyb4638@gmail.com>
Xiao Zhang <xiaozhang0210@hotmail.com>
Xiaodong Liu <liuxiaodong@loongson.cn>
Xiaodong Zhang <a4012017@sina.com>
Xiaohua Ding <xiao_hua_ding@sina.cn>
Xiaoyu Zhang <zhang.xiaoyu33@zte.com.cn>
Xinfeng Liu <XinfengLiu@icloud.com>
Xinfeng Liu <XinfengLiu@icloud.com> <xinfeng.liu@gmail.com>
Xuecong Liao <satorulogic@gmail.com>
Yamasaki Masahide <masahide.y@gmail.com>
Yao Zaiyong <yaozaiyong@hotmail.com>
Yassine Tijani <yasstij11@gmail.com>
Yazhong Liu <yorkiefixer@gmail.com>
Yestin Sun <sunyi0804@gmail.com> <yestin.sun@polyera.com> Yestin Sun <sunyi0804@gmail.com> <yestin.sun@polyera.com>
Yi EungJun <eungjun.yi@navercorp.com> <semtlenori@gmail.com> bin liu <liubin0329@users.noreply.github.com> <liubin0329@gmail.com>
Ying Li <ying.li@docker.com> John Howard (VM) <John.Howard@microsoft.com> jhowardmsft <jhoward@microsoft.com>
Ying Li <ying.li@docker.com> <cyli@twistedmatrix.com> Ankush Agarwal <ankushagarwal11@gmail.com> <ankushagarwal@users.noreply.github.com>
Yong Tang <yong.tang.github@outlook.com> <yongtang@users.noreply.github.com> Tangi COLIN <tangicolin@gmail.com> tangicolin <tangicolin@gmail.com>
Yongxin Li <yxli@alauda.io> Allen Sun <allen.sun@daocloud.io>
Yosef Fertel <yfertel@gmail.com> <frosforever@users.noreply.github.com> Adrien Gallouët <adrien@gallouet.fr> <angt@users.noreply.github.com>
Yu Changchun <yuchangchun1@huawei.com> <aanm90@gmail.com> <martins@noironetworks.com>
Yu Chengxia <yuchengxia@huawei.com> Anuj Bahuguna <anujbahuguna.dev@gmail.com>
Yu Peng <yu.peng36@zte.com.cn> Anusha Ragunathan <anusha.ragunathan@docker.com> <anusha@docker.com>
Yu Peng <yu.peng36@zte.com.cn> <yupeng36@zte.com.cn> Avi Miller <avi.miller@oracle.com> <avi.miller@gmail.com>
Yuan Sun <sunyuan3@huawei.com> Brent Salisbury <brent.salisbury@docker.com> <brent@docker.com>
Yue Zhang <zy675793960@yeah.net> Chander G <chandergovind@gmail.com>
Yufei Xiong <yufei.xiong@qq.com> Chun Chen <ramichen@tencent.com> <chenchun.feed@gmail.com>
Zach Gershman <zachgersh@gmail.com> Ying Li <cyli@twistedmatrix.com>
Zach Gershman <zachgersh@gmail.com> <zachgersh@users.noreply.github.com> Daehyeok Mun <daehyeok@gmail.com> <daehyeok@daehyeok-ui-MacBook-Air.local>
Zachary Jaffee <zjaffee@us.ibm.com> <zij@case.edu> <dqminh@cloudflare.com> <dqminh89@gmail.com>
Zachary Jaffee <zjaffee@us.ibm.com> <zjaffee@apache.org> Daniel, Dao Quang Minh <dqminh@cloudflare.com>
Zhang Kun <zkazure@gmail.com> Daniel Nephin <dnephin@docker.com> <dnephin@gmail.com>
Zhang Wentao <zhangwentao234@huawei.com> Dave Tucker <dt@docker.com> <dave@dtucker.co.uk>
ZhangHang <stevezhang2014@gmail.com> Doug Tangren <d.tangren@gmail.com>
Zhenkun Bi <bi.zhenkun@zte.com.cn> Frederick F. Kautz IV <fkautz@redhat.com> <fkautz@alumni.cmu.edu>
Zhou Hao <zhouhao@cn.fujitsu.com> Ben Golub <ben.golub@dotcloud.com>
Zhoulin Xie <zhoulin.xie@daocloud.io> Harold Cooper <hrldcpr@gmail.com>
Zhu Kunjia <zhu.kunjia@zte.com.cn> hsinko <21551195@zju.edu.cn> <hsinko@users.noreply.github.com>
Ziheng Liu <lzhfromustc@gmail.com> Josh Hawn <josh.hawn@docker.com> <jlhawn@berkeley.edu>
Zou Yu <zouyu7@huawei.com> Justin Cormack <justin.cormack@docker.com>
Zuhayr Elahi <zuhayr.elahi@docker.com> <justin.cormack@docker.com> <justin.cormack@unikernel.com>
Zuhayr Elahi <zuhayr.elahi@docker.com> <elahi.zuhayr@gmail.com> <justin.cormack@docker.com> <justin@specialbusservice.com>
정재영 <jjy600901@gmail.com> Kamil Domański <kamil@domanski.co>
정재영 <jjy600901@gmail.com> <43400316+J-jaeyoung@users.noreply.github.com> Lei Jitang <leijitang@huawei.com>
<leijitang@huawei.com> <leijitang@gmail.com>
Linus Heckemann <lheckemann@twig-world.com>
<lheckemann@twig-world.com> <anonymouse2048@gmail.com>
Lynda O'Leary <lyndaoleary29@gmail.com>
<lyndaoleary29@gmail.com> <lyndaoleary@hotmail.com>
Marianna Tessel <mtesselh@gmail.com>
Michael Huettermann <michael@huettermann.net>
Moysés Borges <moysesb@gmail.com>
<moysesb@gmail.com> <moyses.furtado@wplex.com.br>
Nigel Poulton <nigelpoulton@hotmail.com>
Qiang Huang <h.huangqiang@huawei.com>
<h.huangqiang@huawei.com> <qhuang@10.0.2.15>
Boaz Shuster <ripcurld.github@gmail.com>
Shuwei Hao <haosw@cn.ibm.com>
<haosw@cn.ibm.com> <haoshuwei24@gmail.com>
Soshi Katsuta <soshi.katsuta@gmail.com>
<soshi.katsuta@gmail.com> <katsuta_soshi@cyberagent.co.jp>
Stefan Berger <stefanb@linux.vnet.ibm.com>
<stefanb@linux.vnet.ibm.com> <stefanb@us.ibm.com>
Stephen Day <stephen.day@docker.com>
<stephen.day@docker.com> <stevvooe@users.noreply.github.com>
Toli Kuznets <toli@docker.com>
Tristan Carel <tristan@cogniteev.com>
<tristan@cogniteev.com> <tristan.carel@gmail.com>
Vincent Demeester <vincent@sbr.pm>
<vincent@sbr.pm> <vincent+github@demeester.fr>
Vishnu Kannan <vishnuk@google.com>
xlgao-zju <xlgao@zju.edu.cn> xlgao <xlgao@zju.edu.cn>
yuchangchun <yuchangchun1@huawei.com> y00277921 <yuchangchun1@huawei.com>
<zij@case.edu> <zjaffee@us.ibm.com>
<anujbahuguna.dev@gmail.com> <abahuguna@fiberlink.com>
<eungjun.yi@navercorp.com> <semtlenori@gmail.com>
<haosw@cn.ibm.com> <haoshuwei1989@163.com>
Hao Shu Wei <haosw@cn.ibm.com>
<matt.bentley@docker.com> <mbentley@mbentley.net>
<MihaiBorob@gmail.com> <MihaiBorobocea@gmail.com>
<redmond.martin@gmail.com> <xgithub@redmond5.com>
<redmond.martin@gmail.com> <martin@tinychat.com>
<srbrahma@us.ibm.com> <sbrahma@us.ibm.com>
<suda.akihiro@lab.ntt.co.jp> <suda.kyoto@gmail.com>
<thomas@gazagnaire.org> <thomas@gazagnaire.com>
Shengbo Song <thomassong@tencent.com> mYmNeo <mymneo@163.com>
Shengbo Song <thomassong@tencent.com>
<sylvain@ascribe.io> <sylvain.bellemare@ezeep.com>
Sylvain Bellemare <sylvain@ascribe.io>

1238
AUTHORS

File diff suppressed because it is too large Load diff

3054
CHANGELOG.md Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,14 +1,14 @@
# Contribute to the Moby Project # Contributing to Docker
Want to hack on the Moby Project? Awesome! We have a contributor's guide that explains Want to hack on Docker? Awesome! We have a contributor's guide that explains
[setting up a development environment and the contribution [setting up a Docker development environment and the contribution
process](docs/contributing/). process](https://docs.docker.com/opensource/project/who-written-for/).
[![Contributors guide](docs/static_files/contributors.png)](https://docs.docker.com/opensource/project/who-written-for/) [![Contributors guide](docs/static_files/contributors.png)](https://docs.docker.com/opensource/project/who-written-for/)
This page contains information about reporting issues as well as some tips and This page contains information about reporting issues as well as some tips and
guidelines useful to experienced open source contributors. Finally, make sure guidelines useful to experienced open source contributors. Finally, make sure
you read our [community guidelines](#moby-community-guidelines) before you you read our [community guidelines](#docker-community-guidelines) before you
start participating. start participating.
## Topics ## Topics
@ -17,20 +17,20 @@ start participating.
* [Design and Cleanup Proposals](#design-and-cleanup-proposals) * [Design and Cleanup Proposals](#design-and-cleanup-proposals)
* [Reporting Issues](#reporting-other-issues) * [Reporting Issues](#reporting-other-issues)
* [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines) * [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines)
* [Community Guidelines](#moby-community-guidelines) * [Community Guidelines](#docker-community-guidelines)
## Reporting security issues ## Reporting security issues
The Moby maintainers take security seriously. If you discover a security The Docker maintainers take security seriously. If you discover a security
issue, please bring it to their attention right away! issue, please bring it to their attention right away!
Please **DO NOT** file a public issue, instead send your report privately to Please **DO NOT** file a public issue, instead send your report privately to
[security@docker.com](mailto:security@docker.com). [security@docker.com](mailto:security@docker.com).
Security reports are greatly appreciated and we will publicly thank you for it, Security reports are greatly appreciated and we will publicly thank you for it.
although we keep your name confidential if you request it. We also like to send We also like to send gifts&mdash;if you're into Docker schwag, make sure to let
gifts&mdash;if you're into schwag, make sure to let us know. We currently do not us know. We currently do not offer a paid security bounty program, but are not
offer a paid security bounty program, but are not ruling it out in the future. ruling it out in the future.
## Reporting other issues ## Reporting other issues
@ -39,7 +39,7 @@ A great way to contribute to the project is to send a detailed report when you
encounter an issue. We always appreciate a well-written, thorough bug report, encounter an issue. We always appreciate a well-written, thorough bug report,
and will thank you for it! and will thank you for it!
Check that [our issue database](https://github.com/moby/moby/issues) Check that [our issue database](https://github.com/docker/docker/issues)
doesn't already include that problem or suggestion before submitting an issue. doesn't already include that problem or suggestion before submitting an issue.
If you find a match, you can use the "subscribe" button to get notified on If you find a match, you can use the "subscribe" button to get notified on
updates. Do *not* leave random "+1" or "I have this too" comments, as they updates. Do *not* leave random "+1" or "I have this too" comments, as they
@ -66,13 +66,13 @@ This section gives the experienced contributor some tips and guidelines.
Not sure if that typo is worth a pull request? Found a bug and know how to fix Not sure if that typo is worth a pull request? Found a bug and know how to fix
it? Do it! We will appreciate it. Any significant improvement should be it? Do it! We will appreciate it. Any significant improvement should be
documented as [a GitHub issue](https://github.com/moby/moby/issues) before documented as [a GitHub issue](https://github.com/docker/docker/issues) before
anybody starts working on it. anybody starts working on it.
We are always thrilled to receive pull requests. We do our best to process them We are always thrilled to receive pull requests. We do our best to process them
quickly. If your pull request is not accepted on the first try, quickly. If your pull request is not accepted on the first try,
don't get discouraged! Our contributor's guide explains [the review process we don't get discouraged! Our contributor's guide explains [the review process we
use for simple changes](https://docs.docker.com/contribute/overview/). use for simple changes](https://docs.docker.com/opensource/workflow/make-a-contribution/).
### Design and cleanup proposals ### Design and cleanup proposals
@ -83,7 +83,11 @@ contributions, see [the advanced contribution
section](https://docs.docker.com/opensource/workflow/advanced-contributing/) in section](https://docs.docker.com/opensource/workflow/advanced-contributing/) in
the contributors guide. the contributors guide.
### Connect with other Moby Project contributors We try hard to keep Docker lean and focused. Docker can't do everything for
everybody. This means that we might decide against incorporating a new feature.
However, there might be a way to implement that feature *on top of* Docker.
### Talking to other Docker users and contributors
<table class="tg"> <table class="tg">
<col width="45%"> <col width="45%">
@ -92,28 +96,52 @@ the contributors guide.
<td>Forums</td> <td>Forums</td>
<td> <td>
A public forum for users to discuss questions and explore current design patterns and A public forum for users to discuss questions and explore current design patterns and
best practices about all the Moby projects. To participate, log in with your Github best practices about Docker and related projects in the Docker Ecosystem. To participate,
account or create an account at <a href="https://forums.mobyproject.org" target="_blank">https://forums.mobyproject.org</a>. just log in with your Docker Hub account on <a href="https://forums.docker.com" target="_blank">https://forums.docker.com</a>.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Slack</td> <td>Internet&nbsp;Relay&nbsp;Chat&nbsp;(IRC)</td>
<td> <td>
<p> <p>
Register for the Docker Community Slack at IRC a direct line to our most knowledgeable Docker users; we have
<a href="https://dockr.ly/comm-slack" target="_blank">https://dockr.ly/comm-slack</a>. both the <code>#docker</code> and <code>#docker-dev</code> group on
We use the #moby-project channel for general discussion, and there are separate channels for other Moby projects such as #containerd. <strong>irc.freenode.net</strong>.
IRC is a rich chat protocol but it can overwhelm new users. You can search
<a href="https://botbot.me/freenode/docker/#" target="_blank">our chat archives</a>.
</p> </p>
<p>
Read our <a href="https://docs.docker.com/opensource/get-help/#irc-quickstart" target="_blank">IRC quickstart guide</a>
for an easy way to get started.
</p>
</td>
</tr>
<tr>
<td>Google Group</td>
<td>
The <a href="https://groups.google.com/forum/#!forum/docker-dev" target="_blank">docker-dev</a>
group is for contributors and other people contributing to the Docker project.
You can join them without a google account by sending an email to
<a href="mailto:docker-dev+subscribe@googlegroups.com">docker-dev+subscribe@googlegroups.com</a>.
After receiving the join-request message, you can simply reply to that to confirm the subscribtion.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Twitter</td> <td>Twitter</td>
<td> <td>
You can follow <a href="https://twitter.com/moby/" target="_blank">Moby Project Twitter feed</a> You can follow <a href="https://twitter.com/docker/" target="_blank">Docker's Twitter feed</a>
to get updates on our products. You can also tweet us questions or just to get updates on our products. You can also tweet us questions or just
share blogs or stories. share blogs or stories.
</td> </td>
</tr> </tr>
<tr>
<td>Stack Overflow</td>
<td>
Stack Overflow has over 17000 Docker questions listed. We regularly
monitor <a href="https://stackoverflow.com/search?tab=newest&q=docker" target="_blank">Docker questions</a>
and so do many other knowledgeable Docker users.
</td>
</tr>
</table> </table>
@ -127,11 +155,10 @@ Fork the repository and make changes on your fork in a feature branch:
your intentions, and name it XXXX-something where XXXX is the number of the your intentions, and name it XXXX-something where XXXX is the number of the
issue. issue.
Submit tests for your changes. See [TESTING.md](./TESTING.md) for details. Submit unit tests for your changes. Go has a great test framework built in; use
it! Take a look at existing tests for inspiration. [Run the full test
If your changes need integration tests, write them against the API. The `cli` suite](https://docs.docker.com/opensource/project/test-and-docs/) on your branch before
integration tests are slowly either migrated to API tests or moved away as unit submitting a pull request.
tests in `docker/cli` and end-to-end tests for Docker.
Update the documentation when creating or modifying features. Test your Update the documentation when creating or modifying features. Test your
documentation changes for clarity, concision, and correctness, as well as a documentation changes for clarity, concision, and correctness, as well as a
@ -146,64 +173,10 @@ committing your changes. Most editors have plug-ins that do this automatically.
Pull request descriptions should be as clear as possible and include a reference Pull request descriptions should be as clear as possible and include a reference
to all the issues that they address. to all the issues that they address.
### Successful Changes
Before contributing large or high impact changes, make the effort to coordinate
with the maintainers of the project before submitting a pull request. This
prevents you from doing extra work that may or may not be merged.
Large PRs that are just submitted without any prior communication are unlikely
to be successful.
While pull requests are the methodology for submitting changes to code, changes
are much more likely to be accepted if they are accompanied by additional
engineering work. While we don't define this explicitly, most of these goals
are accomplished through communication of the design goals and subsequent
solutions. Often times, it helps to first state the problem before presenting
solutions.
Typically, the best methods of accomplishing this are to submit an issue,
stating the problem. This issue can include a problem statement and a
checklist with requirements. If solutions are proposed, alternatives should be
listed and eliminated. Even if the criteria for elimination of a solution is
frivolous, say so.
Larger changes typically work best with design documents. These are focused on
providing context to the design at the time the feature was conceived and can
inform future documentation contributions.
### Commit Messages
Commit messages must start with a capitalized and short summary (max. 50 chars) Commit messages must start with a capitalized and short summary (max. 50 chars)
written in the imperative, followed by an optional, more detailed explanatory written in the imperative, followed by an optional, more detailed explanatory
text which is separated from the summary by an empty line. text which is separated from the summary by an empty line.
Commit messages should follow best practices, including explaining the context
of the problem and how it was solved, including in caveats or follow up changes
required. They should tell the story of the change and provide readers
understanding of what led to it.
If you're lost about what this even means, please see [How to Write a Git
Commit Message](http://chris.beams.io/posts/git-commit/) for a start.
In practice, the best approach to maintaining a nice commit message is to
leverage a `git add -p` and `git commit --amend` to formulate a solid
changeset. This allows one to piece together a change, as information becomes
available.
If you squash a series of commits, don't just submit that. Re-write the commit
message, as if the series of commits was a single stroke of brilliance.
That said, there is no requirement to have a single commit for a PR, as long as
each commit tells the story. For example, if there is a feature that requires a
package, it might make sense to have the package in a separate commit then have
a subsequent commit that uses it.
Remember, you're telling part of the story with the commit message. Don't make
your chapter weird.
### Review
Code review comments may be added to your pull request. Discuss, then make the Code review comments may be added to your pull request. Discuss, then make the
suggested modifications and push additional commits to your feature branch. Post suggested modifications and push additional commits to your feature branch. Post
a comment after pushing. New commits show up in the pull request automatically, a comment after pushing. New commits show up in the pull request automatically,
@ -224,9 +197,10 @@ calling it in another file constitute a single logical unit of work. The very
high majority of submissions should have a single commit, so if in doubt: squash high majority of submissions should have a single commit, so if in doubt: squash
down to one. down to one.
After every commit, [make sure the test suite passes](./TESTING.md). Include After every commit, [make sure the test suite passes]
documentation changes in the same pull request so that a revert would remove (https://docs.docker.com/opensource/project/test-and-docs/). Include documentation
all traces of the feature or fix. changes in the same pull request so that a revert would remove all traces of
the feature or fix.
Include an issue reference like `Closes #XXXX` or `Fixes #XXXX` in commits that Include an issue reference like `Closes #XXXX` or `Fixes #XXXX` in commits that
close an issue. Including references automatically closes the issue on a merge. close an issue. Including references automatically closes the issue on a merge.
@ -238,11 +212,15 @@ Please see the [Coding Style](#coding-style) for further guidelines.
### Merge approval ### Merge approval
Moby maintainers use LGTM (Looks Good To Me) in comments on the code review to Docker maintainers use LGTM (Looks Good To Me) in comments on the code review to
indicate acceptance, or use the Github review approval feature. indicate acceptance.
For an explanation of the review and approval process see the A change requires LGTMs from an absolute majority of the maintainers of each
[REVIEWING](project/REVIEWING.md) page. component affected. For example, if a change affects `docs/` and `registry/`, it
needs an absolute majority from the maintainers of `docs/` AND, separately, an
absolute majority of the maintainers of `registry/`.
For more details, see the [MAINTAINERS](MAINTAINERS) page.
### Sign your work ### Sign your work
@ -256,9 +234,8 @@ Developer Certificate of Origin
Version 1.1 Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors. Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive 660 York Street, Suite 102,
Suite D4700 San Francisco, CA 94110 USA
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed. license document, but changing it is not allowed.
@ -302,16 +279,17 @@ commit automatically with `git commit -s`.
### How can I become a maintainer? ### How can I become a maintainer?
The procedures for adding new maintainers are explained in the The procedures for adding new maintainers are explained in the
[/project/GOVERNANCE.md](/project/GOVERNANCE.md) global [MAINTAINERS](https://github.com/docker/opensource/blob/master/MAINTAINERS)
file in this repository. file in the [https://github.com/docker/opensource/](https://github.com/docker/opensource/)
repository.
Don't forget: being a maintainer is a time investment. Make sure you Don't forget: being a maintainer is a time investment. Make sure you
will have time to make yourself available. You don't have to be a will have time to make yourself available. You don't have to be a
maintainer to make a difference on the project! maintainer to make a difference on the project!
## Moby community guidelines ## Docker community guidelines
We want to keep the Moby community awesome, growing and collaborative. We need We want to keep the Docker community awesome, growing and collaborative. We need
your help to keep it that way. To help with this we've come up with some general your help to keep it that way. To help with this we've come up with some general
guidelines for the community as a whole: guidelines for the community as a whole:
@ -339,11 +317,6 @@ guidelines for the community as a whole:
used to ping maintainers to review a pull request, a proposal or an used to ping maintainers to review a pull request, a proposal or an
issue. issue.
The open source governance for this repository is handled via the [Moby Technical Steering Committee (TSC)](https://github.com/moby/tsc)
charter. For any concerns with the community process regarding technical contributions,
please contact the TSC. More information on project governance is available in
our [project/GOVERNANCE.md](/project/GOVERNANCE.md) document.
### Guideline violations — 3 strikes method ### Guideline violations — 3 strikes method
The point of this section is not to find opportunities to punish people, but we The point of this section is not to find opportunities to punish people, but we
@ -422,6 +395,6 @@ The rules:
guidelines. Since you've read all the rules, you now know that. guidelines. Since you've read all the rules, you now know that.
If you are having trouble getting into the mood of idiomatic Go, we recommend If you are having trouble getting into the mood of idiomatic Go, we recommend
reading through [Effective Go](https://go.dev/doc/effective_go). The reading through [Effective Go](https://golang.org/doc/effective_go.html). The
[Go Blog](https://go.dev/blog/) is also a great resource. Drinking the [Go Blog](https://blog.golang.org) is also a great resource. Drinking the
kool-aid is a lot easier than going thirsty. kool-aid is a lot easier than going thirsty.

View file

@ -1,671 +1,272 @@
# syntax=docker/dockerfile:1.7 # This file describes the standard way to build Docker, using docker
ARG GO_VERSION=1.21.9
ARG BASE_DEBIAN_DISTRO="bookworm"
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
ARG XX_VERSION=1.4.0
ARG VPNKIT_VERSION=0.5.0
ARG DOCKERCLI_REPOSITORY="https://github.com/docker/cli.git"
ARG DOCKERCLI_VERSION=v26.0.0
# cli version used for integration-cli tests
ARG DOCKERCLI_INTEGRATION_REPOSITORY="https://github.com/docker/cli.git"
ARG DOCKERCLI_INTEGRATION_VERSION=v17.06.2-ce
ARG BUILDX_VERSION=0.13.1
ARG COMPOSE_VERSION=v2.25.0
ARG SYSTEMD="false"
ARG DOCKER_STATIC=1
# REGISTRY_VERSION specifies the version of the registry to download from
# https://hub.docker.com/r/distribution/distribution. This version of
# the registry is used to test schema 2 manifests. Generally, the version
# specified here should match a current release.
ARG REGISTRY_VERSION=2.8.3
# delve is currently only supported on linux/amd64 and linux/arm64;
# https://github.com/go-delve/delve/blob/v1.8.1/pkg/proc/native/support_sentinel.go#L1-L6
ARG DELVE_SUPPORTED=${TARGETPLATFORM#linux/amd64} DELVE_SUPPORTED=${DELVE_SUPPORTED#linux/arm64}
ARG DELVE_SUPPORTED=${DELVE_SUPPORTED:+"unsupported"}
ARG DELVE_SUPPORTED=${DELVE_SUPPORTED:-"supported"}
# cross compilation helper
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
# dummy stage to make sure the image is built for deps that don't support some
# architectures
FROM --platform=$BUILDPLATFORM busybox AS build-dummy
RUN mkdir -p /build
FROM scratch AS binary-dummy
COPY --from=build-dummy /build /build
# base
FROM --platform=$BUILDPLATFORM ${GOLANG_IMAGE} AS base
COPY --from=xx / /
RUN echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN apt-get update && apt-get install --no-install-recommends -y file
ENV GO111MODULE=off
ENV GOTOOLCHAIN=local
FROM base AS criu
ADD --chmod=0644 https://download.opensuse.org/repositories/devel:/tools:/criu/Debian_11/Release.key /etc/apt/trusted.gpg.d/criu.gpg.asc
RUN --mount=type=cache,sharing=locked,id=moby-criu-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-criu-aptcache,target=/var/cache/apt \
echo 'deb https://download.opensuse.org/repositories/devel:/tools:/criu/Debian_12/ /' > /etc/apt/sources.list.d/criu.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends criu \
&& install -D /usr/sbin/criu /build/criu \
&& /build/criu --version
# registry
FROM base AS registry-src
WORKDIR /usr/src/registry
RUN git init . && git remote add origin "https://github.com/distribution/distribution.git"
FROM base AS registry
WORKDIR /go/src/github.com/docker/distribution
# REGISTRY_VERSION_SCHEMA1 specifies the version of the registry to build and
# install from the https://github.com/docker/distribution repository. This is
# an older (pre v2.3.0) version of the registry that only supports schema1
# manifests. This version of the registry is not working on arm64, so installation
# is skipped on that architecture.
ARG REGISTRY_VERSION_SCHEMA1=v2.1.0
ARG TARGETPLATFORM
RUN --mount=from=registry-src,src=/usr/src/registry,rw \
--mount=type=cache,target=/root/.cache/go-build,id=registry-build-$TARGETPLATFORM \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=tmpfs,target=/go/src <<EOT
set -ex
export GOPATH="/go/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH"
# Make the /build directory no matter what so that it doesn't fail on arm64 or
# any other platform where we don't build this registry
mkdir /build
case $TARGETPLATFORM in
linux/amd64|linux/arm/v7|linux/ppc64le|linux/s390x)
git fetch -q --depth 1 origin "${REGISTRY_VERSION_SCHEMA1}" +refs/tags/*:refs/tags/*
git checkout -q FETCH_HEAD
CGO_ENABLED=0 xx-go build -o /build/registry-v2-schema1 -v ./cmd/registry
xx-verify /build/registry-v2-schema1
;;
esac
EOT
FROM distribution/distribution:$REGISTRY_VERSION AS registry-v2
RUN mkdir /build && mv /bin/registry /build/registry-v2
# go-swagger
FROM base AS swagger-src
WORKDIR /usr/src/swagger
# Currently uses a fork from https://github.com/kolyshkin/go-swagger/tree/golang-1.13-fix
# TODO: move to under moby/ or fix upstream go-swagger to work for us.
RUN git init . && git remote add origin "https://github.com/kolyshkin/go-swagger.git"
# GO_SWAGGER_COMMIT specifies the version of the go-swagger binary to build and
# install. Go-swagger is used in CI for validating swagger.yaml in hack/validate/swagger-gen
ARG GO_SWAGGER_COMMIT=c56166c036004ba7a3a321e5951ba472b9ae298c
RUN git fetch -q --depth 1 origin "${GO_SWAGGER_COMMIT}" && git checkout -q FETCH_HEAD
FROM base AS swagger
WORKDIR /go/src/github.com/go-swagger/go-swagger
ARG TARGETPLATFORM
RUN --mount=from=swagger-src,src=/usr/src/swagger,rw \
--mount=type=cache,target=/root/.cache/go-build,id=swagger-build-$TARGETPLATFORM \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=tmpfs,target=/go/src/ <<EOT
set -e
xx-go build -o /build/swagger ./cmd/swagger
xx-verify /build/swagger
EOT
# frozen-images
# See also frozenImages in "testutil/environment/protect.go" (which needs to
# be updated when adding images to this list)
FROM debian:${BASE_DEBIAN_DISTRO} AS frozen-images
RUN --mount=type=cache,sharing=locked,id=moby-frozen-images-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-frozen-images-aptcache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
jq
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /
ARG TARGETARCH
ARG TARGETVARIANT
RUN /download-frozen-image-v2.sh /build \
busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
busybox:glibc@sha256:1f81263701cddf6402afe9f33fca0266d9fff379e59b1748f33d3072da71ee85 \
debian:bookworm-slim@sha256:2bc5c236e9b262645a323e9088dfa3bb1ecb16cc75811daf40a23a824d665be9 \
hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 \
arm32v7/hello-world:latest@sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1
# delve
FROM base AS delve-src
WORKDIR /usr/src/delve
RUN git init . && git remote add origin "https://github.com/go-delve/delve.git"
# DELVE_VERSION specifies the version of the Delve debugger binary
# from the https://github.com/go-delve/delve repository.
# It can be used to run Docker with a possibility of
# attaching debugger to it.
ARG DELVE_VERSION=v1.21.1
RUN git fetch -q --depth 1 origin "${DELVE_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS delve-supported
WORKDIR /usr/src/delve
ARG TARGETPLATFORM
RUN --mount=from=delve-src,src=/usr/src/delve,rw \
--mount=type=cache,target=/root/.cache/go-build,id=delve-build-$TARGETPLATFORM \
--mount=type=cache,target=/go/pkg/mod <<EOT
set -e
GO111MODULE=on xx-go build -o /build/dlv ./cmd/dlv
xx-verify /build/dlv
EOT
FROM binary-dummy AS delve-unsupported
FROM delve-${DELVE_SUPPORTED} AS delve
FROM base AS tomll
# GOTOML_VERSION specifies the version of the tomll binary to build and install
# from the https://github.com/pelletier/go-toml repository. This binary is used
# in CI in the hack/validate/toml script.
# #
# When updating this version, consider updating the github.com/pelletier/go-toml # Usage:
# dependency in vendor.mod accordingly. #
ARG GOTOML_VERSION=v1.8.1 # # Assemble the full dev environment. This is slow the first time.
RUN --mount=type=cache,target=/root/.cache/go-build \ # docker build -t docker .
--mount=type=cache,target=/go/pkg/mod \ #
GOBIN=/build/ GO111MODULE=on go install "github.com/pelletier/go-toml/cmd/tomll@${GOTOML_VERSION}" \ # # Mount your source in an interactive container for quick testing:
&& /build/tomll --help # docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash
#
FROM base AS gowinres # # Run the test suite:
# GOWINRES_VERSION defines go-winres tool version # docker run --privileged docker hack/make.sh test
ARG GOWINRES_VERSION=v0.3.1 #
RUN --mount=type=cache,target=/root/.cache/go-build \ # # Publish a release:
--mount=type=cache,target=/go/pkg/mod \ # docker run --privileged \
GOBIN=/build/ GO111MODULE=on go install "github.com/tc-hib/go-winres@${GOWINRES_VERSION}" \ # -e AWS_S3_BUCKET=baz \
&& /build/go-winres --help # -e AWS_ACCESS_KEY=foo \
# -e AWS_SECRET_KEY=bar \
# containerd # -e GPG_PASSPHRASE=gloubiboulga \
FROM base AS containerd-src # docker hack/release.sh
WORKDIR /usr/src/containerd #
RUN git init . && git remote add origin "https://github.com/containerd/containerd.git" # Note: AppArmor used to mess with privileged mode, but this is no longer
# CONTAINERD_VERSION is used to build containerd binaries, and used for the # the case. Therefore, you don't have to disable it anymore.
# integration tests. The distributed docker .deb and .rpm packages depend on a
# separate (containerd.io) package, which may be a different version as is
# specified here. The containerd golang package is also pinned in vendor.mod.
# When updating the binary version you may also need to update the vendor
# version to pick up bug fixes or new APIs, however, usually the Go packages
# are built from a commit from the master branch.
ARG CONTAINERD_VERSION=v1.7.15
RUN git fetch -q --depth 1 origin "${CONTAINERD_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS containerd-build
WORKDIR /go/src/github.com/containerd/containerd
ARG TARGETPLATFORM
RUN --mount=type=cache,sharing=locked,id=moby-containerd-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-containerd-aptcache,target=/var/cache/apt \
apt-get update && xx-apt-get install -y --no-install-recommends \
gcc \
libbtrfs-dev \
libsecret-1-dev \
pkg-config
ARG DOCKER_STATIC
RUN --mount=from=containerd-src,src=/usr/src/containerd,rw \
--mount=type=cache,target=/root/.cache/go-build,id=containerd-build-$TARGETPLATFORM <<EOT
set -e
export CC=$(xx-info)-gcc
export CGO_ENABLED=$([ "$DOCKER_STATIC" = "1" ] && echo "0" || echo "1")
xx-go --wrap
make $([ "$DOCKER_STATIC" = "1" ] && echo "STATIC=1") binaries
xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") bin/containerd
xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") bin/containerd-shim-runc-v2
xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") bin/ctr
mkdir /build
mv bin/containerd bin/containerd-shim-runc-v2 bin/ctr /build
EOT
FROM containerd-build AS containerd-linux
FROM binary-dummy AS containerd-windows
FROM containerd-${TARGETOS} AS containerd
FROM base AS golangci_lint
ARG GOLANGCI_LINT_VERSION=v1.55.2
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
GOBIN=/build/ GO111MODULE=on go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" \
&& /build/golangci-lint --version
FROM base AS gotestsum
ARG GOTESTSUM_VERSION=v1.8.2
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
GOBIN=/build/ GO111MODULE=on go install "gotest.tools/gotestsum@${GOTESTSUM_VERSION}" \
&& /build/gotestsum --version
FROM base AS shfmt
ARG SHFMT_VERSION=v3.8.0
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
GOBIN=/build/ GO111MODULE=on go install "mvdan.cc/sh/v3/cmd/shfmt@${SHFMT_VERSION}" \
&& /build/shfmt --version
FROM base AS gopls
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
GOBIN=/build/ GO111MODULE=on go install "golang.org/x/tools/gopls@latest" \
&& /build/gopls version
FROM base AS dockercli
WORKDIR /go/src/github.com/docker/cli
ARG DOCKERCLI_REPOSITORY
ARG DOCKERCLI_VERSION
ARG TARGETPLATFORM
RUN --mount=source=hack/dockerfile/cli.sh,target=/download-or-build-cli.sh \
--mount=type=cache,id=dockercli-git-$TARGETPLATFORM,sharing=locked,target=./.git \
--mount=type=cache,target=/root/.cache/go-build,id=dockercli-build-$TARGETPLATFORM \
rm -f ./.git/*.lock \
&& /download-or-build-cli.sh ${DOCKERCLI_VERSION} ${DOCKERCLI_REPOSITORY} /build \
&& /build/docker --version
FROM base AS dockercli-integration
WORKDIR /go/src/github.com/docker/cli
ARG DOCKERCLI_INTEGRATION_REPOSITORY
ARG DOCKERCLI_INTEGRATION_VERSION
ARG TARGETPLATFORM
RUN --mount=source=hack/dockerfile/cli.sh,target=/download-or-build-cli.sh \
--mount=type=cache,id=dockercli-git-$TARGETPLATFORM,sharing=locked,target=./.git \
--mount=type=cache,target=/root/.cache/go-build,id=dockercli-build-$TARGETPLATFORM \
rm -f ./.git/*.lock \
&& /download-or-build-cli.sh ${DOCKERCLI_INTEGRATION_VERSION} ${DOCKERCLI_INTEGRATION_REPOSITORY} /build \
&& /build/docker --version
# runc
FROM base AS runc-src
WORKDIR /usr/src/runc
RUN git init . && git remote add origin "https://github.com/opencontainers/runc.git"
# RUNC_VERSION should match the version that is used by the containerd version
# that is used. If you need to update runc, open a pull request in the containerd
# project first, and update both after that is merged. When updating RUNC_VERSION,
# consider updating runc in vendor.mod accordingly.
ARG RUNC_VERSION=v1.1.12
RUN git fetch -q --depth 1 origin "${RUNC_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS runc-build
WORKDIR /go/src/github.com/opencontainers/runc
ARG TARGETPLATFORM
RUN --mount=type=cache,sharing=locked,id=moby-runc-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-runc-aptcache,target=/var/cache/apt \
apt-get update && xx-apt-get install -y --no-install-recommends \
dpkg-dev \
gcc \
libc6-dev \
libseccomp-dev \
pkg-config
ARG DOCKER_STATIC
RUN --mount=from=runc-src,src=/usr/src/runc,rw \
--mount=type=cache,target=/root/.cache/go-build,id=runc-build-$TARGETPLATFORM <<EOT
set -e
xx-go --wrap
CGO_ENABLED=1 make "$([ "$DOCKER_STATIC" = "1" ] && echo "static" || echo "runc")"
xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") runc
mkdir /build
mv runc /build/
EOT
FROM runc-build AS runc-linux
FROM binary-dummy AS runc-windows
FROM runc-${TARGETOS} AS runc
# tini
FROM base AS tini-src
WORKDIR /usr/src/tini
RUN git init . && git remote add origin "https://github.com/krallin/tini.git"
# TINI_VERSION specifies the version of tini (docker-init) to build. This
# binary is used when starting containers with the `--init` option.
ARG TINI_VERSION=v0.19.0
RUN git fetch -q --depth 1 origin "${TINI_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS tini-build
WORKDIR /go/src/github.com/krallin/tini
RUN --mount=type=cache,sharing=locked,id=moby-tini-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-tini-aptcache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends cmake
ARG TARGETPLATFORM
RUN --mount=type=cache,sharing=locked,id=moby-tini-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-tini-aptcache,target=/var/cache/apt \
xx-apt-get install -y --no-install-recommends \
gcc \
libc6-dev \
pkg-config
RUN --mount=from=tini-src,src=/usr/src/tini,rw \
--mount=type=cache,target=/root/.cache/go-build,id=tini-build-$TARGETPLATFORM <<EOT
set -e
CC=$(xx-info)-gcc cmake .
make tini-static
xx-verify --static tini-static
mkdir /build
mv tini-static /build/docker-init
EOT
FROM tini-build AS tini-linux
FROM binary-dummy AS tini-windows
FROM tini-${TARGETOS} AS tini
# rootlesskit
FROM base AS rootlesskit-src
WORKDIR /usr/src/rootlesskit
RUN git init . && git remote add origin "https://github.com/rootless-containers/rootlesskit.git"
# When updating, also update vendor.mod and hack/dockerfile/install/rootlesskit.installer accordingly.
ARG ROOTLESSKIT_VERSION=v2.0.2
RUN git fetch -q --depth 1 origin "${ROOTLESSKIT_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS rootlesskit-build
WORKDIR /go/src/github.com/rootless-containers/rootlesskit
ARG TARGETPLATFORM
RUN --mount=type=cache,sharing=locked,id=moby-rootlesskit-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-rootlesskit-aptcache,target=/var/cache/apt \
apt-get update && xx-apt-get install -y --no-install-recommends \
gcc \
libc6-dev \
pkg-config
ENV GO111MODULE=on
ARG DOCKER_STATIC
RUN --mount=from=rootlesskit-src,src=/usr/src/rootlesskit,rw \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build,id=rootlesskit-build-$TARGETPLATFORM <<EOT
set -e
export CGO_ENABLED=$([ "$DOCKER_STATIC" = "1" ] && echo "0" || echo "1")
xx-go build -o /build/rootlesskit -ldflags="$([ "$DOCKER_STATIC" != "1" ] && echo "-linkmode=external")" ./cmd/rootlesskit
xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") /build/rootlesskit
xx-go build -o /build/rootlesskit-docker-proxy -ldflags="$([ "$DOCKER_STATIC" != "1" ] && echo "-linkmode=external")" ./cmd/rootlesskit-docker-proxy
xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") /build/rootlesskit-docker-proxy
EOT
COPY --link ./contrib/dockerd-rootless.sh /build/
COPY --link ./contrib/dockerd-rootless-setuptool.sh /build/
FROM rootlesskit-build AS rootlesskit-linux
FROM binary-dummy AS rootlesskit-windows
FROM rootlesskit-${TARGETOS} AS rootlesskit
FROM base AS crun
ARG CRUN_VERSION=1.12
RUN --mount=type=cache,sharing=locked,id=moby-crun-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-crun-aptcache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
libcap-dev \
libprotobuf-c-dev \
libseccomp-dev \
libsystemd-dev \
libtool \
libudev-dev \
libyajl-dev \
python3 \
;
RUN --mount=type=tmpfs,target=/tmp/crun-build \
git clone https://github.com/containers/crun.git /tmp/crun-build && \
cd /tmp/crun-build && \
git checkout -q "${CRUN_VERSION}" && \
./autogen.sh && \
./configure --bindir=/build && \
make -j install
# vpnkit
# use dummy scratch stage to avoid build to fail for unsupported platforms
FROM scratch AS vpnkit-windows
FROM scratch AS vpnkit-linux-386
FROM scratch AS vpnkit-linux-arm
FROM scratch AS vpnkit-linux-ppc64le
FROM scratch AS vpnkit-linux-riscv64
FROM scratch AS vpnkit-linux-s390x
FROM djs55/vpnkit:${VPNKIT_VERSION} AS vpnkit-linux-amd64
FROM djs55/vpnkit:${VPNKIT_VERSION} AS vpnkit-linux-arm64
FROM vpnkit-linux-${TARGETARCH} AS vpnkit-linux
FROM vpnkit-${TARGETOS} AS vpnkit
# containerutility
FROM base AS containerutil-src
WORKDIR /usr/src/containerutil
RUN git init . && git remote add origin "https://github.com/docker-archive/windows-container-utility.git"
ARG CONTAINERUTILITY_VERSION=aa1ba87e99b68e0113bd27ec26c60b88f9d4ccd9
RUN git fetch -q --depth 1 origin "${CONTAINERUTILITY_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS containerutil-build
WORKDIR /usr/src/containerutil
ARG TARGETPLATFORM
RUN xx-apt-get install -y --no-install-recommends \
gcc \
g++ \
libc6-dev \
pkg-config
RUN --mount=from=containerutil-src,src=/usr/src/containerutil,rw \
--mount=type=cache,target=/root/.cache/go-build,id=containerutil-build-$TARGETPLATFORM <<EOT
set -e
CC="$(xx-info)-gcc" CXX="$(xx-info)-g++" make
xx-verify --static containerutility.exe
mkdir /build
mv containerutility.exe /build/
EOT
FROM binary-dummy AS containerutil-linux
FROM containerutil-build AS containerutil-windows-amd64
FROM containerutil-windows-${TARGETARCH} AS containerutil-windows
FROM containerutil-${TARGETOS} AS containerutil
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx
FROM docker/compose-bin:${COMPOSE_VERSION} as compose
FROM base AS dev-systemd-false
COPY --link --from=frozen-images /build/ /docker-frozen-images
COPY --link --from=swagger /build/ /usr/local/bin/
COPY --link --from=delve /build/ /usr/local/bin/
COPY --link --from=tomll /build/ /usr/local/bin/
COPY --link --from=gowinres /build/ /usr/local/bin/
COPY --link --from=tini /build/ /usr/local/bin/
COPY --link --from=registry /build/ /usr/local/bin/
COPY --link --from=registry-v2 /build/ /usr/local/bin/
# Skip the CRIU stage for now, as the opensuse package repository is sometimes
# unstable, and we're currently not using it in CI.
# #
# FIXME(thaJeztah): re-enable this stage when https://github.com/moby/moby/issues/38963 is resolved (see https://github.com/moby/moby/pull/38984)
# COPY --link --from=criu /build/ /usr/local/bin/
COPY --link --from=gotestsum /build/ /usr/local/bin/
COPY --link --from=golangci_lint /build/ /usr/local/bin/
COPY --link --from=shfmt /build/ /usr/local/bin/
COPY --link --from=runc /build/ /usr/local/bin/
COPY --link --from=containerd /build/ /usr/local/bin/
COPY --link --from=rootlesskit /build/ /usr/local/bin/
COPY --link --from=vpnkit / /usr/local/bin/
COPY --link --from=containerutil /build/ /usr/local/bin/
COPY --link --from=crun /build/ /usr/local/bin/
COPY --link hack/dockerfile/etc/docker/ /etc/docker/
COPY --link --from=buildx /buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
COPY --link --from=compose /docker-compose /usr/libexec/docker/cli-plugins/docker-compose
ENV PATH=/usr/local/cli:$PATH FROM debian:jessie
ENV TEST_CLIENT_BINARY=/usr/local/cli-integration/docker
ENV CONTAINERD_ADDRESS=/run/docker/containerd/containerd.sock # add zfs ppa
ENV CONTAINERD_NAMESPACE=moby RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61 \
WORKDIR /go/src/github.com/docker/docker || apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61
RUN echo deb http://ppa.launchpad.net/zfs-native/stable/ubuntu trusty main > /etc/apt/sources.list.d/zfs.list
# allow replacing httpredir mirror
ARG APT_MIRROR=httpredir.debian.org
RUN sed -i s/httpredir.debian.org/$APT_MIRROR/g /etc/apt/sources.list
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \
apt-utils \
aufs-tools \
automake \
bash-completion \
binutils-mingw-w64 \
bsdmainutils \
btrfs-tools \
build-essential \
clang \
createrepo \
curl \
dpkg-sig \
gcc-mingw-w64 \
git \
iptables \
jq \
libapparmor-dev \
libcap-dev \
libltdl-dev \
libsqlite3-dev \
libsystemd-journal-dev \
libtool \
mercurial \
net-tools \
pkg-config \
python-dev \
python-mock \
python-pip \
python-websocket \
ubuntu-zfs \
xfsprogs \
libzfs-dev \
tar \
zip \
--no-install-recommends \
&& pip install awscli==1.10.15
# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
# Compile and install lvm2
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# Configure the container for OSX cross compilation
ENV OSX_SDK MacOSX10.11.sdk
ENV OSX_CROSS_COMMIT 8aa9b71a394905e6c5f4b59e2b97b87a004658a4
RUN set -x \
&& export OSXCROSS_PATH="/osxcross" \
&& git clone https://github.com/tpoechtrager/osxcross.git $OSXCROSS_PATH \
&& ( cd $OSXCROSS_PATH && git checkout -q $OSX_CROSS_COMMIT) \
&& curl -sSL https://s3.dockerproject.org/darwin/v2/${OSX_SDK}.tar.xz -o "${OSXCROSS_PATH}/tarballs/${OSX_SDK}.tar.xz" \
&& UNATTENDED=yes OSX_VERSION_MIN=10.6 ${OSXCROSS_PATH}/build.sh
ENV PATH /osxcross/target/bin:$PATH
# install seccomp: the version shipped in trusty is too old
ENV SECCOMP_VERSION 2.3.1
RUN set -x \
&& export SECCOMP_PATH="$(mktemp -d)" \
&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
&& ( \
cd "$SECCOMP_PATH" \
&& ./configure --prefix=/usr/local \
&& make \
&& make install \
&& ldconfig \
) \
&& rm -rf "$SECCOMP_PATH"
# Install Go
# 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.4
# Compile Go for cross compilation
ENV DOCKER_CROSSPLATFORMS \
linux/386 linux/arm \
darwin/amd64 \
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
ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
# Grab Go's cover tool for dead-simple code coverage testing
# Grab Go's vet tool for examining go code to find suspicious constructs
# and help prevent errors that the compiler might not catch
RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \
&& go install -v golang.org/x/tools/cmd/cover \
&& go install -v golang.org/x/tools/cmd/vet
# Grab Go's lint tool
ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
&& go install -v github.com/golang/lint/golint
# Install two versions of the registry. The first is an older version that
# only supports schema1 manifests. The second is a newer version that supports
# both. This allows integration-cli tests to cover push/pull with both schema1
# and schema2 manifests.
ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
&& rm -rf "$GOPATH"
# Install notary and notary-server
ENV NOTARY_VERSION v0.3.0
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
&& rm -rf "$GOPATH"
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 7befe694bd21e3c54bb1d7825270ea4bd6864c13
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT \
&& pip install -r test-requirements.txt
# Set user.email so crosbymichael's in-container merge commits go smoothly
RUN git config --global user.email 'docker-dummy@example.com'
# Add an unprivileged user to be used for tests which need it
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser
VOLUME /var/lib/docker VOLUME /var/lib/docker
VOLUME /home/unprivilegeduser/.local/share/docker WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
# Let us use a .bashrc file
RUN ln -sfv $PWD/.bashrc ~/.bashrc
# Register Docker's bash completion.
RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
buildpack-deps:jessie@sha256:25785f89240fbcdd8a74bdaf30dd5599a9523882c6dfc567f2e9ef7cf6f79db6 \
busybox:latest@sha256:e4f93f6ed15a0cdd342f5aae387886fba0ab98af0a102da6276eaf24d6e6ade0 \
debian:jessie@sha256:f968f10b4b523737e253a97eac59b0d1420b5c19b69928d35801a6373ffe330e \
hello-world:latest@sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
# see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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 \
&& rm -rf "$GOPATH"
# Download toml validator
ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \
&& (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \
&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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" \
&& cp runc /usr/local/bin/docker-runc \
&& rm -rf "$GOPATH"
# Install containerd
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" \
&& cd "$GOPATH/src/github.com/docker/containerd" \
&& git checkout -q "$CONTAINERD_COMMIT" \
&& make static \
&& cp bin/containerd /usr/local/bin/docker-containerd \
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
&& rm -rf "$GOPATH"
# Wrap all commands in the "docker-in-docker" script to allow nested containers # Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"] ENTRYPOINT ["hack/dind"]
FROM dev-systemd-false AS dev-systemd-true # Upload docker source
RUN --mount=type=cache,sharing=locked,id=moby-dev-aptlib,target=/var/lib/apt \ COPY . /go/src/github.com/docker/docker
--mount=type=cache,sharing=locked,id=moby-dev-aptcache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends \
dbus \
dbus-user-session \
systemd \
systemd-sysv
ENTRYPOINT ["hack/dind-systemd"]
FROM dev-systemd-${SYSTEMD} AS dev-base
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser \
&& mkdir -p /home/unprivilegeduser/.local/share/docker \
&& chown -R unprivilegeduser /home/unprivilegeduser
# Let us use a .bashrc file
RUN ln -sfv /go/src/github.com/docker/docker/.bashrc ~/.bashrc
# Activate bash completion and include Docker's completion if mounted with DOCKER_BASH_COMPLETION_PATH
RUN echo "source /usr/share/bash-completion/bash_completion" >> /etc/bash.bashrc
RUN ln -s /usr/local/completion/bash/docker /etc/bash_completion.d/docker
RUN ldconfig
# Set dev environment as safe git directory to prevent "dubious ownership" errors
# when bind-mounting the source into the dev-container. See https://github.com/moby/moby/pull/44930
RUN git config --global --add safe.directory $GOPATH/src/github.com/docker/docker
# This should only install packages that are specifically needed for the dev environment and nothing else
# Do you really need to add another package here? Can it be done in a different build stage?
RUN --mount=type=cache,sharing=locked,id=moby-dev-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-dev-aptcache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends \
apparmor \
bash-completion \
bzip2 \
inetutils-ping \
iproute2 \
iptables \
jq \
libcap2-bin \
libnet1 \
libnl-3-200 \
libprotobuf-c1 \
libyajl2 \
net-tools \
patch \
pigz \
sudo \
systemd-journal-remote \
thin-provisioning-tools \
uidmap \
vim \
vim-common \
xfsprogs \
xz-utils \
zip \
zstd
# Switch to use iptables instead of nftables (to match the CI hosts)
# TODO use some kind of runtime auto-detection instead if/when nftables is supported (https://github.com/moby/moby/issues/26824)
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy || true \
&& update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy || true \
&& update-alternatives --set arptables /usr/sbin/arptables-legacy || true
RUN --mount=type=cache,sharing=locked,id=moby-dev-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-dev-aptcache,target=/var/cache/apt \
apt-get update && apt-get install --no-install-recommends -y \
gcc \
pkg-config \
dpkg-dev \
libapparmor-dev \
libseccomp-dev \
libsecret-1-dev \
libsystemd-dev \
libudev-dev \
yamllint
COPY --link --from=dockercli /build/ /usr/local/cli
COPY --link --from=dockercli-integration /build/ /usr/local/cli-integration
FROM base AS build
COPY --from=gowinres /build/ /usr/local/bin/
WORKDIR /go/src/github.com/docker/docker
ENV GO111MODULE=off
ENV CGO_ENABLED=1
RUN --mount=type=cache,sharing=locked,id=moby-build-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-build-aptcache,target=/var/cache/apt \
apt-get update && apt-get install --no-install-recommends -y \
clang \
lld \
llvm
ARG TARGETPLATFORM
RUN --mount=type=cache,sharing=locked,id=moby-build-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-build-aptcache,target=/var/cache/apt \
xx-apt-get install --no-install-recommends -y \
dpkg-dev \
gcc \
libapparmor-dev \
libc6-dev \
libseccomp-dev \
libsecret-1-dev \
libsystemd-dev \
libudev-dev \
pkg-config
ARG DOCKER_BUILDTAGS
ARG DOCKER_DEBUG
ARG DOCKER_GITCOMMIT=HEAD
ARG DOCKER_LDFLAGS
ARG DOCKER_STATIC
ARG VERSION
ARG PLATFORM
ARG PRODUCT
ARG DEFAULT_PRODUCT_LICENSE
ARG PACKAGER_NAME
# PREFIX overrides DEST dir in make.sh script otherwise it fails because of
# read only mount in current work dir
ENV PREFIX=/tmp
RUN <<EOT
# in bullseye arm64 target does not link with lld so configure it to use ld instead
if [ "$(xx-info arch)" = "arm64" ]; then
XX_CC_PREFER_LINKER=ld xx-clang --setup-target-triple
fi
EOT
RUN --mount=type=bind,target=.,rw \
--mount=type=tmpfs,target=cli/winresources/dockerd \
--mount=type=tmpfs,target=cli/winresources/docker-proxy \
--mount=type=cache,target=/root/.cache/go-build,id=moby-build-$TARGETPLATFORM <<EOT
set -e
target=$([ "$DOCKER_STATIC" = "1" ] && echo "binary" || echo "dynbinary")
xx-go --wrap
PKG_CONFIG=$(xx-go env PKG_CONFIG) ./hack/make.sh $target
xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") /tmp/bundles/${target}-daemon/dockerd$([ "$(xx-info os)" = "windows" ] && echo ".exe")
xx-verify $([ "$DOCKER_STATIC" = "1" ] && echo "--static") /tmp/bundles/${target}-daemon/docker-proxy$([ "$(xx-info os)" = "windows" ] && echo ".exe")
mkdir /build
mv /tmp/bundles/${target}-daemon/* /build/
EOT
# usage:
# > docker buildx bake binary
# > DOCKER_STATIC=0 docker buildx bake binary
# or
# > make binary
# > make dynbinary
FROM scratch AS binary
COPY --from=build /build/ /
# usage:
# > docker buildx bake all
FROM scratch AS all
COPY --link --from=tini /build/ /
COPY --link --from=runc /build/ /
COPY --link --from=containerd /build/ /
COPY --link --from=rootlesskit /build/ /
COPY --link --from=containerutil /build/ /
COPY --link --from=vpnkit / /
COPY --link --from=build /build /
# smoke tests
# usage:
# > docker buildx bake binary-smoketest
FROM --platform=$TARGETPLATFORM base AS smoketest
WORKDIR /usr/local/bin
COPY --from=build /build .
RUN <<EOT
set -ex
file dockerd
dockerd --version
file docker-proxy
docker-proxy --version
EOT
# devcontainer is a stage used by .devcontainer/devcontainer.json
FROM dev-base AS devcontainer
COPY --link . .
COPY --link --from=gopls /build/ /usr/local/bin/
# usage:
# > make shell
# > SYSTEMD=true make shell
FROM dev-base AS dev
COPY --link . .

211
Dockerfile.aarch64 Normal file
View file

@ -0,0 +1,211 @@
# This file describes the standard way to build Docker on aarch64, using docker
#
# Usage:
#
# # Assemble the full dev environment. This is slow the first time.
# docker build -t docker -f Dockerfile.aarch64 .
#
# # Mount your source in an interactive container for quick testing:
# docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash
#
# # Run the test suite:
# docker run --privileged docker hack/make.sh test
#
# Note: AppArmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
#
FROM aarch64/ubuntu:wily
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \
aufs-tools \
automake \
bash-completion \
btrfs-tools \
build-essential \
createrepo \
curl \
dpkg-sig \
g++ \
gcc \
git \
iptables \
jq \
libapparmor-dev \
libc6-dev \
libcap-dev \
libltdl-dev \
libsqlite3-dev \
libsystemd-dev \
mercurial \
net-tools \
parallel \
pkg-config \
python-dev \
python-mock \
python-pip \
python-websocket \
gccgo \
--no-install-recommends
# Install armhf loader to use armv6 binaries on armv8
RUN dpkg --add-architecture armhf \
&& apt-get update \
&& apt-get install -y libc6:armhf
# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
# fix platform enablement in lvm2 to support aarch64 properly
RUN set -e \
&& for f in config.guess config.sub; do \
curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
done
# "arch.c:78:2: error: #error the arch code needs to know about your machine type"
# Compile and install lvm2
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# install seccomp: the version shipped in trusty is too old
ENV SECCOMP_VERSION 2.3.1
RUN set -x \
&& export SECCOMP_PATH="$(mktemp -d)" \
&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
&& ( \
cd "$SECCOMP_PATH" \
&& ./configure --prefix=/usr/local \
&& make \
&& make install \
&& ldconfig \
) \
&& rm -rf "$SECCOMP_PATH"
# Install Go
# 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.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
ENV PATH /usr/src/go/bin:$PATH
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
# Only install one version of the registry, because old version which support
# schema1 manifests is not working on ARM64, we should skip integration-cli
# tests for schema1 manifests on ARM64.
ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
&& rm -rf "$GOPATH"
# Install notary and notary-server
ENV NOTARY_VERSION v0.3.0
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
&& rm -rf "$GOPATH"
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 7befe694bd21e3c54bb1d7825270ea4bd6864c13
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT \
&& pip install -r test-requirements.txt
# Set user.email so crosbymichael's in-container merge commits go smoothly
RUN git config --global user.email 'docker-dummy@example.com'
# Add an unprivileged user to be used for tests which need it
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser
VOLUME /var/lib/docker
WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
# Let us use a .bashrc file
RUN ln -sfv $PWD/.bashrc ~/.bashrc
# Register Docker's bash completion.
RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
aarch64/buildpack-deps:jessie@sha256:6aa1d6910791b7ac78265fd0798e5abd6cb3f27ae992f6f960f6c303ec9535f2 \
aarch64/busybox:latest@sha256:b23a6a37cf269dff6e46d2473b6e227afa42b037e6d23435f1d2bc40fc8c2828 \
aarch64/debian:jessie@sha256:4be74a41a7c70ebe887b634b11ffe516cf4fcd56864a54941e56bb49883c3170 \
aarch64/hello-world:latest@sha256:65a4a158587b307bb02db4de41b836addb0c35175bdc801367b1ac1ddeb9afda
# see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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 \
&& rm -rf "$GOPATH"
# Download toml validator
ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \
&& (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \
&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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" \
&& cp runc /usr/local/bin/docker-runc \
&& rm -rf "$GOPATH"
# Install containerd
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" \
&& cd "$GOPATH/src/github.com/docker/containerd" \
&& git checkout -q "$CONTAINERD_COMMIT" \
&& make static \
&& cp bin/containerd /usr/local/bin/docker-containerd \
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
&& rm -rf "$GOPATH"
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]
# Upload docker source
COPY . /go/src/github.com/docker/docker

219
Dockerfile.armhf Normal file
View file

@ -0,0 +1,219 @@
# This file describes the standard way to build Docker on ARMv7, using docker
#
# Usage:
#
# # Assemble the full dev environment. This is slow the first time.
# docker build -t docker -f Dockerfile.armhf .
#
# # Mount your source in an interactive container for quick testing:
# docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash
#
# # Run the test suite:
# docker run --privileged docker hack/make.sh test
#
# Note: AppArmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
#
FROM armhf/debian:jessie
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \
aufs-tools \
automake \
bash-completion \
btrfs-tools \
build-essential \
createrepo \
curl \
dpkg-sig \
git \
iptables \
jq \
net-tools \
libapparmor-dev \
libcap-dev \
libltdl-dev \
libsqlite3-dev \
libsystemd-journal-dev \
libtool \
mercurial \
pkg-config \
python-dev \
python-mock \
python-pip \
python-websocket \
xfsprogs \
tar \
--no-install-recommends \
&& pip install awscli==1.10.15
# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
# Compile and install lvm2
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# Install Go
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
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
# we're building for armhf, which is ARMv7, so let's be explicit about that
ENV GOARCH arm
ENV GOARM 7
# 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
ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
# Grab Go's cover tool for dead-simple code coverage testing
# Grab Go's vet tool for examining go code to find suspicious constructs
# and help prevent errors that the compiler might not catch
RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \
&& go install -v golang.org/x/tools/cmd/cover \
&& go install -v golang.org/x/tools/cmd/vet
# Grab Go's lint tool
ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
&& go install -v github.com/golang/lint/golint
# install seccomp: the version shipped in trusty is too old
ENV SECCOMP_VERSION 2.3.1
RUN set -x \
&& export SECCOMP_PATH="$(mktemp -d)" \
&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
&& ( \
cd "$SECCOMP_PATH" \
&& ./configure --prefix=/usr/local \
&& make \
&& make install \
&& ldconfig \
) \
&& rm -rf "$SECCOMP_PATH"
# Install two versions of the registry. The first is an older version that
# only supports schema1 manifests. The second is a newer version that supports
# both. This allows integration-cli tests to cover push/pull with both schema1
# and schema2 manifests.
ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
ENV REGISTRY_COMMIT cb08de17d74bef86ce6c5abe8b240e282f5750be
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
&& rm -rf "$GOPATH"
# Install notary and notary-server
ENV NOTARY_VERSION v0.3.0
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
&& rm -rf "$GOPATH"
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 7befe694bd21e3c54bb1d7825270ea4bd6864c13
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT \
&& pip install -r test-requirements.txt
# Set user.email so crosbymichael's in-container merge commits go smoothly
RUN git config --global user.email 'docker-dummy@example.com'
# Add an unprivileged user to be used for tests which need it
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser
VOLUME /var/lib/docker
WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
# Let us use a .bashrc file
RUN ln -sfv $PWD/.bashrc ~/.bashrc
# Register Docker's bash completion.
RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
armhf/buildpack-deps:jessie@sha256:ca6cce8e5bf5c952129889b5cc15cd6aa8d995d77e55e3749bbaadae50e476cb \
armhf/busybox:latest@sha256:d98a7343ac750ffe387e3d514f8521ba69846c216778919b01414b8617cfb3d4 \
armhf/debian:jessie@sha256:4a2187483f04a84f9830910fe3581d69b3c985cc045d9f01d8e2f3795b28107b \
armhf/hello-world:latest@sha256:161dcecea0225975b2ad5f768058212c1e0d39e8211098666ffa1ac74cfb7791
# see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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 \
&& rm -rf "$GOPATH"
# Download toml validator
ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \
&& (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \
&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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" \
&& cp runc /usr/local/bin/docker-runc \
&& rm -rf "$GOPATH"
# Install containerd
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" \
&& cd "$GOPATH/src/github.com/docker/containerd" \
&& git checkout -q "$CONTAINERD_COMMIT" \
&& make static \
&& cp bin/containerd /usr/local/bin/docker-containerd \
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
&& rm -rf "$GOPATH"
ENTRYPOINT ["hack/dind"]
# Upload docker source
COPY . /go/src/github.com/docker/docker

104
Dockerfile.gccgo Normal file
View file

@ -0,0 +1,104 @@
# This file describes the standard way to build Docker, using docker
#
# Usage:
#
# # Assemble the full dev environment. This is slow the first time.
# docker build -t docker -f Dockerfile.gccgo .
#
FROM gcc:6.1
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \
aufs-tools \
btrfs-tools \
build-essential \
curl \
git \
iptables \
jq \
net-tools \
libapparmor-dev \
libcap-dev \
libsqlite3-dev \
mercurial \
net-tools \
parallel \
python-dev \
python-mock \
python-pip \
python-websocket \
--no-install-recommends
# Get lvm2 source for compiling statically
RUN git clone -b v2_02_103 https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
# Compile and install lvm2
RUN cd /usr/local/lvm2 \
&& ./configure --enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# install seccomp: the version shipped in jessie is too old
ENV SECCOMP_VERSION v2.3.1
RUN set -x \
&& export SECCOMP_PATH=$(mktemp -d) \
&& git clone https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
&& ( \
cd "$SECCOMP_PATH" \
&& git checkout "$SECCOMP_VERSION" \
&& ./autogen.sh \
&& ./configure --prefix=/usr \
&& make \
&& make install \
) \
&& rm -rf "$SECCOMP_PATH"
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 7befe694bd21e3c54bb1d7825270ea4bd6864c13
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT
# Add an unprivileged user to be used for tests which need it
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser
VOLUME /var/lib/docker
WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
# Install runc
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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" \
&& cp runc /usr/local/bin/docker-runc \
&& rm -rf "$GOPATH"
# Install containerd
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" \
&& cd "$GOPATH/src/github.com/docker/containerd" \
&& git checkout -q "$CONTAINERD_COMMIT" \
&& make static \
&& cp bin/containerd /usr/local/bin/docker-containerd \
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
&& rm -rf "$GOPATH"
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]
# Upload docker source
COPY . /go/src/github.com/docker/docker

225
Dockerfile.ppc64le Normal file
View file

@ -0,0 +1,225 @@
# This file describes the standard way to build Docker on ppc64le, using docker
#
# Usage:
#
# # Assemble the full dev environment. This is slow the first time.
# docker build -t docker -f Dockerfile.ppc64le .
#
# # Mount your source in an interactive container for quick testing:
# docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash
#
# # Run the test suite:
# docker run --privileged docker hack/make.sh test
#
# Note: AppArmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
#
FROM ppc64le/debian:jessie
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \
aufs-tools \
automake \
bash-completion \
btrfs-tools \
build-essential \
createrepo \
curl \
dpkg-sig \
git \
iptables \
jq \
net-tools \
libapparmor-dev \
libcap-dev \
libltdl-dev \
libsqlite3-dev \
libsystemd-journal-dev \
libtool \
mercurial \
pkg-config \
python-dev \
python-mock \
python-pip \
python-websocket \
xfsprogs \
tar \
--no-install-recommends
# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
# fix platform enablement in lvm2 to support ppc64le properly
RUN set -e \
&& for f in config.guess config.sub; do \
curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
done
# "arch.c:78:2: error: #error the arch code needs to know about your machine type"
# Compile and install lvm2
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# install seccomp: the version shipped in jessie is too old
ENV SECCOMP_VERSION 2.3.1
RUN set -x \
&& export SECCOMP_PATH="$(mktemp -d)" \
&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
&& ( \
cd "$SECCOMP_PATH" \
&& ./configure --prefix=/usr/local \
&& make \
&& make install \
&& ldconfig \
) \
&& rm -rf "$SECCOMP_PATH"
# 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
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
ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
# Grab Go's cover tool for dead-simple code coverage testing
# Grab Go's vet tool for examining go code to find suspicious constructs
# and help prevent errors that the compiler might not catch
RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \
&& go install -v golang.org/x/tools/cmd/cover \
&& go install -v golang.org/x/tools/cmd/vet
# Grab Go's lint tool
ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
&& go install -v github.com/golang/lint/golint
# Install two versions of the registry. The first is an older version that
# only supports schema1 manifests. The second is a newer version that supports
# both. This allows integration-cli tests to cover push/pull with both schema1
# and schema2 manifests.
ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
&& rm -rf "$GOPATH"
# Install notary and notary-server
ENV NOTARY_VERSION v0.3.0
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
&& GOPATH="$GOPATH/src/github.com/docker/notary/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
&& GOPATH="$GOPATH/src/github.com/docker/notary/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
&& rm -rf "$GOPATH"
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 7befe694bd21e3c54bb1d7825270ea4bd6864c13
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT \
&& pip install -r test-requirements.txt
# Set user.email so crosbymichael's in-container merge commits go smoothly
RUN git config --global user.email 'docker-dummy@example.com'
# Add an unprivileged user to be used for tests which need it
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser
VOLUME /var/lib/docker
WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
# Let us use a .bashrc file
RUN ln -sfv $PWD/.bashrc ~/.bashrc
# Register Docker's bash completion.
RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
ppc64le/buildpack-deps:jessie@sha256:902bfe4ef1389f94d143d64516dd50a2de75bca2e66d4a44b1d73f63ddf05dda \
ppc64le/busybox:latest@sha256:38bb82085248d5a3c24bd7a5dc146f2f2c191e189da0441f1c2ca560e3fc6f1b \
ppc64le/debian:jessie@sha256:412845f51b6ab662afba71bc7a716e20fdb9b84f185d180d4c7504f8a75c4f91 \
ppc64le/hello-world:latest@sha256:186a40a9a02ca26df0b6c8acdfb8ac2f3ae6678996a838f977e57fac9d963974
# see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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 \
&& rm -rf "$GOPATH"
# Download toml validator
ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \
&& (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \
&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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" \
&& cp runc /usr/local/bin/docker-runc \
&& rm -rf "$GOPATH"
# Install containerd
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" \
&& cd "$GOPATH/src/github.com/docker/containerd" \
&& git checkout -q "$CONTAINERD_COMMIT" \
&& make static \
&& cp bin/containerd /usr/local/bin/docker-containerd \
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
&& rm -rf "$GOPATH"
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]
# Upload docker source
COPY . /go/src/github.com/docker/docker

227
Dockerfile.s390x Normal file
View file

@ -0,0 +1,227 @@
# This file describes the standard way to build Docker on s390x, using docker
#
# Usage:
#
# # Assemble the full dev environment. This is slow the first time.
# docker build -t docker -f Dockerfile.s390x .
#
# # Mount your source in an interactive container for quick testing:
# docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash
#
# # Run the test suite:
# docker run --privileged docker hack/make.sh test
#
# Note: AppArmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
#
FROM s390x/gcc:6.1
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \
aufs-tools \
automake \
bash-completion \
btrfs-tools \
build-essential \
createrepo \
curl \
dpkg-sig \
git \
iptables \
jq \
net-tools \
libapparmor-dev \
libcap-dev \
libltdl-dev \
libsqlite3-dev \
libsystemd-journal-dev \
libtool \
mercurial \
pkg-config \
python-dev \
python-mock \
python-pip \
python-websocket \
xfsprogs \
tar \
--no-install-recommends
# install seccomp: the version shipped in jessie is too old
ENV SECCOMP_VERSION 2.3.1
RUN set -x \
&& export SECCOMP_PATH="$(mktemp -d)" \
&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
&& ( \
cd "$SECCOMP_PATH" \
&& ./configure --prefix=/usr/local \
&& make \
&& make install \
&& ldconfig \
) \
&& rm -rf "$SECCOMP_PATH"
# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
# fix platform enablement in lvm2 to support s390x properly
RUN set -e \
&& for f in config.guess config.sub; do \
curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
done
# "arch.c:78:2: error: #error the arch code needs to know about your machine type"
# Compile and install lvm2
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# Note: Go comes from the base image (gccgo, specifically)
# We can't compile Go proper because s390x isn't an officially supported architecture yet.
ENV PATH /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
# TODO update this sha when we upgrade to Go 1.5+
ENV GO_TOOLS_COMMIT 069d2f3bcb68257b627205f0486d6cc69a231ff9
# Grab Go's cover tool for dead-simple code coverage testing
# Grab Go's vet tool for examining go code to find suspicious constructs
# and help prevent errors that the compiler might not catch
RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \
&& go install -v golang.org/x/tools/cmd/cover \
&& go install -v golang.org/x/tools/cmd/vet
# Grab Go's lint tool
ENV GO_LINT_COMMIT f42f5c1c440621302702cb0741e9d2ca547ae80f
RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
&& go install -v github.com/golang/lint/golint
# Install two versions of the registry. The first is an older version that
# only supports schema1 manifests. The second is a newer version that supports
# both. This allows integration-cli tests to cover push/pull with both schema1
# and schema2 manifests.
ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
&& rm -rf "$GOPATH"
# Install notary and notary-server
#
# Note: We have to explicitly set GO15VENDOREXPERIMENT=0 because gccgo does not
# support vendoring: https://github.com/golang/go/issues/15628
ENV NOTARY_VERSION v0.3.0
RUN set -x \
&& export GO15VENDOREXPERIMENT=0 \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION" && ln -s . vendor/src) \
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
&& rm -rf "$GOPATH"
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 7befe694bd21e3c54bb1d7825270ea4bd6864c13
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT \
&& pip install -r test-requirements.txt
# Set user.email so crosbymichael's in-container merge commits go smoothly
RUN git config --global user.email 'docker-dummy@example.com'
# Add an unprivileged user to be used for tests which need it
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser
VOLUME /var/lib/docker
WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor selinux seccomp
# Let us use a .bashrc file
RUN ln -sfv $PWD/.bashrc ~/.bashrc
# Register Docker's bash completion.
RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
s390x/buildpack-deps:jessie@sha256:4d1381224acaca6c4bfe3604de3af6972083a8558a99672cb6989c7541780099 \
s390x/busybox:latest@sha256:dd61522c983884a66ed72d60301925889028c6d2d5e0220a8fe1d9b4c6a4f01b \
s390x/debian:jessie@sha256:b74c863400909eff3c5e196cac9bfd1f6333ce47aae6a38398d87d5875da170a \
s390x/hello-world:latest@sha256:780d80b3a7677c3788c0d5cd9168281320c8d4a6d9183892d8ee5cdd610f5699
# see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
# Download man page generator
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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 \
&& rm -rf "$GOPATH"
# Download toml validator
ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \
&& (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \
&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \
&& rm -rf "$GOPATH"
# Install runc
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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" \
&& cp runc /usr/local/bin/docker-runc \
&& rm -rf "$GOPATH"
# Install containerd
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" \
&& cd "$GOPATH/src/github.com/docker/containerd" \
&& git checkout -q "$CONTAINERD_COMMIT" \
&& make static \
&& cp bin/containerd /usr/local/bin/docker-containerd \
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
&& rm -rf "$GOPATH"
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]
# Upload docker source
COPY . /go/src/github.com/docker/docker

View file

@ -1,48 +1,84 @@
# docker build -t docker:simple -f Dockerfile.simple . # docker build -t docker:simple -f Dockerfile.simple .
# docker run --rm docker:simple hack/make.sh dynbinary # docker run --rm docker:simple hack/make.sh dynbinary
# docker run --rm --privileged docker:simple hack/dind hack/make.sh test-unit # docker run --rm --privileged docker:simple hack/dind hack/make.sh test-unit
# docker run --rm --privileged -v /var/lib/docker docker:simple hack/dind hack/make.sh dynbinary test-integration # docker run --rm --privileged -v /var/lib/docker docker:simple hack/dind hack/make.sh dynbinary test-integration-cli
# This represents the bare minimum required to build and test Docker. # This represents the bare minimum required to build and test Docker.
ARG GO_VERSION=1.21.9 FROM debian:jessie
ARG BASE_DEBIAN_DISTRO="bookworm" # compile and runtime deps
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
FROM ${GOLANG_IMAGE}
ENV GO111MODULE=off
ENV GOTOOLCHAIN=local
# Compile and runtime deps
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
btrfs-tools \
build-essential \ build-essential \
curl \ curl \
cmake \ gcc \
git \ git \
libapparmor-dev \ libapparmor-dev \
libseccomp-dev \ libdevmapper-dev \
libsqlite3-dev \
\
ca-certificates \ ca-certificates \
e2fsprogs \ e2fsprogs \
iptables \ iptables \
pkg-config \
pigz \
procps \ procps \
xfsprogs \ xfsprogs \
xz-utils \ xz-utils \
\ \
vim-common \ aufs-tools \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install runc, containerd, tini and docker-proxy # install seccomp: the version shipped in trusty is too old
# Please edit hack/dockerfile/install/<name>.installer to update them. ENV SECCOMP_VERSION 2.3.1
COPY hack/dockerfile/install hack/dockerfile/install RUN set -x \
RUN for i in runc containerd tini proxy dockercli; \ && export SECCOMP_PATH="$(mktemp -d)" \
do hack/dockerfile/install/install.sh $i; \ && curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
done | tar -xzC "$SECCOMP_PATH" --strip-components=1 \
ENV PATH=/usr/local/cli:$PATH && ( \
cd "$SECCOMP_PATH" \
&& ./configure --prefix=/usr/local \
&& make \
&& make install \
&& ldconfig \
) \
&& rm -rf "$SECCOMP_PATH"
# Install Go
# 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.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
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
ENV CGO_LDFLAGS -L/lib
# Install runc
ENV RUNC_COMMIT 50a19c6ff828c58e5dab13830bd3dacde268afe5
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& 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" \
&& cp runc /usr/local/bin/docker-runc \
&& rm -rf "$GOPATH"
# Install containerd
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" \
&& cd "$GOPATH/src/github.com/docker/containerd" \
&& git checkout -q "$CONTAINERD_COMMIT" \
&& make static \
&& cp bin/containerd /usr/local/bin/docker-containerd \
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
&& rm -rf "$GOPATH"
ENV AUTO_GOPATH 1 ENV AUTO_GOPATH 1
WORKDIR /usr/src/docker WORKDIR /usr/src/docker

View file

@ -1,314 +1,89 @@
# escape=` # This file describes the standard way to build Docker, using a docker container on Windows
# Server 2016
# -----------------------------------------------------------------------------------------
# This file describes the standard way to build Docker in a container on Windows
# Server 2016 or Windows 10.
# #
# Maintainer: @jhowardmsft
# -----------------------------------------------------------------------------------------
# Prerequisites:
# --------------
#
# 1. Windows Server 2016 or Windows 10 with all Windows updates applied. The major
# build number must be at least 14393. This can be confirmed, for example, by
# running the following from an elevated PowerShell prompt - this sample output
# is from a fully up to date machine as at mid-November 2016:
#
# >> PS C:\> $(gin).WindowsBuildLabEx
# >> 14393.447.amd64fre.rs1_release_inmarket.161102-0100
#
# 2. Git for Windows (or another git client) must be installed. https://git-scm.com/download/win.
#
# 3. The machine must be configured to run containers. For example, by following
# the quick start guidance at https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start or
# https://github.com/docker/labs/blob/master/windows/windows-containers/Setup.md
#
# 4. If building in a Hyper-V VM: For Windows Server 2016 using Windows Server
# containers as the default option, it is recommended you have at least 1GB
# of memory assigned; For Windows 10 where Hyper-V Containers are employed, you
# should have at least 4GB of memory assigned. Note also, to run Hyper-V
# containers in a VM, it is necessary to configure the VM for nested virtualization.
# -----------------------------------------------------------------------------------------
# Usage: # Usage:
# -----
# #
# The following steps should be run from an (elevated*) Windows PowerShell prompt. # # Assemble the full dev environment. This is slow the first time. Run this from
# # a directory containing the sources you are validating. For example from
# # c:\go\src\github.com\docker\docker
# #
# (*In a default installation of containers on Windows following the quick-start guidance at # docker build -t docker -f Dockerfile.windows .
# https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start,
# the docker.exe client must run elevated to be able to connect to the daemon).
#
# 1. Clone the sources from github.com:
#
# >> git clone https://github.com/docker/docker.git C:\gopath\src\github.com\docker\docker
# >> Cloning into 'C:\gopath\src\github.com\docker\docker'...
# >> remote: Counting objects: 186216, done.
# >> remote: Compressing objects: 100% (21/21), done.
# >> remote: Total 186216 (delta 5), reused 0 (delta 0), pack-reused 186195
# >> Receiving objects: 100% (186216/186216), 104.32 MiB | 8.18 MiB/s, done.
# >> Resolving deltas: 100% (123139/123139), done.
# >> Checking connectivity... done.
# >> Checking out files: 100% (3912/3912), done.
# >> PS C:\>
# #
# #
# 2. Change directory to the cloned docker sources: # # Build docker in a container. Run the following from a Windows cmd command prommpt,
# # replacing c:\built with the directory you want the binaries to be placed on the
# # host system.
# #
# >> cd C:\gopath\src\github.com\docker\docker # docker run --rm -v "c:\built:c:\target" docker sh -c 'cd /c/go/src/github.com/docker/docker; hack/make.sh binary; ec=$?; if [ $ec -eq 0 ]; then robocopy /c/go/src/github.com/docker/docker/bundles/$(cat VERSION)/binary /c/target/binary; fi; exit $ec'
# #
#
# 3. Build a docker image with the components required to build the docker binaries from source
# by running one of the following:
#
# >> docker build -t nativebuildimage -f Dockerfile.windows .
# >> docker build -t nativebuildimage -f Dockerfile.windows -m 2GB . (if using Hyper-V containers)
#
#
# 4. Build the docker executable binaries by running one of the following:
#
# >> $DOCKER_GITCOMMIT=(git rev-parse --short HEAD)
# >> docker run --name binaries -e DOCKER_GITCOMMIT=$DOCKER_GITCOMMIT nativebuildimage hack\make.ps1 -Binary
# >> docker run --name binaries -e DOCKER_GITCOMMIT=$DOCKER_GITCOMMIT -m 2GB nativebuildimage hack\make.ps1 -Binary (if using Hyper-V containers)
#
#
# 5. Copy the binaries out of the container, replacing HostPath with an appropriate destination
# folder on the host system where you want the binaries to be located.
#
# >> docker cp binaries:C:\gopath\src\github.com\docker\docker\bundles\docker.exe C:\HostPath\docker.exe
# >> docker cp binaries:C:\gopath\src\github.com\docker\docker\bundles\dockerd.exe C:\HostPath\dockerd.exe
#
#
# 6. (Optional) Remove the interim container holding the built executable binaries:
#
# >> docker rm binaries
#
#
# 7. (Optional) Remove the image used for the container in which the executable
# binaries are build. Tip - it may be useful to keep this image around if you need to
# build multiple times. Then you can take advantage of the builder cache to have an
# image which has all the components required to build the binaries already installed.
#
# >> docker rmi nativebuildimage
#
# -----------------------------------------------------------------------------------------
# The validation tests can only run directly on the host. This is because they calculate
# information from the git repo, but the .git directory is not passed into the image as
# it is excluded via .dockerignore. Run the following from a Windows PowerShell prompt
# (elevation is not required): (Note Go must be installed to run these tests)
#
# >> hack\make.ps1 -DCO -PkgImports -GoFormat
# -----------------------------------------------------------------------------------------
# To run unit tests, ensure you have created the nativebuildimage above. Then run one of
# the following from an (elevated) Windows PowerShell prompt:
#
# >> docker run --rm nativebuildimage hack\make.ps1 -TestUnit
# >> docker run --rm -m 2GB nativebuildimage hack\make.ps1 -TestUnit (if using Hyper-V containers)
# -----------------------------------------------------------------------------------------
# To run unit tests and binary build, ensure you have created the nativebuildimage above. Then
# run one of the following from an (elevated) Windows PowerShell prompt:
#
# >> docker run nativebuildimage hack\make.ps1 -All
# >> docker run -m 2GB nativebuildimage hack\make.ps1 -All (if using Hyper-V containers)
# -----------------------------------------------------------------------------------------
# Important notes: # Important notes:
# --------------- # ---------------
# #
# Don't attempt to use a bind mount to pass a local directory as the bundles target # The posix utilities from GIT aren't usable interactively as at January 2016. This
# directory. It does not work (golang attempts for follow a mapped folder incorrectly). # is because they require a console window which isn't present in a container in Windows.
# Instead, use docker cp as per the example. # See the example at the top of this file. Do NOT use -it in that docker run!!!
# #
# go.zip is not removed from the image as it is used by the Windows CI servers # Don't try to use a volume for passing the source through. The posix utilities will
# to ensure the host and image are running consistent versions of go. # balk at reparse points. Again, see the example at the top of this file on how use a volume
# to get the built binary out of the container.
# #
# Nanoserver support is a work in progress. Although the image will build if the # The steps are minimised dramatically to improve performance
# FROM statement is updated, it will not work when running autogen through hack\make.ps1.
# It is suspected that the required GCC utilities (eg gcc, windres, windmc) silently
# quit due to the use of console hooks which are not available.
#
# The docker integration tests do not currently run in a container on Windows, predominantly
# due to Windows not supporting privileged mode, so anything using a volume would fail.
# They (along with the rest of the docker CI suite) can be run using
# https://github.com/kevpar/docker-w2wCIScripts/blob/master/runCI/Invoke-DockerCI.ps1.
#
# -----------------------------------------------------------------------------------------
FROM windowsservercore
# The number of build steps below are explicitly minimised to improve performance.
ARG WINDOWS_BASE_IMAGE=mcr.microsoft.com/windows/servercore
ARG WINDOWS_BASE_IMAGE_TAG=ltsc2022
FROM ${WINDOWS_BASE_IMAGE}:${WINDOWS_BASE_IMAGE_TAG}
# Use PowerShell as the default shell
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG GO_VERSION=1.21.9
ARG GOTESTSUM_VERSION=v1.8.2
ARG GOWINRES_VERSION=v0.3.1
ARG CONTAINERD_VERSION=v1.7.15
# Environment variable notes: # Environment variable notes:
# - GO_VERSION must be consistent with 'Dockerfile' used by Linux. # - GO_VERSION must consistent with 'Dockerfile' used by Linux'.
# - CONTAINERD_VERSION must be consistent with 'hack/dockerfile/install/containerd.installer' used by Linux.
# - FROM_DOCKERFILE is used for detection of building within a container. # - FROM_DOCKERFILE is used for detection of building within a container.
ENV GO_VERSION=${GO_VERSION} ` ENV GO_VERSION=1.6.4 \
CONTAINERD_VERSION=${CONTAINERD_VERSION} ` GIT_LOCATION=https://github.com/git-for-windows/git/releases/download/v2.7.2.windows.1/Git-2.7.2-64-bit.exe \
GIT_VERSION=2.11.1 ` GOPATH=C:/go;C:/go/src/github.com/docker/docker/vendor \
GOPATH=C:\gopath ` FROM_DOCKERFILE=1
GO111MODULE=off `
GOTOOLCHAIN=local `
FROM_DOCKERFILE=1 `
GOTESTSUM_VERSION=${GOTESTSUM_VERSION} `
GOWINRES_VERSION=${GOWINRES_VERSION}
RUN ` WORKDIR c:/
Function Test-Nano() { `
$EditionId = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'EditionID').EditionId; `
return (($EditionId -eq 'ServerStandardNano') -or ($EditionId -eq 'ServerDataCenterNano') -or ($EditionId -eq 'NanoServer')); `
}`
`
Function Download-File([string] $source, [string] $target) { `
if (Test-Nano) { `
$handler = New-Object System.Net.Http.HttpClientHandler; `
$client = New-Object System.Net.Http.HttpClient($handler); `
$client.Timeout = New-Object System.TimeSpan(0, 30, 0); `
$cancelTokenSource = [System.Threading.CancellationTokenSource]::new(); `
$responseMsg = $client.GetAsync([System.Uri]::new($source), $cancelTokenSource.Token); `
$responseMsg.Wait(); `
if (!$responseMsg.IsCanceled) { `
$response = $responseMsg.Result; `
if ($response.IsSuccessStatusCode) { `
$downloadedFileStream = [System.IO.FileStream]::new($target, [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write); `
$copyStreamOp = $response.Content.CopyToAsync($downloadedFileStream); `
$copyStreamOp.Wait(); `
$downloadedFileStream.Close(); `
if ($copyStreamOp.Exception -ne $null) { throw $copyStreamOp.Exception } `
} `
} else { `
Throw ("Failed to download " + $source) `
}`
} else { `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
$webClient = New-Object System.Net.WebClient; `
$webClient.DownloadFile($source, $target); `
} `
} `
`
setx /M PATH $('C:\git\cmd;C:\git\usr\bin;'+$Env:PATH+';C:\gcc\bin;C:\go\bin;C:\containerd\bin'); `
`
Write-Host INFO: Downloading git...; `
$location='https://www.nuget.org/api/v2/package/GitForWindows/'+$Env:GIT_VERSION; `
Download-File $location C:\gitsetup.zip; `
`
Write-Host INFO: Downloading go...; `
$dlGoVersion=$Env:GO_VERSION; `
Download-File "https://go.dev/dl/go${dlGoVersion}.windows-amd64.zip" C:\go.zip; `
`
Write-Host INFO: Downloading compiler 1 of 3...; `
Download-File https://raw.githubusercontent.com/moby/docker-tdmgcc/master/gcc.zip C:\gcc.zip; `
`
Write-Host INFO: Downloading compiler 2 of 3...; `
Download-File https://raw.githubusercontent.com/moby/docker-tdmgcc/master/runtime.zip C:\runtime.zip; `
`
Write-Host INFO: Downloading compiler 3 of 3...; `
Download-File https://raw.githubusercontent.com/moby/docker-tdmgcc/master/binutils.zip C:\binutils.zip; `
`
Write-Host INFO: Extracting git...; `
Expand-Archive C:\gitsetup.zip C:\git-tmp; `
New-Item -Type Directory C:\git | Out-Null; `
Move-Item C:\git-tmp\tools\* C:\git\.; `
Remove-Item -Recurse -Force C:\git-tmp; `
`
Write-Host INFO: Expanding go...; `
Expand-Archive C:\go.zip -DestinationPath C:\; `
`
Write-Host INFO: Expanding compiler 1 of 3...; `
Expand-Archive C:\gcc.zip -DestinationPath C:\gcc -Force; `
Write-Host INFO: Expanding compiler 2 of 3...; `
Expand-Archive C:\runtime.zip -DestinationPath C:\gcc -Force; `
Write-Host INFO: Expanding compiler 3 of 3...; `
Expand-Archive C:\binutils.zip -DestinationPath C:\gcc -Force; `
`
Write-Host INFO: Removing downloaded files...; `
Remove-Item C:\gcc.zip; `
Remove-Item C:\runtime.zip; `
Remove-Item C:\binutils.zip; `
Remove-Item C:\gitsetup.zip; `
`
Write-Host INFO: Downloading containerd; `
Install-Package -Force 7Zip4PowerShell; `
$location='https://github.com/containerd/containerd/releases/download/'+$Env:CONTAINERD_VERSION+'/containerd-'+$Env:CONTAINERD_VERSION.TrimStart('v')+'-windows-amd64.tar.gz'; `
Download-File $location C:\containerd.tar.gz; `
New-Item -Path C:\containerd -ItemType Directory; `
Expand-7Zip C:\containerd.tar.gz C:\; `
Expand-7Zip C:\containerd.tar C:\containerd; `
Remove-Item C:\containerd.tar.gz; `
Remove-Item C:\containerd.tar; `
`
# Ensure all directories exist that we will require below....
$srcDir = """$Env:GOPATH`\src\github.com\docker\docker\bundles"""; `
Write-Host INFO: Ensuring existence of directory $srcDir...; `
New-Item -Force -ItemType Directory -Path $srcDir | Out-Null; `
`
Write-Host INFO: Configuring git core.autocrlf...; `
C:\git\cmd\git config --global core.autocrlf true;
RUN ` # Everything downloaded/installed in one go (better performance, esp on TP4)
Function Install-GoTestSum() { ` RUN \
$Env:GO111MODULE = 'on'; ` setx /M Path "c:\git\cmd;c:\git\bin;c:\git\usr\bin;%Path%;c:\gcc\bin;c:\go\bin" && \
$tmpGobin = "${Env:GOBIN_TMP}"; ` setx GOROOT "c:\go" && \
$Env:GOBIN = """${Env:GOPATH}`\bin"""; ` powershell -command \
Write-Host "INFO: Installing gotestsum version $Env:GOTESTSUM_VERSION in $Env:GOBIN"; ` $ErrorActionPreference = 'Stop'; \
&go install "gotest.tools/gotestsum@${Env:GOTESTSUM_VERSION}"; ` Function Download-File([string] $source, [string] $target) { \
$Env:GOBIN = "${tmpGobin}"; ` $wc = New-Object net.webclient; $wc.Downloadfile($source, $target) \
$Env:GO111MODULE = 'off'; ` } \
if ($LASTEXITCODE -ne 0) { ` \
Throw '"gotestsum install failed..."'; ` Write-Host INFO: Downloading git...; \
} ` Download-File %GIT_LOCATION% gitsetup.exe; \
} ` \
` Write-Host INFO: Downloading go...; \
Install-GoTestSum Download-File https://storage.googleapis.com/golang/go%GO_VERSION%.windows-amd64.msi go.msi; \
\
Write-Host INFO: Downloading compiler 1 of 3...; \
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/gcc.zip gcc.zip; \
\
Write-Host INFO: Downloading compiler 2 of 3...; \
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/runtime.zip runtime.zip; \
\
Write-Host INFO: Downloading compiler 3 of 3...; \
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/binutils.zip binutils.zip; \
\
Write-Host INFO: Installing git...; \
Start-Process gitsetup.exe -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS /DIR=c:\git\' -Wait; \
\
Write-Host INFO: Installing go..."; \
Start-Process msiexec -ArgumentList '-i go.msi -quiet' -Wait; \
\
Write-Host INFO: Unzipping compiler...; \
c:\git\usr\bin\unzip.exe -q -o gcc.zip -d /c/gcc; \
c:\git\usr\bin\unzip.exe -q -o runtime.zip -d /c/gcc; \
c:\git\usr\bin\unzip.exe -q -o binutils.zip -d /c/gcc"; \
\
Write-Host INFO: Removing interim files; \
Remove-Item *.zip; \
Remove-Item go.msi; \
Remove-Item gitsetup.exe; \
\
Write-Host INFO: Completed
RUN ` # Prepare for building
Function Install-GoWinres() { ` COPY . /go/src/github.com/docker/docker
$Env:GO111MODULE = 'on'; `
$tmpGobin = "${Env:GOBIN_TMP}"; `
$Env:GOBIN = """${Env:GOPATH}`\bin"""; `
Write-Host "INFO: Installing go-winres version $Env:GOWINRES_VERSION in $Env:GOBIN"; `
&go install "github.com/tc-hib/go-winres@${Env:GOWINRES_VERSION}"; `
$Env:GOBIN = "${tmpGobin}"; `
$Env:GO111MODULE = 'off'; `
if ($LASTEXITCODE -ne 0) { `
Throw '"go-winres install failed..."'; `
} `
} `
`
Install-GoWinres
# Make PowerShell the default entrypoint
ENTRYPOINT ["powershell.exe"]
# Set the working directory to the location of the sources
WORKDIR ${GOPATH}\src\github.com\docker\docker
# Copy the sources into the container
COPY . .

165
Jenkinsfile vendored
View file

@ -1,165 +0,0 @@
#!groovy
pipeline {
agent none
options {
buildDiscarder(logRotator(daysToKeepStr: '30'))
timeout(time: 2, unit: 'HOURS')
timestamps()
}
parameters {
booleanParam(name: 'arm64', defaultValue: true, description: 'ARM (arm64) Build/Test')
booleanParam(name: 'dco', defaultValue: true, description: 'Run the DCO check')
}
environment {
DOCKER_BUILDKIT = '1'
DOCKER_EXPERIMENTAL = '1'
DOCKER_GRAPHDRIVER = 'overlay2'
CHECK_CONFIG_COMMIT = '33a3680e08d1007e72c3b3f1454f823d8e9948ee'
TESTDEBUG = '0'
TIMEOUT = '120m'
}
stages {
stage('pr-hack') {
when { changeRequest() }
steps {
script {
echo "Workaround for PR auto-cancel feature. Borrowed from https://issues.jenkins-ci.org/browse/JENKINS-43353"
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
}
}
}
stage('DCO-check') {
when {
beforeAgent true
expression { params.dco }
}
agent { label 'arm64 && ubuntu-2004' }
steps {
sh '''
docker run --rm \
-v "$WORKSPACE:/workspace" \
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
alpine sh -c 'apk add --no-cache -q bash git openssh-client && git config --system --add safe.directory /workspace && cd /workspace && hack/validate/dco'
'''
}
}
stage('Build') {
parallel {
stage('arm64') {
when {
beforeAgent true
expression { params.arm64 }
}
agent { label 'arm64 && ubuntu-2004' }
environment {
TEST_SKIP_INTEGRATION_CLI = '1'
}
stages {
stage("Print info") {
steps {
sh 'docker version'
sh 'docker info'
sh '''
echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
&& bash ${WORKSPACE}/check-config.sh || true
'''
}
}
stage("Build dev image") {
steps {
sh 'docker build --force-rm -t docker:${GIT_COMMIT} .'
}
}
stage("Unit tests") {
steps {
sh '''
sudo modprobe ip6table_filter
'''
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
--name docker-pr$BUILD_NUMBER \
-e DOCKER_EXPERIMENTAL \
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
docker:${GIT_COMMIT} \
hack/test/unit
'''
}
post {
always {
junit testResults: 'bundles/junit-report*.xml', allowEmptyResults: true
}
}
}
stage("Integration tests") {
environment { TEST_SKIP_INTEGRATION_CLI = '1' }
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
--name docker-pr$BUILD_NUMBER \
-e DOCKER_EXPERIMENTAL \
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \
-e TESTDEBUG \
-e TEST_INTEGRATION_USE_SNAPSHOTTER \
-e TEST_SKIP_INTEGRATION_CLI \
-e TIMEOUT \
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
docker:${GIT_COMMIT} \
hack/make.sh \
dynbinary \
test-integration
'''
}
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
}
}
}
post {
always {
sh '''
echo "Ensuring container killed."
docker rm -vf docker-pr$BUILD_NUMBER || true
'''
sh '''
echo "Chowning /workspace to jenkins user"
docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
'''
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh '''
bundleName=arm64-integration
echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
'''
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
}
}
cleanup {
sh 'make clean'
deleteDir()
}
}
}
}
}
}
}

View file

@ -176,7 +176,7 @@
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
Copyright 2013-2018 Docker, Inc. Copyright 2013-2016 Docker, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View file

@ -1,14 +1,12 @@
# Moby maintainers file # Docker maintainers file
# #
# This file describes the maintainer groups within the moby/moby project. # This file describes who runs the docker/docker project and how.
# More detail on Moby project governance is available in the # This is a living document - if you see something out of date or missing, speak up!
# project/GOVERNANCE.md file found in this repository.
# #
# It is structured to be consumable by both humans and programs. # It is structured to be consumable by both humans and programs.
# To extract its contents programmatically, use any TOML-compliant # To extract its contents programmatically, use any TOML-compliant
# parser. # parser.
# #
# TODO(estesp): This file should not necessarily depend on docker/opensource
# This file is compiled into the MAINTAINERS file in docker/opensource. # This file is compiled into the MAINTAINERS file in docker/opensource.
# #
[Org] [Org]
@ -23,34 +21,41 @@
# a subsystem, they are responsible for doing so and holding the # a subsystem, they are responsible for doing so and holding the
# subsystem maintainers accountable. If ownership is unclear, they are the de facto owners. # subsystem maintainers accountable. If ownership is unclear, they are the de facto owners.
# For each release (including minor releases), a "release captain" is assigned from the
# pool of core maintainers. Rotation is encouraged across all maintainers, to ensure
# the release process is clear and up-to-date.
people = [ people = [
"akerouanton", "aaronlehmann",
"akihirosuda", "calavera",
"anusha",
"coolljt0725", "coolljt0725",
"corhere",
"cpuguy83", "cpuguy83",
"crazy-max", "crosbymichael",
"duglin",
"estesp", "estesp",
"johnstep", "icecrime",
"jhowardmsft",
"justincormack", "justincormack",
"kolyshkin", "lk4d4",
"laurazard", "mavenugo",
"mhbauer", "mhbauer",
"neersighted",
"rumpl",
"runcom", "runcom",
"samuelkarp",
"stevvooe",
"thajeztah",
"tianon", "tianon",
"tibor", "tibor",
"tonistiigi", "tonistiigi",
"unclejack", "unclejack",
"vdemeester", "vdemeester"
"vieux", ]
"vvoland",
"yongtang" [Org."Docs maintainers"]
# TODO Describe the docs maintainers role.
people = [
"jamtur01",
"moxiegirl",
"sven",
"thajeztah"
] ]
[Org.Curators] [Org.Curators]
@ -66,18 +71,7 @@
# - close an issue or pull request when it's inappropriate or off-topic # - close an issue or pull request when it's inappropriate or off-topic
people = [ people = [
"alexellis",
"andrewhsu",
"bsousaa",
"dmcgowan",
"fntlnz",
"gianarb",
"olljanat",
"programmerq", "programmerq",
"ripcurld",
"robmry",
"sam-thibault",
"samwhited",
"thajeztah" "thajeztah"
] ]
@ -88,55 +82,6 @@
# Thank you! # Thank you!
people = [ people = [
# Aaron Lehmann was a maintainer for swarmkit, the registry, and the engine,
# and contributed many improvements, features, and bugfixes in those areas,
# among which "automated service rollbacks", templated secrets and configs,
# and resumable image layer downloads.
"aaronlehmann",
# Harald Albers is the mastermind behind the bash completion scripts for the
# Docker CLI. The completion scripts moved to the Docker CLI repository, so
# you can now find him perform his magic in the https://github.com/docker/cli repository.
"albers",
# Andrea Luzzardi started contributing to the Docker codebase in the "dotCloud"
# era, even before it was called "Docker". He is one of the architects of both
# Swarm and SwarmKit, and its integration into the Docker engine.
"aluzzardi",
# David Calavera contributed many features to Docker, such as an improved
# event system, dynamic configuration reloading, volume plugins, fancy
# new templating options, and an external client credential store. As a
# maintainer, David was release captain for Docker 1.8, and competing
# with Jess Frazelle to be "top dream killer".
# David is now doing amazing stuff as CTO for https://www.netlify.com,
# and tweets as @calavera.
"calavera",
# Michael Crosby was "chief maintainer" of the Docker project.
# During his time as a maintainer, Michael contributed to many
# milestones of the project; he was release captain of Docker v1.0.0,
# started the development of "libcontainer" (what later became runc)
# and containerd, as well as demoing cool hacks such as live migrating
# a game server container with checkpoint/restore.
#
# Michael is currently a maintainer of containerd, but you may see
# him around in other projects on GitHub.
"crosbymichael",
# Before becoming a maintainer, Daniel Nephin was a core contributor
# to "Fig" (now known as Docker Compose). As a maintainer for both the
# Engine and Docker CLI, Daniel contributed many features, among which
# the `docker stack` commands, allowing users to deploy their Docker
# Compose projects as a Swarm service.
"dnephin",
# Doug Davis contributed many features and fixes for the classic builder,
# such as "wildcard" copy, the dockerignore file, custom paths/names
# for the Dockerfile, as well as enhancements to the API and documentation.
# Follow Doug on Twitter, where he tweets as @duginabox.
"duglin",
# As a maintainer, Erik was responsible for the "builder", and # As a maintainer, Erik was responsible for the "builder", and
# started the first designs for the new networking model in # started the first designs for the new networking model in
# Docker. Erik is now working on all kinds of plugins for Docker # Docker. Erik is now working on all kinds of plugins for Docker
@ -145,113 +90,25 @@
# still stumble into him in our issue tracker, or on IRC. # still stumble into him in our issue tracker, or on IRC.
"erikh", "erikh",
# Evan Hazlett is the creator of the Shipyard and Interlock open source projects,
# and the author of "Orca", which became the foundation of Docker Universal Control
# Plane (UCP). As a maintainer, Evan helped integrating SwarmKit (secrets, tasks)
# into the Docker engine.
"ehazlett",
# Arnaud Porterie (AKA "icecrime") was in charge of maintaining the maintainers.
# As a maintainer, he made life easier for contributors to the Docker open-source
# projects, bringing order in the chaos by designing a triage- and review workflow
# using labels (see https://icecrime.net/technology/a-structured-approach-to-labeling/),
# and automating the hell out of things with his buddies GordonTheTurtle and Poule
# (a chicken!).
#
# A lesser-known fact is that he created the first commit in the libnetwork repository
# even though he didn't know anything about it. Some say, he's now selling stuff on
# the internet ;-)
"icecrime",
# After a false start with his first PR being rejected, James Turnbull became a frequent
# contributor to the documentation, and became a docs maintainer on December 5, 2013. As
# a maintainer, James lifted the docs to a higher standard, and introduced the community
# guidelines ("three strikes"). James is currently changing the world as CTO of https://www.empatico.org,
# meanwhile authoring various books that are worth checking out. You can find him on Twitter,
# rambling as @kartar, and although no longer active as a maintainer, he's always "game" to
# help out reviewing docs PRs, so you may still see him around in the repository.
"jamtur01",
# Jessica Frazelle, also known as the "Keyser Söze of containers", # Jessica Frazelle, also known as the "Keyser Söze of containers",
# runs *everything* in containers. She started contributing to # runs *everything* in containers. She started contributing to
# Docker with a (fun fun) change involving both iptables and regular # Docker with a (fun fun) change involving both iptables and regular
# expressions (coz, YOLO!) on July 10, 2014 # expressions (coz, YOLO!) on July 10, 2014
# https://github.com/docker/docker/pull/6950/commits/f3a68ffa390fb851115c77783fa4031f1d3b2995. # https://github.com/docker/docker/pull/6950/commits/f3a68ffa390fb851115c77783fa4031f1d3b2995.
# Jess was Release Captain for Docker 1.4, 1.6 and 1.7, and contributed # Jess was Release Captain for Docker 1.4, 1.6 and 1.7, and contributed
# many features and improvement, among which "seccomp profiles" (making # many features and improvement, among which "seccomp profiles" (making
# containers a lot more secure). Besides being a maintainer, she # containers a lot more secure). Besides being a maintainer, she
# set up the CI infrastructure for the project, giving everyone # set up the CI infrastructure for the project, giving everyone
# something to shout at if a PR failed ("noooo Janky!"). # something to shout at if a PR failed ("noooo Janky!").
# Jess is currently working on the DCOS security team at Mesosphere,
# and contributing to various open source projects.
# Be sure you don't miss her talks at a conference near you (a must-see), # Be sure you don't miss her talks at a conference near you (a must-see),
# read her blog at https://blog.jessfraz.com (a must-read), and # read her blog at https://blog.jessfraz.com (a must-read), and
# check out her open source projects on GitHub https://github.com/jessfraz (a must-try). # check out her open source projects on GitHub https://github.com/jfrazelle (a must-try).
"jessfraz", "jfrazelle",
# As a maintainer, John Howard managed to make the impossible possible;
# to run Docker on Windows. After facing many challenges, teaching
# fellow-maintainers that 'Windows is not Linux', and many changes in
# Windows Server to facilitate containers, native Windows containers
# saw the light of day in 2015.
#
# John is now enjoying life without containers: playing piano, painting,
# and walking his dogs, but you may occasionally see him drop by on GitHub.
"lowenna",
# Alexander Morozov contributed many features to Docker, worked on the premise of
# what later became containerd (and worked on that too), and made a "stupid" Go
# vendor tool specifically for docker/docker needs: vndr (https://github.com/LK4D4/vndr).
# Not many know that Alexander is a master negotiator, being able to change course
# of action with a single "Nope, we're not gonna do that".
"lk4d4",
# Madhu Venugopal was part of the SocketPlane team that joined Docker.
# As a maintainer, he was working with Jana for the Container Network
# Model (CNM) implemented through libnetwork, and the "routing mesh" powering
# Swarm mode networking.
"mavenugo",
# As a maintainer, Kenfe-Mickaël Laventure worked on the container runtime,
# integrating containerd 1.0 with the daemon, and adding support for custom
# OCI runtimes, as well as implementing the `docker prune` subcommands,
# which was a welcome feature to be added. You can keep up with Mickaél on
# Twitter (@kmlaventure).
"mlaventure",
# As a docs maintainer, Mary Anthony contributed greatly to the Docker
# docs. She wrote the Docker Contributor Guide and Getting Started
# Guides. She helped create a doc build system independent of
# docker/docker project, and implemented a new docs.docker.com theme and
# nav for 2015 Dockercon. Fun fact: the most inherited layer in DockerHub
# public repositories was originally referenced in
# maryatdocker/docker-whale back in May 2015.
"moxiegirl",
# Jana Radhakrishnan was part of the SocketPlane team that joined Docker.
# As a maintainer, he was the lead architect for the Container Network
# Model (CNM) implemented through libnetwork, and the "routing mesh" powering
# Swarm mode networking.
#
# Jana started new adventures in networking, but you can find him tweeting as @mrjana,
# coding on GitHub https://github.com/mrjana, and he may be hiding on the Docker Community
# slack channel :-)
"mrjana",
# Sven Dowideit became a well known person in the Docker ecosphere, building
# boot2docker, and became a regular contributor to the project, starting as
# early as October 2013 (https://github.com/docker/docker/pull/2119), to become
# a maintainer less than two months later (https://github.com/docker/docker/pull/3061).
#
# As a maintainer, Sven took on the task to convert the documentation from
# ReStructuredText to Markdown, migrate to Hugo for generating the docs, and
# writing tooling for building, testing, and publishing them.
#
# If you're not in the occasion to visit "the Australian office", you
# can keep up with Sven on Twitter (@SvenDowideit), his blog http://fosiki.com,
# and of course on GitHub.
"sven",
# Vincent "vbatts!" Batts made his first contribution to the project # Vincent "vbatts!" Batts made his first contribution to the project
# in November 2013, to become a maintainer a few months later, on # in November 2013, to become a maintainer a few months later, on
# May 10, 2014 (https://github.com/docker/docker/commit/d6e666a87a01a5634c250358a94c814bf26cb778). # May 10, 2014 (https://github.com/docker/docker/commit/d6e666a87a01a5634c250358a94c814bf26cb778).
# As a maintainer, Vincent made important contributions to core elements # As a maintainer, Vincent made important contributions to core elements
# of Docker, such as "distribution" (tarsum) and graphdrivers (btrfs, devicemapper). # of Docker, such as "distribution" (tarsum) and graphdrivers (btrfs, devicemapper).
@ -264,6 +121,15 @@
# for a chat, as he's always a lot of fun. # for a chat, as he's always a lot of fun.
"vbatts", "vbatts",
# Victor is one of the earliest contributors to Docker, having worked on the
# project when it was still "dotCloud" in April 2013. He's been responsible
# for multiple releases (https://github.com/docker/docker/pulls?q=is%3Apr+bump+in%3Atitle+author%3Avieux),
# and up until today (2015), our number 2 contributor. Although he's no longer
# a maintainer for the Docker "Engine", he's still actively involved in other
# Docker projects, and most likely can be found in the Docker Swarm repository,
# for which he's a core maintainer.
"vieux",
# Vishnu became a maintainer to help out on the daemon codebase and # Vishnu became a maintainer to help out on the daemon codebase and
# libcontainer integration. He's currently involved in the # libcontainer integration. He's currently involved in the
# Open Containers Initiative, working on the specifications, # Open Containers Initiative, working on the specifications,
@ -284,46 +150,6 @@
Email = "aaron.lehmann@docker.com" Email = "aaron.lehmann@docker.com"
GitHub = "aaronlehmann" GitHub = "aaronlehmann"
[people.akerouanton]
Name = "Albin Kerouanton"
Email = "albinker@gmail.com"
GitHub = "akerouanton"
[people.alexellis]
Name = "Alex Ellis"
Email = "alexellis2@gmail.com"
GitHub = "alexellis"
[people.akihirosuda]
Name = "Akihiro Suda"
Email = "akihiro.suda.cz@hco.ntt.co.jp"
GitHub = "AkihiroSuda"
[people.aluzzardi]
Name = "Andrea Luzzardi"
Email = "al@docker.com"
GitHub = "aluzzardi"
[people.albers]
Name = "Harald Albers"
Email = "github@albersweb.de"
GitHub = "albers"
[people.andrewhsu]
Name = "Andrew Hsu"
Email = "andrewhsu@docker.com"
GitHub = "andrewhsu"
[people.anusha]
Name = "Anusha Ragunathan"
Email = "anusha@docker.com"
GitHub = "anusha-ragunathan"
[people.bsousaa]
Name = "Bruno de Sousa"
Email = "bruno.sousa@docker.com"
GitHub = "bsousaa"
[people.calavera] [people.calavera]
Name = "David Calavera" Name = "David Calavera"
Email = "david.calavera@gmail.com" Email = "david.calavera@gmail.com"
@ -334,46 +160,21 @@
Email = "leijitang@huawei.com" Email = "leijitang@huawei.com"
GitHub = "coolljt0725" GitHub = "coolljt0725"
[people.corhere]
Name = "Cory Snider"
Email = "csnider@mirantis.com"
GitHub = "corhere"
[people.cpuguy83] [people.cpuguy83]
Name = "Brian Goff" Name = "Brian Goff"
Email = "cpuguy83@gmail.com" Email = "cpuguy83@gmail.com"
GitHub = "cpuguy83" Github = "cpuguy83"
[people.crazy-max]
Name = "Kevin Alvarez"
Email = "contact@crazymax.dev"
GitHub = "crazy-max"
[people.crosbymichael] [people.crosbymichael]
Name = "Michael Crosby" Name = "Michael Crosby"
Email = "crosbymichael@gmail.com" Email = "crosbymichael@gmail.com"
GitHub = "crosbymichael" GitHub = "crosbymichael"
[people.dnephin]
Name = "Daniel Nephin"
Email = "dnephin@gmail.com"
GitHub = "dnephin"
[people.dmcgowan]
Name = "Derek McGowan"
Email = "derek@mcgstyle.net"
GitHub = "dmcgowan"
[people.duglin] [people.duglin]
Name = "Doug Davis" Name = "Doug Davis"
Email = "dug@us.ibm.com" Email = "dug@us.ibm.com"
GitHub = "duglin" GitHub = "duglin"
[people.ehazlett]
Name = "Evan Hazlett"
Email = "ejhazlett@gmail.com"
GitHub = "ehazlett"
[people.erikh] [people.erikh]
Name = "Erik Hollensbe" Name = "Erik Hollensbe"
Email = "erik@docker.com" Email = "erik@docker.com"
@ -384,19 +185,9 @@
Email = "estesp@linux.vnet.ibm.com" Email = "estesp@linux.vnet.ibm.com"
GitHub = "estesp" GitHub = "estesp"
[people.fntlnz]
Name = "Lorenzo Fontana"
Email = "fontanalorenz@gmail.com"
GitHub = "fntlnz"
[people.gianarb]
Name = "Gianluca Arbezzano"
Email = "ga@thumpflow.com"
GitHub = "gianarb"
[people.icecrime] [people.icecrime]
Name = "Arnaud Porterie" Name = "Arnaud Porterie"
Email = "icecrime@gmail.com" Email = "arnaud@docker.com"
GitHub = "icecrime" GitHub = "icecrime"
[people.jamtur01] [people.jamtur01]
@ -404,41 +195,26 @@
Email = "james@lovedthanlost.net" Email = "james@lovedthanlost.net"
GitHub = "jamtur01" GitHub = "jamtur01"
[people.jessfraz] [people.jhowardmsft]
Name = "John Howard"
Email = "jhoward@microsoft.com"
GitHub = "jhowardmsft"
[people.jfrazelle]
Name = "Jessie Frazelle" Name = "Jessie Frazelle"
Email = "jess@linux.com" Email = "jess@linux.com"
GitHub = "jessfraz" GitHub = "jfrazelle"
[people.johnstep]
Name = "John Stephens"
Email = "johnstep@docker.com"
GitHub = "johnstep"
[people.justincormack] [people.justincormack]
Name = "Justin Cormack" Name = "Justin Cormack"
Email = "justin.cormack@docker.com" Email = "justin.cormack@docker.com"
GitHub = "justincormack" GitHub = "justincormack"
[people.kolyshkin]
Name = "Kir Kolyshkin"
Email = "kolyshkin@gmail.com"
GitHub = "kolyshkin"
[people.laurazard]
Name = "Laura Brehm"
Email = "laura.brehm@docker.com"
GitHub = "laurazard"
[people.lk4d4] [people.lk4d4]
Name = "Alexander Morozov" Name = "Alexander Morozov"
Email = "lk4d4@docker.com" Email = "lk4d4@docker.com"
GitHub = "lk4d4" GitHub = "lk4d4"
[people.lowenna]
Name = "John Howard"
Email = "github@lowenna.com"
GitHub = "lowenna"
[people.mavenugo] [people.mavenugo]
Name = "Madhu Venugopal" Name = "Madhu Venugopal"
Email = "madhu@docker.com" Email = "madhu@docker.com"
@ -449,81 +225,26 @@
Email = "mbauer@us.ibm.com" Email = "mbauer@us.ibm.com"
GitHub = "mhbauer" GitHub = "mhbauer"
[people.mlaventure]
Name = "Kenfe-Mickaël Laventure"
Email = "mickael.laventure@gmail.com"
GitHub = "mlaventure"
[people.moxiegirl] [people.moxiegirl]
Name = "Mary Anthony" Name = "Mary Anthony"
Email = "mary.anthony@docker.com" Email = "mary.anthony@docker.com"
GitHub = "moxiegirl" GitHub = "moxiegirl"
[people.mrjana]
Name = "Jana Radhakrishnan"
Email = "mrjana@docker.com"
GitHub = "mrjana"
[people.neersighted]
Name = "Bjorn Neergaard"
Email = "bjorn@neersighted.com"
GitHub = "neersighted"
[people.olljanat]
Name = "Olli Janatuinen"
Email = "olli.janatuinen@gmail.com"
GitHub = "olljanat"
[people.programmerq] [people.programmerq]
Name = "Jeff Anderson" Name = "Jeff Anderson"
Email = "jeff@docker.com" Email = "jeff@docker.com"
GitHub = "programmerq" GitHub = "programmerq"
[people.robmry]
Name = "Rob Murray"
Email = "rob.murray@docker.com"
GitHub = "robmry"
[people.ripcurld]
Name = "Boaz Shuster"
Email = "ripcurld.github@gmail.com"
GitHub = "ripcurld"
[people.rumpl]
Name = "Djordje Lukic"
Email = "djordje.lukic@docker.com"
GitHub = "rumpl"
[people.runcom] [people.runcom]
Name = "Antonio Murdaca" Name = "Antonio Murdaca"
Email = "runcom@redhat.com" Email = "runcom@redhat.com"
GitHub = "runcom" GitHub = "runcom"
[people.sam-thibault]
Name = "Sam Thibault"
Email = "sam.thibault@docker.com"
GitHub = "sam-thibault"
[people.samuelkarp]
Name = "Samuel Karp"
Email = "me@samuelkarp.com"
GitHub = "samuelkarp"
[people.samwhited]
Name = "Sam Whited"
Email = "sam@samwhited.com"
GitHub = "samwhited"
[people.shykes] [people.shykes]
Name = "Solomon Hykes" Name = "Solomon Hykes"
Email = "solomon@docker.com" Email = "solomon@docker.com"
GitHub = "shykes" GitHub = "shykes"
[people.stevvooe]
Name = "Stephen Day"
Email = "stephen.day@docker.com"
GitHub = "stevvooe"
[people.sven] [people.sven]
Name = "Sven Dowideit" Name = "Sven Dowideit"
Email = "SvenDowideit@home.org.au" Email = "SvenDowideit@home.org.au"
@ -573,13 +294,3 @@
Name = "Vishnu Kannan" Name = "Vishnu Kannan"
Email = "vishnuk@google.com" Email = "vishnuk@google.com"
GitHub = "vishh" GitHub = "vishh"
[people.vvoland]
Name = "Paweł Gronowski"
Email = "pawel.gronowski@docker.com"
GitHub = "vvoland"
[people.yongtang]
Name = "Yong Tang"
Email = "yong.tang.github@outlook.com"
GitHub = "yongtang"

250
Makefile
View file

@ -1,128 +1,50 @@
.PHONY: all binary dynbinary build cross help install manpages run shell test test-docker-py test-integration test-unit validate validate-% win .PHONY: all binary build build-gccgo cross default docs docs-build docs-shell shell gccgo test test-docker-py test-integration-cli test-unit validate help
DOCKER ?= docker
BUILDX ?= $(DOCKER) buildx
# set the graph driver as the current graphdriver if not set # set the graph driver as the current graphdriver if not set
DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info -f '{{ .Driver }}' 2>&1)) DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //'))
export DOCKER_GRAPHDRIVER
DOCKER_GITCOMMIT := $(shell git rev-parse HEAD) # get OS/Arch of docker engine
export DOCKER_GITCOMMIT DOCKER_OSARCH := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKER_ENGINE_OSARCH:-$$DOCKER_CLIENT_OSARCH}')
DOCKERFILE := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKERFILE}')
# allow overriding the repository and branch that validation scripts are running
# against these are used in hack/validate/.validate to check what changed in the PR.
export VALIDATE_REPO
export VALIDATE_BRANCH
export VALIDATE_ORIGIN_BRANCH
export PAGER
export GIT_PAGER
# env vars passed through directly to Docker's build scripts # env vars passed through directly to Docker's build scripts
# to allow things like `make KEEPBUNDLE=1 binary` easily # to allow things like `make KEEPBUNDLE=1 binary` easily
# `project/PACKAGERS.md` have some limited documentation of some of these # `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these
#
# DOCKER_LDFLAGS can be used to pass additional parameters to -ldflags
# option of "go build". For example, a built-in graphdriver priority list
# can be changed during build time like this:
#
# make DOCKER_LDFLAGS="-X github.com/docker/docker/daemon/graphdriver.priority=overlay2,zfs" dynbinary
#
DOCKER_ENVS := \ DOCKER_ENVS := \
-e BUILDFLAGS \ -e BUILDFLAGS \
-e KEEPBUNDLE \ -e KEEPBUNDLE \
-e DOCKER_BUILD_ARGS \
-e DOCKER_BUILD_GOGC \ -e DOCKER_BUILD_GOGC \
-e DOCKER_BUILD_OPTS \
-e DOCKER_BUILD_PKGS \ -e DOCKER_BUILD_PKGS \
-e DOCKER_BUILDKIT \
-e DOCKER_BASH_COMPLETION_PATH \
-e DOCKER_CLI_PATH \
-e DOCKERCLI_VERSION \
-e DOCKERCLI_REPOSITORY \
-e DOCKERCLI_INTEGRATION_VERSION \
-e DOCKERCLI_INTEGRATION_REPOSITORY \
-e DOCKER_DEBUG \ -e DOCKER_DEBUG \
-e DOCKER_EXPERIMENTAL \ -e DOCKER_EXPERIMENTAL \
-e DOCKER_GITCOMMIT \ -e DOCKER_GITCOMMIT \
-e DOCKER_GRAPHDRIVER \ -e DOCKER_GRAPHDRIVER=$(DOCKER_GRAPHDRIVER) \
-e DOCKER_LDFLAGS \ -e DOCKER_INCREMENTAL_BINARY \
-e DOCKER_PORT \
-e DOCKER_REMAP_ROOT \ -e DOCKER_REMAP_ROOT \
-e DOCKER_ROOTLESS \
-e DOCKER_STORAGE_OPTS \ -e DOCKER_STORAGE_OPTS \
-e DOCKER_TEST_HOST \
-e DOCKER_USERLANDPROXY \ -e DOCKER_USERLANDPROXY \
-e DOCKERD_ARGS \
-e DELVE_PORT \
-e GITHUB_ACTIONS \
-e TEST_FORCE_VALIDATE \
-e TEST_INTEGRATION_DIR \
-e TEST_INTEGRATION_USE_SNAPSHOTTER \
-e TEST_INTEGRATION_FAIL_FAST \
-e TEST_SKIP_INTEGRATION \
-e TEST_SKIP_INTEGRATION_CLI \
-e TEST_IGNORE_CGROUP_CHECK \
-e TESTCOVERAGE \
-e TESTDEBUG \
-e TESTDIRS \ -e TESTDIRS \
-e TESTFLAGS \ -e TESTFLAGS \
-e TESTFLAGS_INTEGRATION \ -e TIMEOUT
-e TESTFLAGS_INTEGRATION_CLI \
-e TEST_FILTER \
-e TIMEOUT \
-e VALIDATE_REPO \
-e VALIDATE_BRANCH \
-e VALIDATE_ORIGIN_BRANCH \
-e VERSION \
-e PLATFORM \
-e DEFAULT_PRODUCT_LICENSE \
-e PRODUCT \
-e PACKAGER_NAME \
-e PAGER \
-e GIT_PAGER \
-e OTEL_EXPORTER_OTLP_ENDPOINT \
-e OTEL_EXPORTER_OTLP_PROTOCOL \
-e OTEL_SERVICE_NAME
# note: we _cannot_ add "-e DOCKER_BUILDTAGS" here because even if it's unset in the shell, that would shadow the "ENV DOCKER_BUILDTAGS" set in our Dockerfile, which is very important for our official builds # note: we _cannot_ add "-e DOCKER_BUILDTAGS" here because even if it's unset in the shell, that would shadow the "ENV DOCKER_BUILDTAGS" set in our Dockerfile, which is very important for our official builds
# to allow `make BIND_DIR=. shell` or `make BIND_DIR= test` # to allow `make BIND_DIR=. shell` or `make BIND_DIR= test`
# (default to no bind mount if DOCKER_HOST is set) # (default to no bind mount if DOCKER_HOST is set)
# note: BINDDIR is supported for backwards-compatibility here # note: BINDDIR is supported for backwards-compatibility here
BIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,bundles)) BIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,bundles))
# DOCKER_MOUNT can be overriden, but use at your own risk!
ifndef DOCKER_MOUNT
DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/docker/$(BIND_DIR)") DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/docker/$(BIND_DIR)")
DOCKER_MOUNT := $(if $(DOCKER_BINDDIR_MOUNT_OPTS),$(DOCKER_MOUNT):$(DOCKER_BINDDIR_MOUNT_OPTS),$(DOCKER_MOUNT))
# This allows the test suite to be able to run without worrying about the underlying fs used by the container running the daemon (e.g. aufs-on-aufs), so long as the host running the container is running a supported fs. # This allows the test suite to be able to run without worrying about the underlying fs used by the container running the daemon (e.g. aufs-on-aufs), so long as the host running the container is running a supported fs.
# The volume will be cleaned up when the container is removed due to `--rm`. # The volume will be cleaned up when the container is removed due to `--rm`.
# Note that `BIND_DIR` will already be set to `bundles` if `DOCKER_HOST` is not set (see above BIND_DIR line), in such case this will do nothing since `DOCKER_MOUNT` will already be set. # Note that `BIND_DIR` will already be set to `bundles` if `DOCKER_HOST` is not set (see above BIND_DIR line), in such case this will do nothing since `DOCKER_MOUNT` will already be set.
DOCKER_MOUNT := $(if $(DOCKER_MOUNT),$(DOCKER_MOUNT),-v /go/src/github.com/docker/docker/bundles) -v "$(CURDIR)/.git:/go/src/github.com/docker/docker/.git" DOCKER_MOUNT := $(if $(DOCKER_MOUNT),$(DOCKER_MOUNT),-v "/go/src/github.com/docker/docker/bundles")
DOCKER_MOUNT_CACHE := -v docker-dev-cache:/root/.cache -v docker-mod-cache:/go/pkg/mod/ GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
DOCKER_MOUNT_CLI := $(if $(DOCKER_CLI_PATH),-v $(shell dirname $(DOCKER_CLI_PATH)):/usr/local/cli,) GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
DOCKER_MOUNT_BASH_COMPLETION := $(if $(DOCKER_BASH_COMPLETION_PATH),-v $(shell dirname $(DOCKER_BASH_COMPLETION_PATH)):/usr/local/completion/bash,) DOCKER_IMAGE := docker-dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
DOCKER_MOUNT := $(DOCKER_MOUNT) $(DOCKER_MOUNT_CACHE) $(DOCKER_MOUNT_CLI) $(DOCKER_MOUNT_BASH_COMPLETION) DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
endif # ifndef DOCKER_MOUNT
# This allows to set the docker-dev container name DOCKER_FLAGS := docker run --rm -i --privileged $(DOCKER_ENVS) $(DOCKER_MOUNT)
DOCKER_CONTAINER_NAME := $(if $(CONTAINER_NAME),--name $(CONTAINER_NAME),)
DOCKER_IMAGE := docker-dev
DOCKER_PORT_FORWARD := $(if $(DOCKER_PORT),-p "$(DOCKER_PORT)",)
DELVE_PORT_FORWARD := $(if $(DELVE_PORT),-p "$(DELVE_PORT)",)
DOCKER_FLAGS := $(DOCKER) run --rm --privileged $(DOCKER_CONTAINER_NAME) $(DOCKER_ENVS) $(DOCKER_MOUNT) $(DOCKER_PORT_FORWARD) $(DELVE_PORT_FORWARD)
SWAGGER_DOCS_PORT ?= 9000
define \n
endef
# if this session isn't interactive, then we don't want to allocate a # if this session isn't interactive, then we don't want to allocate a
# TTY, which would fail, but if it is interactive, we do want to attach # TTY, which would fail, but if it is interactive, we do want to attach
@ -132,135 +54,73 @@ ifeq ($(INTERACTIVE), 1)
DOCKER_FLAGS += -t DOCKER_FLAGS += -t
endif endif
# on GitHub Runners input device is not a TTY but we allocate a pseudo-one,
# otherwise keep STDIN open even if not attached if not a GitHub Runner.
ifeq ($(GITHUB_ACTIONS),true)
DOCKER_FLAGS += -t
else
DOCKER_FLAGS += -i
endif
DOCKER_RUN_DOCKER := $(DOCKER_FLAGS) "$(DOCKER_IMAGE)" DOCKER_RUN_DOCKER := $(DOCKER_FLAGS) "$(DOCKER_IMAGE)"
DOCKER_BUILD_ARGS += --build-arg=GO_VERSION
DOCKER_BUILD_ARGS += --build-arg=DOCKERCLI_VERSION
DOCKER_BUILD_ARGS += --build-arg=DOCKERCLI_REPOSITORY
DOCKER_BUILD_ARGS += --build-arg=DOCKERCLI_INTEGRATION_VERSION
DOCKER_BUILD_ARGS += --build-arg=DOCKERCLI_INTEGRATION_REPOSITORY
ifdef DOCKER_SYSTEMD
DOCKER_BUILD_ARGS += --build-arg=SYSTEMD=true
endif
BUILD_OPTS := ${DOCKER_BUILD_ARGS} ${DOCKER_BUILD_OPTS}
BUILD_CMD := $(BUILDX) build
BAKE_CMD := $(BUILDX) bake
default: binary default: binary
all: build ## validate all checks, build linux binaries, run all tests,\ncross build non-linux binaries, and generate archives all: build ## validate all checks, build linux binaries, run all tests\ncross build non-linux binaries and generate archives
$(DOCKER_RUN_DOCKER) bash -c 'hack/validate/default && hack/make.sh' $(DOCKER_RUN_DOCKER) hack/make.sh
binary: bundles ## build statically linked linux binaries binary: build ## build the linux binaries
$(BAKE_CMD) binary $(DOCKER_RUN_DOCKER) hack/make.sh binary
dynbinary: bundles ## build dynamically linked linux binaries build: bundles
$(BAKE_CMD) dynbinary docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" -f "$(DOCKERFILE)" .
cross: bundles ## cross build the binaries build-gccgo: bundles
$(BAKE_CMD) binary-cross docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)-gccgo" -f Dockerfile.gccgo .
bundles: bundles:
mkdir bundles mkdir bundles
.PHONY: clean cross: build ## cross build the binaries for darwin, freebsd and\nwindows
clean: clean-cache $(DOCKER_RUN_DOCKER) hack/make.sh dynbinary binary cross
.PHONY: clean-cache win: build ## cross build the binary for windows
clean-cache: ## remove the docker volumes that are used for caching in the dev-container $(DOCKER_RUN_DOCKER) hack/make.sh win
docker volume rm -f docker-dev-cache docker-mod-cache
help: ## this help tgz: build ## build the archives (.zip on windows and .tgz\notherwise) containing the binaries
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) $(DOCKER_RUN_DOCKER) hack/make.sh dynbinary binary cross tgz
deb: build ## build the deb packages
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary build-deb
docs: ## build the docs
$(MAKE) -C docs docs
gccgo: build-gccgo ## build the gcc-go linux binaries
$(DOCKER_FLAGS) "$(DOCKER_IMAGE)-gccgo" hack/make.sh gccgo
install: ## install the linux binaries install: ## install the linux binaries
KEEPBUNDLE=1 hack/make.sh install-binary KEEPBUNDLE=1 hack/make.sh install-binary
run: build ## run the docker daemon in a container rpm: build ## build the rpm packages
$(DOCKER_RUN_DOCKER) sh -c "KEEPBUNDLE=1 hack/make.sh install-binary run" $(DOCKER_RUN_DOCKER) hack/make.sh dynbinary build-rpm
.PHONY: build
ifeq ($(BIND_DIR), .)
build: shell_target := --target=dev-base
else
build: shell_target := --target=dev
endif
build: bundles
$(BUILD_CMD) $(BUILD_OPTS) $(shell_target) --load -t "$(DOCKER_IMAGE)" .
shell: build ## start a shell inside the build env shell: build ## start a shell inside the build env
$(DOCKER_RUN_DOCKER) bash $(DOCKER_RUN_DOCKER) bash
test: build test-unit ## run the unit, integration and docker-py tests test: build ## run the unit, integration and docker-py tests
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary test-integration test-docker-py $(DOCKER_RUN_DOCKER) hack/make.sh dynbinary cross test-unit test-integration-cli test-docker-py
test-docker-py: build ## run the docker-py tests test-docker-py: build ## run the docker-py tests
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary test-docker-py $(DOCKER_RUN_DOCKER) hack/make.sh dynbinary test-docker-py
test-integration-cli: test-integration ## (DEPRECATED) use test-integration test-integration-cli: build ## run the integration tests
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary test-integration-cli
ifneq ($(and $(TEST_SKIP_INTEGRATION),$(TEST_SKIP_INTEGRATION_CLI)),)
test-integration:
@echo Both integrations suites skipped per environment variables
else
test-integration: build ## run the integration tests
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary test-integration
endif
test-integration-flaky: build ## run the stress test for all new integration tests
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary test-integration-flaky
test-unit: build ## run the unit tests test-unit: build ## run the unit tests
$(DOCKER_RUN_DOCKER) hack/test/unit $(DOCKER_RUN_DOCKER) hack/make.sh test-unit
validate: build ## validate DCO, Seccomp profile generation, gofmt,\n./pkg/ isolation, golint, tests, tomls, go vet and vendor validate: build ## validate DCO, Seccomp profile generation, gofmt,\n./pkg/ isolation, golint, tests, tomls, go vet and vendor
$(DOCKER_RUN_DOCKER) hack/validate/all $(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
validate-generate-files: manpages: ## Generate man pages from go source and markdown
$(BUILD_CMD) --target "validate" \ docker build -t docker-manpage-dev -f "man/$(DOCKERFILE)" ./man
--output "type=cacheonly" \ docker run \
--file "./hack/dockerfiles/generate-files.Dockerfile" . -v $(PWD):/go/src/github.com/docker/docker/ \
docker-manpage-dev
validate-%: build ## validate specific check help: ## this help
$(DOCKER_RUN_DOCKER) hack/validate/$* @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
win: bundles ## cross build the binary for windows
$(BAKE_CMD) --set *.platform=windows/amd64 binary
.PHONY: swagger-gen
swagger-gen:
docker run --rm -v $(PWD):/go/src/github.com/docker/docker \
-w /go/src/github.com/docker/docker \
--entrypoint hack/generate-swagger-api.sh \
-e GOPATH=/go \
quay.io/goswagger/swagger:0.7.4
.PHONY: swagger-docs
swagger-docs: ## preview the API documentation
@echo "API docs preview will be running at http://localhost:$(SWAGGER_DOCS_PORT)"
@docker run --rm -v $(PWD)/api/swagger.yaml:/usr/share/nginx/html/swagger.yaml \
-e 'REDOC_OPTIONS=hide-hostname="true" lazy-rendering' \
-p $(SWAGGER_DOCS_PORT):80 \
bfirsh/redoc:1.14.0
.PHONY: generate-files
generate-files:
$(eval $@_TMP_OUT := $(shell mktemp -d -t moby-output.XXXXXXXXXX))
@if [ -z "$($@_TMP_OUT)" ]; then \
echo "Temp dir is not set"; \
exit 1; \
fi
$(BUILD_CMD) --target "update" \
--output "type=local,dest=$($@_TMP_OUT)" \
--file "./hack/dockerfiles/generate-files.Dockerfile" .
cp -R "$($@_TMP_OUT)"/. .
rm -rf "$($@_TMP_OUT)"/*

4
NOTICE
View file

@ -1,9 +1,9 @@
Docker Docker
Copyright 2012-2017 Docker, Inc. Copyright 2012-2016 Docker, Inc.
This product includes software developed at Docker, Inc. (https://www.docker.com). This product includes software developed at Docker, Inc. (https://www.docker.com).
This product contains software (https://github.com/creack/pty) developed This product contains software (https://github.com/kr/pty) developed
by Keith Rarick, licensed under the MIT License. by Keith Rarick, licensed under the MIT License.
The following is courtesy of our legal counsel: The following is courtesy of our legal counsel:

309
README.md
View file

@ -1,48 +1,270 @@
The Moby Project Docker: the container engine [![Release](https://img.shields.io/github/release/docker/docker.svg)](https://github.com/docker/docker/releases/latest)
================ ============================
![Moby Project logo](docs/static_files/moby-project-logo.png "The Moby Project") Docker is an open source project to pack, ship and run any application
as a lightweight container.
Moby is an open-source project created by Docker to enable and accelerate software containerization. Docker containers are both *hardware-agnostic* and *platform-agnostic*.
This means they can run anywhere, from your laptop to the largest
cloud compute instance and everything in between - and they don't require
you to use a particular language, framework or packaging system. That
makes them great building blocks for deploying and scaling web apps,
databases, and backend services without depending on a particular stack
or provider.
It provides a "Lego set" of toolkit components, the framework for assembling them into custom container-based systems, and a place for all container enthusiasts and professionals to experiment and exchange ideas. Docker began as an open-source implementation of the deployment engine which
Components include container build tools, a container registry, orchestration tools, a runtime and more, and these can be used as building blocks in conjunction with other tools and projects. powered [dotCloud](http://web.archive.org/web/20130530031104/https://www.dotcloud.com/),
a popular Platform-as-a-Service. It benefits directly from the experience
accumulated over several years of large-scale operation and support of hundreds
of thousands of applications and databases.
## Principles ![Docker logo](docs/static_files/docker-logo-compressed.png "Docker")
Moby is an open project guided by strong principles, aiming to be modular, flexible and without too strong an opinion on user experience. ## Security Disclosure
It is open to the community to help set its direction.
- Modular: the project includes lots of components that have well-defined functions and APIs that work together. Security is very important to us. If you have any issue regarding security,
- Batteries included but swappable: Moby includes enough components to build fully featured container systems, but its modular architecture ensures that most of the components can be swapped by different implementations. please disclose the information responsibly by sending an email to
- Usable security: Moby provides secure defaults without compromising usability. security@docker.com and not by creating a github issue.
- Developer focused: The APIs are intended to be functional and useful to build powerful tools.
They are not necessarily intended as end user tools but as components aimed at developers.
Documentation and UX is aimed at developers not end users.
## Audience ## Better than VMs
The Moby Project is intended for engineers, integrators and enthusiasts looking to modify, hack, fix, experiment, invent and build systems based on containers. A common method for distributing applications and sandboxing their
It is not for people looking for a commercially supported system, but for people who want to work and learn with open source code. execution is to use virtual machines, or VMs. Typical VM formats are
VMware's vmdk, Oracle VirtualBox's vdi, and Amazon EC2's ami. In theory
these formats should allow every developer to automatically package
their application into a "machine" for easy distribution and deployment.
In practice, that almost never happens, for a few reasons:
## Relationship with Docker * *Size*: VMs are very large which makes them impractical to store
and transfer.
* *Performance*: running VMs consumes significant CPU and memory,
which makes them impractical in many scenarios, for example local
development of multi-tier applications, and large-scale deployment
of cpu and memory-intensive applications on large numbers of
machines.
* *Portability*: competing VM environments don't play well with each
other. Although conversion tools do exist, they are limited and
add even more overhead.
* *Hardware-centric*: VMs were designed with machine operators in
mind, not software developers. As a result, they offer very
limited tooling for what developers need most: building, testing
and running their software. For example, VMs offer no facilities
for application versioning, monitoring, configuration, logging or
service discovery.
The components and tools in the Moby Project are initially the open source components that Docker and the community have built for the Docker Project. By contrast, Docker relies on a different sandboxing method known as
New projects can be added if they fit with the community goals. Docker is committed to using Moby as the upstream for the Docker Product. *containerization*. Unlike traditional virtualization, containerization
However, other projects are also encouraged to use Moby as an upstream, and to reuse the components in diverse ways, and all these uses will be treated in the same way. External maintainers and contributors are welcomed. takes place at the kernel level. Most modern operating system kernels
now support the primitives necessary for containerization, including
Linux with [openvz](https://openvz.org),
[vserver](http://linux-vserver.org) and more recently
[lxc](https://linuxcontainers.org/), Solaris with
[zones](https://docs.oracle.com/cd/E26502_01/html/E29024/preface-1.html#scrolltoc),
and FreeBSD with
[Jails](https://www.freebsd.org/doc/handbook/jails.html).
The Moby project is not intended as a location for support or feature requests for Docker products, but as a place for contributors to work on open source code, fix bugs, and make the code more useful. Docker builds on top of these low-level primitives to offer developers a
The releases are supported by the maintainers, community and users, on a best efforts basis only, and are not intended for customers who want enterprise or commercial support; Docker EE is the appropriate product for these use cases. portable format and runtime environment that solves all four problems.
Docker containers are small (and their transfer can be optimized with
layers), they have basically zero memory and cpu overhead, they are
completely portable, and are designed from the ground up with an
application-centric design.
----- Perhaps best of all, because Docker operates at the OS level, it can still be
run inside a VM!
Legal ## Plays well with others
=====
Docker does not require you to buy into a particular programming
language, framework, packaging system, or configuration language.
Is your application a Unix process? Does it use files, tcp connections,
environment variables, standard Unix streams and command-line arguments
as inputs and outputs? Then Docker can run it.
Can your application's build be expressed as a sequence of such
commands? Then Docker can build it.
## Escape dependency hell
A common problem for developers is the difficulty of managing all
their application's dependencies in a simple and automated way.
This is usually difficult for several reasons:
* *Cross-platform dependencies*. Modern applications often depend on
a combination of system libraries and binaries, language-specific
packages, framework-specific modules, internal components
developed for another project, etc. These dependencies live in
different "worlds" and require different tools - these tools
typically don't work well with each other, requiring awkward
custom integrations.
* *Conflicting dependencies*. Different applications may depend on
different versions of the same dependency. Packaging tools handle
these situations with various degrees of ease - but they all
handle them in different and incompatible ways, which again forces
the developer to do extra work.
* *Custom dependencies*. A developer may need to prepare a custom
version of their application's dependency. Some packaging systems
can handle custom versions of a dependency, others can't - and all
of them handle it differently.
Docker solves the problem of dependency hell by giving the developer a simple
way to express *all* their application's dependencies in one place, while
streamlining the process of assembling them. If this makes you think of
[XKCD 927](https://xkcd.com/927/), don't worry. Docker doesn't
*replace* your favorite packaging systems. It simply orchestrates
their use in a simple and repeatable way. How does it do that? With
layers.
Docker defines a build as running a sequence of Unix commands, one
after the other, in the same container. Build commands modify the
contents of the container (usually by installing new files on the
filesystem), the next command modifies it some more, etc. Since each
build command inherits the result of the previous commands, the
*order* in which the commands are executed expresses *dependencies*.
Here's a typical Docker build process:
```bash
FROM ubuntu:12.04
RUN apt-get update && apt-get install -y python python-pip curl
RUN curl -sSL https://github.com/shykes/helloflask/archive/master.tar.gz | tar -xzv
RUN cd helloflask-master && pip install -r requirements.txt
```
Note that Docker doesn't care *how* dependencies are built - as long
as they can be built by running a Unix command in a container.
Getting started
===============
Docker can be installed either on your computer for building applications or
on servers for running them. To get started, [check out the installation
instructions in the
documentation](https://docs.docker.com/engine/installation/).
Usage examples
==============
Docker can be used to run short-lived commands, long-running daemons
(app servers, databases, etc.), interactive shell sessions, etc.
You can find a [list of real-world
examples](https://docs.docker.com/engine/examples/) in the
documentation.
Under the hood
--------------
Under the hood, Docker is built on the following components:
* The
[cgroups](https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt)
and
[namespaces](http://man7.org/linux/man-pages/man7/namespaces.7.html)
capabilities of the Linux kernel
* The [Go](https://golang.org) programming language
* The [Docker Image Specification](https://github.com/docker/docker/blob/master/image/spec/v1.md)
* The [Libcontainer Specification](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md)
Contributing to Docker [![GoDoc](https://godoc.org/github.com/docker/docker?status.svg)](https://godoc.org/github.com/docker/docker)
======================
| **Master** (Linux) | **Experimental** (linux) | **Windows** | **FreeBSD** |
|------------------|----------------------|---------|---------|
| [![Jenkins Build Status](https://jenkins.dockerproject.org/view/Docker/job/Docker%20Master/badge/icon)](https://jenkins.dockerproject.org/view/Docker/job/Docker%20Master/) | [![Jenkins Build Status](https://jenkins.dockerproject.org/view/Docker/job/Docker%20Master%20%28experimental%29/badge/icon)](https://jenkins.dockerproject.org/view/Docker/job/Docker%20Master%20%28experimental%29/) | [![Build Status](http://jenkins.dockerproject.org/job/Docker%20Master%20(windows)/badge/icon)](http://jenkins.dockerproject.org/job/Docker%20Master%20(windows)/) | [![Build Status](http://jenkins.dockerproject.org/job/Docker%20Master%20(freebsd)/badge/icon)](http://jenkins.dockerproject.org/job/Docker%20Master%20(freebsd)/) |
Want to hack on Docker? Awesome! We have [instructions to help you get
started contributing code or documentation](https://docs.docker.com/opensource/project/who-written-for/).
These instructions are probably not perfect, please let us know if anything
feels wrong or incomplete. Better yet, submit a PR and improve them yourself.
Getting the development builds
==============================
Want to run Docker from a master build? You can download
master builds at [master.dockerproject.org](https://master.dockerproject.org).
They are updated with each commit merged into the master branch.
Don't know how to use that super cool new feature in the master build? Check
out the master docs at
[docs.master.dockerproject.org](http://docs.master.dockerproject.org).
How the project is run
======================
Docker is a very, very active project. If you want to learn more about how it is run,
or want to get more involved, the best place to start is [the project directory](https://github.com/docker/docker/tree/master/project).
We are always open to suggestions on process improvements, and are always looking for more maintainers.
### Talking to other Docker users and contributors
<table class="tg">
<col width="45%">
<col width="65%">
<tr>
<td>Internet&nbsp;Relay&nbsp;Chat&nbsp;(IRC)</td>
<td>
<p>
IRC is a direct line to our most knowledgeable Docker users; we have
both the <code>#docker</code> and <code>#docker-dev</code> group on
<strong>irc.freenode.net</strong>.
IRC is a rich chat protocol but it can overwhelm new users. You can search
<a href="https://botbot.me/freenode/docker/#" target="_blank">our chat archives</a>.
</p>
Read our <a href="https://docs.docker.com/project/get-help/#irc-quickstart" target="_blank">IRC quickstart guide</a> for an easy way to get started.
</td>
</tr>
<tr>
<td>Docker Community Forums</td>
<td>
The <a href="https://forums.docker.com/c/open-source-projects/de" target="_blank">Docker Engine</a>
group is for users of the Docker Engine project.
</td>
</tr>
<tr>
<td>Google Groups</td>
<td>
The <a href="https://groups.google.com/forum/#!forum/docker-dev"
target="_blank">docker-dev</a> group is for contributors and other people
contributing to the Docker project. You can join this group without a
Google account by sending an email to <a
href="mailto:docker-dev+subscribe@googlegroups.com">docker-dev+subscribe@googlegroups.com</a>.
You'll receive a join-request message; simply reply to the message to
confirm your subscribtion.
</td>
</tr>
<tr>
<td>Twitter</td>
<td>
You can follow <a href="https://twitter.com/docker/" target="_blank">Docker's Twitter feed</a>
to get updates on our products. You can also tweet us questions or just
share blogs or stories.
</td>
</tr>
<tr>
<td>Stack Overflow</td>
<td>
Stack Overflow has over 7000 Docker questions listed. We regularly
monitor <a href="https://stackoverflow.com/search?tab=newest&q=docker" target="_blank">Docker questions</a>
and so do many other knowledgeable Docker users.
</td>
</tr>
</table>
### Legal
*Brought to you courtesy of our legal counsel. For more context, *Brought to you courtesy of our legal counsel. For more context,
please see the [NOTICE](https://github.com/moby/moby/blob/master/NOTICE) document in this repo.* please see the [NOTICE](https://github.com/docker/docker/blob/master/NOTICE) document in this repo.*
Use and transfer of Moby may be subject to certain restrictions by the Use and transfer of Docker may be subject to certain restrictions by the
United States and other governments. United States and other governments.
It is your responsibility to ensure that your use and/or transfer does not It is your responsibility to ensure that your use and/or transfer does not
@ -50,8 +272,33 @@ violate applicable laws.
For more information, please see https://www.bis.doc.gov For more information, please see https://www.bis.doc.gov
Licensing Licensing
========= =========
Moby is licensed under the Apache License, Version 2.0. See Docker is licensed under the Apache License, Version 2.0. See
[LICENSE](https://github.com/moby/moby/blob/master/LICENSE) for the full [LICENSE](https://github.com/docker/docker/blob/master/LICENSE) for the full
license text. license text.
Other Docker Related Projects
=============================
There are a number of projects under development that are based on Docker's
core technology. These projects expand the tooling built around the
Docker platform to broaden its application and utility.
* [Docker Registry](https://github.com/docker/distribution): Registry
server for Docker (hosting/delivery of repositories and images)
* [Docker Machine](https://github.com/docker/machine): Machine management
for a container-centric world
* [Docker Swarm](https://github.com/docker/swarm): A Docker-native clustering
system
* [Docker Compose](https://github.com/docker/compose) (formerly Fig):
Define and run multi-container apps
* [Kitematic](https://github.com/docker/kitematic): The easiest way to use
Docker on Mac and Windows
If you know of another project underway that should be listed here, please help
us keep this list up-to-date by submitting a PR.
Awesome-Docker
==============
You can find more projects, tools and articles related to Docker on the [awesome-docker list](https://github.com/veggiemonk/awesome-docker). Add your project there.

View file

@ -1,117 +1,140 @@
Moby Project Roadmap Docker Engine Roadmap
==================== =====================
### How should I use this document? ### How should I use this document?
This document provides description of items that the project decided to prioritize. This should This document provides description of items that the project decided to prioritize. This should
serve as a reference point for Moby contributors to understand where the project is going, and serve as a reference point for Docker contributors to understand where the project is going, and
help determine if a contribution could be conflicting with some longer term plans. help determine if a contribution could be conflicting with some longer terms plans.
The fact that a feature isn't listed here doesn't mean that a patch for it will automatically be The fact that a feature isn't listed here doesn't mean that a patch for it will automatically be
refused! We are always happy to receive patches for new cool features we haven't thought about, refused (except for those mentioned as "frozen features" below)! We are always happy to receive
or didn't judge to be a priority. Please however understand that such patches might take longer patches for new cool features we haven't thought about, or didn't judge priority. Please however
for us to review. understand that such patches might take longer for us to review.
### How can I help? ### How can I help?
Short term objectives are listed in Short term objectives are listed in the [wiki](https://github.com/docker/docker/wiki) and described
[Issues](https://github.com/moby/moby/issues?q=is%3Aopen+is%3Aissue+label%3Aroadmap). Our in [Issues](https://github.com/docker/docker/issues?q=is%3Aopen+is%3Aissue+label%3Aroadmap). Our
goal is to split down the workload in such way that anybody can jump in and help. Please comment on goal is to split down the workload in such way that anybody can jump in and help. Please comment on
issues if you want to work on it to avoid duplicating effort! Similarly, if a maintainer is already issues if you want to take it to avoid duplicating effort! Similarly, if a maintainer is already
assigned on an issue you'd like to participate in, pinging him on GitHub to offer your help is assigned on an issue you'd like to participate in, pinging him on IRC or GitHub to offer your help is
the best way to go. the best way to go.
### How can I add something to the roadmap? ### How can I add something to the roadmap?
The roadmap process is new to the Moby Project: we are only beginning to structure and document the The roadmap process is new to the Docker Engine: we are only beginning to structure and document the
project objectives. Our immediate goal is to be more transparent, and work with our community to project objectives. Our immediate goal is to be more transparent, and work with our community to
focus our efforts on fewer prioritized topics. focus our efforts on fewer prioritized topics.
We hope to offer in the near future a process allowing anyone to propose a topic to the roadmap, but We hope to offer in the near future a process allowing anyone to propose a topic to the roadmap, but
we are not quite there yet. For the time being, it is best to discuss with the maintainers on an we are not quite there yet. For the time being, the BDFL remains the keeper of the roadmap, and we
issue, in the Slack channel, or in person at the Moby Summits that happen every few months. won't be accepting pull requests adding or removing items from this file.
# 1. Features and refactoring # 1. Features and refactoring
## 1.1 Runtime improvements ## 1.1 Runtime improvements
Over time we have accumulated a lot of functionality in the container runtime We recently introduced [`runC`](https://runc.io) as a standalone low-level tool for container
aspect of Moby while also growing in other areas. Much of the container runtime execution. The initial goal was to integrate runC as a replacement in the Engine for the traditional
pieces are now duplicated work available in other, lower level components such default libcontainer `execdriver`, but the Engine internals were not ready for this.
as [containerd](https://containerd.io).
Moby currently only utilizes containerd for basic runtime state management, e.g. starting As runC continued evolving, and the OCI specification along with it, we created
and stopping a container, which is what the pre-containerd 1.0 daemon provided. [`containerd`](https://containerd.tools/), a daemon to control and monitor multiple `runC`. This is
Now that containerd is a full-fledged container runtime which supports full the new target for Engine integration, as it can entirely replace the whole `execdriver`
container life-cycle management, we would like to start relying more on containerd architecture, and container monitoring along with it.
and removing the bits in Moby which are now duplicated. This will necessitate
a significant effort to refactor and even remove large parts of Moby's codebase.
Tracking issues: Docker Engine will rely on a long-running `containerd` companion daemon for all container execution
related operations. This could open the door in the future for Engine restarts without interrupting
running containers.
- [#38043](https://github.com/moby/moby/issues/38043) Proposal: containerd image integration ## 1.2 Plugins improvements
## 1.2 Image Builder Docker Engine 1.7.0 introduced plugin support, initially for the use cases of volumes and networks
extensions. The plugin infrastructure was kept minimal as we were collecting use cases and real
world feedback before optimizing for any particular workflow.
Work is ongoing to integrate [BuildKit](https://github.com/moby/buildkit) into In the future, we'd like plugins to become first class citizens, and encourage an ecosystem of
Moby and replace the "v0" build implementation. Buildkit offers better cache plugins. This implies in particular making it trivially easy to distribute plugins as containers
management, parallelizable build steps, and better extensibility while also through any Registry instance, as well as solving the commonly heard pain points of plugins needing
keeping builds portable, a chief tenent of Moby's builder. to be treated as somewhat special (being active at all time, started before any other user
containers, and not as easily dismissed).
Upon completion of this effort, users will have a builder that performs better ## 1.3 Internal decoupling
while also being more extensible, enabling users to provide their own custom
syntax which can be either Dockerfile-like or something completely different.
See [buildpacks on buildkit](https://github.com/tonistiigi/buildkit-pack) as an A lot of work has been done in trying to decouple the Docker Engine's internals. In particular, the
example of this extensibility. API implementation has been refactored and ongoing work is happening to move the code to a separate
repository ([`docker/engine-api`](https://github.com/docker/engine-api)), and the Builder side of
the daemon is now [fully independent](https://github.com/docker/docker/tree/master/builder) while
still residing in the same repository.
New features for the builder and Dockerfile should be implemented first in the We are exploring ways to go further with that decoupling, capitalizing on the work introduced by the
BuildKit backend using an external Dockerfile implementation from the container runtime renovation and plugins improvement efforts. Indeed, the combination of `containerd` support
images. This allows everyone to test and evaluate the feature without upgrading with the concept of "special" containers opens the door for bootstrapping more Engine internals
their daemon. New features should go to the experimental channel first, and can be using the same facilities.
part of the `docker/dockerfile:experimental` image. From there they graduate to
`docker/dockerfile:latest` and binary releases. The Dockerfile frontend source
code is temporarily located at
[https://github.com/moby/buildkit/tree/master/frontend/dockerfile](https://github.com/moby/buildkit/tree/master/frontend/dockerfile)
with separate new features defined with go build tags.
Tracking issues: ## 1.4 Cluster capable Engine
- [#32925](https://github.com/moby/moby/issues/32925) discussion: builder future: buildkit The community has been pushing for a more cluster capable Docker Engine, and a huge effort was spent
adding features such as multihost networking, and node discovery down at the Engine level. Yet, the
Engine is currently incapable of taking scheduling decisions alone, and continues relying on Swarm
for that.
## 1.3 Rootless Mode We plan to complete this effort and make Engine fully cluster capable. Multiple instances of the
Docker Engine being already capable of discovering each other and establish overlay networking for
their container to communicate, the next step is for a given Engine to gain ability to dispatch work
to another node in the cluster. This will be introduced in a backward compatible way, such that a
`docker run` invocation on a particular node remains fully deterministic.
Running the daemon requires elevated privileges for many tasks. We would like to # 2 Frozen features
support running the daemon as a normal, unprivileged user without requiring `suid`
binaries.
Tracking issues: ## 2.1 Docker exec
- [#37375](https://github.com/moby/moby/issues/37375) Proposal: allow running `dockerd` as an unprivileged user (aka rootless mode) We won't accept patches expanding the surface of `docker exec`, which we intend to keep as a
*debugging* feature, as well as being strongly dependent on the Runtime ingredient effort.
## 1.4 Testing ## 2.2 Dockerfile syntax
Moby has many tests, both unit and integration. Moby needs more tests which can The Dockerfile syntax as we know it is simple, and has proven successful in supporting all our
cover the full spectrum functionality and edge cases out there. [official images](https://github.com/docker-library/official-images). Although this is *not* a
definitive move, we temporarily won't accept more patches to the Dockerfile syntax for several
reasons:
Tests in the `integration-cli` folder should also be migrated into (both in - Long term impact of syntax changes is a sensitive matter that require an amount of attention the
location and style) the `integration` folder. These newer tests are simpler to volume of Engine codebase and activity today doesn't allow us to provide.
run in isolation, simpler to read, simpler to write, and more fully exercise the - Allowing the Builder to be implemented as a separate utility consuming the Engine's API will
API. Meanwhile tests of the docker CLI should generally live in docker/cli. open the door for many possibilities, such as offering alternate syntaxes or DSL for existing
languages without cluttering the Engine's codebase.
- A standalone Builder will also offer the opportunity for a better dedicated group of maintainers
to own the Dockerfile syntax and decide collectively on the direction to give it.
- Our experience with official images tend to show that no new instruction or syntax expansion is
*strictly* necessary for the majority of use cases, and although we are aware many things are
still lacking for many, we cannot make it a priority yet for the above reasons.
Tracking issues: Again, this is not about saying that the Dockerfile syntax is done, it's about making choices about
what we want to do first!
- [#32866](https://github.com/moby/moby/issues/32866) Replace integration-cli suite with API test suite ## 2.3 Remote Registry Operations
## 1.5 Internal decoupling A large amount of work is ongoing in the area of image distribution and provenance. This includes
moving to the V2 Registry API and heavily refactoring the code that powers these features. The
desired result is more secure, reliable and easier to use image distribution.
A lot of work has been done in trying to decouple Moby internals. This process of creating Part of the problem with this part of the code base is the lack of a stable and flexible interface.
standalone projects with a well defined function that attract a dedicated community should continue. If new features are added that access the registry without solidifying these interfaces, achieving
As well as integrating `containerd` we would like to integrate [BuildKit](https://github.com/moby/buildkit) feature parity will continue to be elusive. While we get a handle on this situation, we are imposing
as the next standalone component. a moratorium on new code that accesses the Registry API in commands that don't already make remote
We see gRPC as the natural communication layer between decoupled components. calls.
In addition to pushing out large components into other projects, much of the Currently, only the following commands cause interaction with a remote registry:
internal code structure, and in particular the
["Daemon"](https://godoc.org/github.com/docker/docker/daemon#Daemon) object, - push
should be split into smaller, more manageable, and more testable components. - pull
- run
- build
- search
- login
In the interest of stabilizing the registry access model during this ongoing work, we are not
accepting additions to other commands that will cause remote interaction with the Registry API. This
moratorium will lift when the goals of the distribution project have been met.

View file

@ -1,9 +0,0 @@
# Reporting security issues
The Moby maintainers take security seriously. If you discover a security issue, please bring it to their attention right away!
### Reporting a Vulnerability
Please **DO NOT** file a public issue, instead send your report privately to security@docker.com.
Security reports are greatly appreciated and we will publicly thank you for it, although we keep your name confidential if you request it. We also like to send gifts—if you're into schwag, make sure to let us know. We currently do not offer a paid security bounty program, but are not ruling it out in the future.

View file

@ -1,126 +0,0 @@
# Testing
This document contains the Moby code testing guidelines. It should answer any
questions you may have as an aspiring Moby contributor.
## Test suites
Moby has two test suites (and one legacy test suite):
* Unit tests - use standard `go test` and
[gotest.tools/assert](https://godoc.org/gotest.tools/assert) assertions. They are located in
the package they test. Unit tests should be fast and test only their own
package.
* API integration tests - use standard `go test` and
[gotest.tools/assert](https://godoc.org/gotest.tools/assert) assertions. They are located in
`./integration/<component>` directories, where `component` is: container,
image, volume, etc. These tests perform HTTP requests to an API endpoint and
check the HTTP response and daemon state after the call.
The legacy test suite `integration-cli/` is deprecated. No new tests will be
added to this suite. Any tests in this suite which require updates should be
ported to either the unit test suite or the new API integration test suite.
## Writing new tests
Most code changes will fall into one of the following categories.
### Writing tests for new features
New code should be covered by unit tests. If the code is difficult to test with
unit tests, then that is a good sign that it should be refactored to make it
easier to reuse and maintain. Consider accepting unexported interfaces instead
of structs so that fakes can be provided for dependencies.
If the new feature includes a completely new API endpoint then a new API
integration test should be added to cover the success case of that endpoint.
If the new feature does not include a completely new API endpoint consider
adding the new API fields to the existing test for that endpoint. A new
integration test should **not** be added for every new API field or API error
case. Error cases should be handled by unit tests.
### Writing tests for bug fixes
Bugs fixes should include a unit test case which exercises the bug.
A bug fix may also include new assertions in existing integration tests for the
API endpoint.
### Writing new integration tests
Note the `integration-cli` tests are deprecated; new tests will be rejected by
the CI.
Instead, implement new tests under `integration/`.
### Integration tests environment considerations
When adding new tests or modifying existing tests under `integration/`, testing
environment should be properly considered. `skip.If` from
[gotest.tools/skip](https://godoc.org/gotest.tools/skip) can be used to make the
test run conditionally. Full testing environment conditions can be found at
[environment.go](https://github.com/moby/moby/blob/6b6eeed03b963a27085ea670f40cd5ff8a61f32e/testutil/environment/environment.go)
Here is a quick example. If the test needs to interact with a docker daemon on
the same host, the following condition should be checked within the test code
```go
skip.If(t, testEnv.IsRemoteDaemon())
// your integration test code
```
If a remote daemon is detected, the test will be skipped.
## Running tests
### Unit Tests
To run the unit test suite:
```
make test-unit
```
or `hack/test/unit` from inside a `BINDDIR=. make shell` container or properly
configured environment.
The following environment variables may be used to run a subset of tests:
* `TESTDIRS` - paths to directories to be tested, defaults to `./...`
* `TESTFLAGS` - flags passed to `go test`, to run tests which match a pattern
use `TESTFLAGS="-test.run TestNameOrPrefix"`
### Integration Tests
To run the integration test suite:
```
make test-integration
```
This make target runs both the "integration" suite and the "integration-cli"
suite.
You can specify which integration test dirs to build and run by specifying
the list of dirs in the TEST_INTEGRATION_DIR environment variable.
You can also explicitly skip either suite by setting (any value) in
TEST_SKIP_INTEGRATION and/or TEST_SKIP_INTEGRATION_CLI environment variables.
Flags specific to each suite can be set in the TESTFLAGS_INTEGRATION and
TESTFLAGS_INTEGRATION_CLI environment variables.
If all you want is to specify a test filter to run, you can set the
`TEST_FILTER` environment variable. This ends up getting passed directly to `go
test -run` (or `go test -check-f`, depending on the test suite). It will also
automatically set the other above mentioned environment variables accordingly.
### Go Version
You can change a version of golang used for building stuff that is being tested
by setting `GO_VERSION` variable, for example:
```
make GO_VERSION=1.12.8 test
```

View file

@ -20,20 +20,19 @@ Each repo should:
github releases file. github releases file.
The goal here is for consuming repos to be able to use the tag version and The goal here is for consuming repos to be able to use the tag version and
changelog updates to determine whether the vendoring will cause any breaking or changelog updates to determine whether the vendoring will cause any breaking or
backward incompatible changes. This also means that repos can specify having backward incompatible changes. This also means that repos can specify having
dependency on a package of a specific version or greater up to the next major dependency on a package of a specific version or greater up to the next major
release, without encountering breaking changes. release, without encountering breaking changes.
## Semantic Versioning ## Semantic Versioning
Annotated version tags should follow [Semantic Versioning](http://semver.org) policies: Annotated version tags should follow Schema Versioning policies.
According to http://semver.org:
"Given a version number MAJOR.MINOR.PATCH, increment the: "Given a version number MAJOR.MINOR.PATCH, increment the:
MAJOR version when you make incompatible API changes,
1. MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and
2. MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes.
3. PATCH version when you make backwards-compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions Additional labels for pre-release and build metadata are available as extensions
to the MAJOR.MINOR.PATCH format." to the MAJOR.MINOR.PATCH format."

1
VERSION Normal file
View file

@ -0,0 +1 @@
1.12.6

View file

@ -1,42 +1,5 @@
# Working on the Engine API This directory contains code pertaining to the Docker API:
The Engine API is an HTTP API used by the command-line client to communicate with the daemon. It can also be used by third-party software to control the daemon. - Used by the docker client when communicating with the docker daemon
It consists of various components in this repository: - Used by third party tools wishing to interface with the docker daemon
- `api/swagger.yaml` A Swagger definition of the API.
- `api/types/` Types shared by both the client and server, representing various objects, options, responses, etc. Most are written manually, but some are automatically generated from the Swagger definition. See [#27919](https://github.com/docker/docker/issues/27919) for progress on this.
- `cli/` The command-line client.
- `client/` The Go client used by the command-line client. It can also be used by third-party Go programs.
- `daemon/` The daemon, which serves the API.
## Swagger definition
The API is defined by the [Swagger](http://swagger.io/specification/) definition in `api/swagger.yaml`. This definition can be used to:
1. Automatically generate documentation.
2. Automatically generate the Go server and client. (A work-in-progress.)
3. Provide a machine readable version of the API for introspecting what it can do, automatically generating clients for other languages, etc.
## Updating the API documentation
The API documentation is generated entirely from `api/swagger.yaml`. If you make updates to the API, edit this file to represent the change in the documentation.
The file is split into two main sections:
- `definitions`, which defines re-usable objects used in requests and responses
- `paths`, which defines the API endpoints (and some inline objects which don't need to be reusable)
To make an edit, first look for the endpoint you want to edit under `paths`, then make the required edits. Endpoints may reference reusable objects with `$ref`, which can be found in the `definitions` section.
There is hopefully enough example material in the file for you to copy a similar pattern from elsewhere in the file (e.g. adding new fields or endpoints), but for the full reference, see the [Swagger specification](https://github.com/docker/docker/issues/27919).
`swagger.yaml` is validated by `hack/validate/swagger` to ensure it is a valid Swagger definition. This is useful when making edits to ensure you are doing the right thing.
## Viewing the API documentation
When you make edits to `swagger.yaml`, you may want to check the generated API documentation to ensure it renders correctly.
Run `make swagger-docs` and a preview will be running at `http://localhost:9000`. Some of the styling may be incorrect, but you'll be able to ensure that it is generating the correct documentation.
The production documentation is generated by vendoring `swagger.yaml` into [docker/docker.github.io](https://github.com/docker/docker.github.io).

View file

@ -0,0 +1,71 @@
// +build experimental
package bundlefile
import (
"encoding/json"
"fmt"
"io"
)
// Bundlefile stores the contents of a bundlefile
type Bundlefile struct {
Version string
Services map[string]Service
}
// Service is a service from a bundlefile
type Service struct {
Image string
Command []string `json:",omitempty"`
Args []string `json:",omitempty"`
Env []string `json:",omitempty"`
Labels map[string]string `json:",omitempty"`
Ports []Port `json:",omitempty"`
WorkingDir *string `json:",omitempty"`
User *string `json:",omitempty"`
Networks []string `json:",omitempty"`
}
// Port is a port as defined in a bundlefile
type Port struct {
Protocol string
Port uint32
}
// LoadFile loads a bundlefile from a path to the file
func LoadFile(reader io.Reader) (*Bundlefile, error) {
bundlefile := &Bundlefile{}
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, nil
}
// Print writes the contents of the bundlefile to the output writer
// as human readable json
func Print(out io.Writer, bundle *Bundlefile) error {
bytes, err := json.MarshalIndent(*bundle, "", " ")
if err != nil {
return err
}
_, err = out.Write(bytes)
return err
}

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"
]`)
}

281
api/client/cli.go Normal file
View file

@ -0,0 +1,281 @@
package client
import (
"errors"
"fmt"
"io"
"net/http"
"os"
"runtime"
"github.com/docker/docker/api"
cliflags "github.com/docker/docker/cli/flags"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/cliconfig/configfile"
"github.com/docker/docker/cliconfig/credentials"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/term"
"github.com/docker/engine-api/client"
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
)
// DockerCli represents the docker command line client.
// Instances of the client can be returned from NewDockerCli.
type DockerCli struct {
// initializing closure
init func() error
// configFile has the client configuration file
configFile *configfile.ConfigFile
// in holds the input stream and closer (io.ReadCloser) for the client.
in io.ReadCloser
// out holds the output stream (io.Writer) for the client.
out io.Writer
// err holds the error stream (io.Writer) for the client.
err io.Writer
// keyFile holds the key file as a string.
keyFile string
// inFd holds the file descriptor of the client's STDIN (if valid).
inFd uintptr
// outFd holds file descriptor of the client's STDOUT (if valid).
outFd uintptr
// isTerminalIn indicates whether the client's STDIN is a TTY
isTerminalIn bool
// isTerminalOut indicates whether the client's STDOUT is a TTY
isTerminalOut bool
// client is the http client that performs all API operations
client client.APIClient
// 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
// such as the TLS, tcp and other parameters used to run the client.
func (cli *DockerCli) Initialize() error {
if cli.init == nil {
return nil
}
return cli.init()
}
// Client returns the APIClient
func (cli *DockerCli) Client() client.APIClient {
return cli.client
}
// Out returns the writer used for stdout
func (cli *DockerCli) Out() io.Writer {
return cli.out
}
// Err returns the writer used for stderr
func (cli *DockerCli) Err() io.Writer {
return cli.err
}
// In returns the reader used for stdin
func (cli *DockerCli) In() io.ReadCloser {
return cli.in
}
// ConfigFile returns the ConfigFile
func (cli *DockerCli) ConfigFile() *configfile.ConfigFile {
return cli.configFile
}
// IsTerminalOut returns true if the clients stdin is a TTY
func (cli *DockerCli) IsTerminalOut() bool {
return cli.isTerminalOut
}
// OutFd returns the fd for the stdout stream
func (cli *DockerCli) OutFd() uintptr {
return cli.outFd
}
// CheckTtyInput checks if we are trying to attach to a container tty
// from a non-tty client input stream, and if so, returns an error.
func (cli *DockerCli) CheckTtyInput(attachStdin, ttyMode bool) error {
// In order to attach to a container tty, input stream for the client must
// be a tty itself: redirecting or piping the client standard input is
// incompatible with `docker run -t`, `docker exec -t` or `docker attach`.
if ttyMode && attachStdin && !cli.isTerminalIn {
eText := "the input device is not a TTY"
if runtime.GOOS == "windows" {
return errors.New(eText + ". If you are using mintty, try prefixing the command with 'winpty'")
}
return errors.New(eText)
}
return nil
}
// PsFormat returns the format string specified in the configuration.
// String contains columns and format specification, for example {{ID}}\t{{Name}}.
func (cli *DockerCli) PsFormat() string {
return cli.configFile.PsFormat
}
// ImagesFormat returns the format string specified in the configuration.
// String contains columns and format specification, for example {{ID}}\t{{Name}}.
func (cli *DockerCli) ImagesFormat() string {
return cli.configFile.ImagesFormat
}
func (cli *DockerCli) setRawTerminal() error {
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
}
}
return nil
}
func (cli *DockerCli) restoreTerminal(in io.Closer) error {
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..
// As the client exists right after, simply discard the close
// until we find a better solution.
if in != nil && runtime.GOOS != "darwin" {
return in.Close()
}
return nil
}
// NewDockerCli returns a DockerCli instance with IO output and error streams set by in, out and err.
// The key file, protocol (i.e. unix) and address are passed in as strings, along with the tls.Config. If the tls.Config
// is set the client scheme will be set to https.
// The client will be given a 32-second timeout (see https://github.com/docker/docker/pull/8035).
func NewDockerCli(in io.ReadCloser, out, err io.Writer, clientFlags *cliflags.ClientFlags) *DockerCli {
cli := &DockerCli{
in: in,
out: out,
err: err,
keyFile: clientFlags.Common.TrustKey,
}
cli.init = func() error {
clientFlags.PostParse()
cli.configFile = LoadDefaultConfigFile(err)
client, err := NewAPIClientFromFlags(clientFlags, cli.configFile)
if err != nil {
return err
}
cli.client = client
if cli.in != nil {
cli.inFd, cli.isTerminalIn = term.GetFdInfo(cli.in)
}
if cli.out != nil {
cli.outFd, cli.isTerminalOut = term.GetFdInfo(cli.out)
}
return nil
}
return cli
}
// LoadDefaultConfigFile attempts to load the default config file and returns
// an initialized ConfigFile struct if none is found.
func LoadDefaultConfigFile(err io.Writer) *configfile.ConfigFile {
configFile, e := cliconfig.Load(cliconfig.ConfigDir())
if e != nil {
fmt.Fprintf(err, "WARNING: Error loading config file:%v\n", e)
}
if !configFile.ContainsAuth() {
credentials.DetectDefaultStore(configFile)
}
return configFile
}
// NewAPIClientFromFlags creates a new APIClient from command line flags
func NewAPIClientFromFlags(clientFlags *cliflags.ClientFlags, configFile *configfile.ConfigFile) (client.APIClient, error) {
host, err := getServerHost(clientFlags.Common.Hosts, clientFlags.Common.TLSOptions)
if err != nil {
return &client.Client{}, err
}
customHeaders := configFile.HTTPHeaders
if customHeaders == nil {
customHeaders = map[string]string{}
}
customHeaders["User-Agent"] = clientUserAgent()
verStr := api.DefaultVersion
if tmpStr := os.Getenv("DOCKER_API_VERSION"); tmpStr != "" {
verStr = tmpStr
}
httpClient, err := newHTTPClient(host, clientFlags.Common.TLSOptions)
if err != nil {
return &client.Client{}, err
}
return client.NewClient(host, verStr, httpClient, customHeaders)
}
func getServerHost(hosts []string, tlsOptions *tlsconfig.Options) (host string, err error) {
switch len(hosts) {
case 0:
host = os.Getenv("DOCKER_HOST")
case 1:
host = hosts[0]
default:
return "", errors.New("Please specify only one -H")
}
host, err = opts.ParseHost(tlsOptions != nil, host)
return
}
func newHTTPClient(host string, tlsOptions *tlsconfig.Options) (*http.Client, error) {
if tlsOptions == nil {
// let the api client configure the default transport.
return nil, nil
}
config, err := tlsconfig.Client(*tlsOptions)
if err != nil {
return nil, err
}
tr := &http.Transport{
TLSClientConfig: config,
}
proto, addr, _, err := client.ParseHost(host)
if err != nil {
return nil, err
}
sockets.ConfigureTransport(tr, proto, addr)
return &http.Client{
Transport: tr,
}, nil
}
func clientUserAgent() string {
return "Docker-Client/" + dockerversion.Version + " (" + runtime.GOOS + ")"
}

5
api/client/client.go Normal file
View file

@ -0,0 +1,5 @@
// Package client provides a command-line interface for Docker.
//
// Run "docker help SUBCOMMAND" or "docker SUBCOMMAND --help" to see more information on any Docker subcommand, including the full list of options supported for the subcommand.
// See https://docs.docker.com/installation/ for instructions on installing Docker.
package client

11
api/client/commands.go Normal file
View file

@ -0,0 +1,11 @@
package client
// Command returns a cli command handler if one exists
func (cli *DockerCli) Command(name string) func(...string) error {
return map[string]func(...string) error{
"exec": cli.CmdExec,
"info": cli.CmdInfo,
"inspect": cli.CmdInspect,
"update": cli.CmdUpdate,
}[name]
}

View file

@ -0,0 +1,129 @@
package container
import (
"fmt"
"io"
"net/http/httputil"
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/signal"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
type attachOptions struct {
noStdin bool
proxy bool
detachKeys string
container string
}
// NewAttachCommand creats a new cobra.Command for `docker attach`
func NewAttachCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts attachOptions
cmd := &cobra.Command{
Use: "attach [OPTIONS] CONTAINER",
Short: "Attach to a running container",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.container = args[0]
return runAttach(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.BoolVar(&opts.noStdin, "no-stdin", false, "Do not attach STDIN")
flags.BoolVar(&opts.proxy, "sig-proxy", true, "Proxy all received signals to the process")
flags.StringVar(&opts.detachKeys, "detach-keys", "", "Override the key sequence for detaching a container")
return cmd
}
func runAttach(dockerCli *client.DockerCli, opts *attachOptions) error {
ctx := context.Background()
c, err := dockerCli.Client().ContainerInspect(ctx, opts.container)
if err != nil {
return err
}
if !c.State.Running {
return fmt.Errorf("You cannot attach to a stopped container, start it first")
}
if c.State.Paused {
return fmt.Errorf("You cannot attach to a paused container, unpause it first")
}
if err := dockerCli.CheckTtyInput(!opts.noStdin, c.Config.Tty); err != nil {
return err
}
if opts.detachKeys != "" {
dockerCli.ConfigFile().DetachKeys = opts.detachKeys
}
options := types.ContainerAttachOptions{
Stream: true,
Stdin: !opts.noStdin && c.Config.OpenStdin,
Stdout: true,
Stderr: true,
DetachKeys: dockerCli.ConfigFile().DetachKeys,
}
var in io.ReadCloser
if options.Stdin {
in = dockerCli.In()
}
if opts.proxy && !c.Config.Tty {
sigc := dockerCli.ForwardAllSignals(ctx, opts.container)
defer signal.StopCatch(sigc)
}
resp, errAttach := dockerCli.Client().ContainerAttach(ctx, opts.container, options)
if errAttach != nil && errAttach != httputil.ErrPersistEOF {
// ContainerAttach returns an ErrPersistEOF (connection closed)
// means server met an error and put it in Hijacked connection
// keep the error and read detailed error message from hijacked connection later
return errAttach
}
defer resp.Close()
if c.Config.Tty && dockerCli.IsTerminalOut() {
height, width := dockerCli.GetTtySize()
// To handle the case where a user repeatedly attaches/detaches without resizing their
// terminal, the only way to get the shell prompt to display for attaches 2+ is to artificially
// resize it, then go back to normal. Without this, every attach after the first will
// require the user to manually resize or hit enter.
dockerCli.ResizeTtyTo(ctx, opts.container, height+1, width+1, false)
// After the above resizing occurs, the call to MonitorTtySize below will handle resetting back
// to the actual size.
if err := dockerCli.MonitorTtySize(ctx, opts.container, false); err != nil {
logrus.Debugf("Error monitoring TTY size: %s", err)
}
}
if err := dockerCli.HoldHijackedConnection(ctx, c.Config.Tty, in, dockerCli.Out(), dockerCli.Err(), resp); err != nil {
return err
}
if errAttach != nil {
return errAttach
}
_, status, err := getExitCode(dockerCli, ctx, opts.container)
if err != nil {
return err
}
if status != 0 {
return cli.StatusError{StatusCode: status}
}
return nil
}

View file

@ -0,0 +1,92 @@
package container
import (
"encoding/json"
"fmt"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
dockeropts "github.com/docker/docker/opts"
"github.com/docker/engine-api/types"
containertypes "github.com/docker/engine-api/types/container"
"github.com/spf13/cobra"
)
type commitOptions struct {
container string
reference string
pause bool
comment string
author string
changes dockeropts.ListOpts
config string
}
// NewCommitCommand creats a new cobra.Command for `docker commit`
func NewCommitCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts commitOptions
cmd := &cobra.Command{
Use: "commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]",
Short: "Create a new image from a container's changes",
Args: cli.RequiresRangeArgs(1, 2),
RunE: func(cmd *cobra.Command, args []string) error {
opts.container = args[0]
if len(args) > 1 {
opts.reference = args[1]
}
return runCommit(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.SetInterspersed(false)
flags.BoolVarP(&opts.pause, "pause", "p", true, "Pause container during commit")
flags.StringVarP(&opts.comment, "message", "m", "", "Commit message")
flags.StringVarP(&opts.author, "author", "a", "", "Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")")
opts.changes = dockeropts.NewListOpts(nil)
flags.VarP(&opts.changes, "change", "c", "Apply Dockerfile instruction to the created image")
// FIXME: --run is deprecated, it will be replaced with inline Dockerfile commands.
flags.StringVar(&opts.config, "run", "", "This option is deprecated and will be removed in a future version in favor of inline Dockerfile-compatible commands")
flags.MarkDeprecated("run", "it will be replaced with inline Dockerfile commands.")
return cmd
}
func runCommit(dockerCli *client.DockerCli, opts *commitOptions) error {
ctx := context.Background()
name := opts.container
reference := opts.reference
var config *containertypes.Config
if opts.config != "" {
config = &containertypes.Config{}
if err := json.Unmarshal([]byte(opts.config), config); err != nil {
return err
}
}
options := types.ContainerCommitOptions{
Reference: reference,
Comment: opts.comment,
Author: opts.author,
Changes: opts.changes.GetAll(),
Pause: opts.pause,
Config: config,
}
response, err := dockerCli.Client().ContainerCommit(ctx, name, options)
if err != nil {
return err
}
fmt.Fprintln(dockerCli.Out(), response.ID)
return nil
}

303
api/client/container/cp.go Normal file
View file

@ -0,0 +1,303 @@
package container
import (
"fmt"
"io"
"os"
"path/filepath"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/system"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
type copyOptions struct {
source string
destination string
followLink bool
}
type copyDirection int
const (
fromContainer copyDirection = (1 << iota)
toContainer
acrossContainers = fromContainer | toContainer
)
type cpConfig struct {
followLink bool
}
// NewCopyCommand creates a new `docker cp` command
func NewCopyCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts copyOptions
cmd := &cobra.Command{
Use: `cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
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",
"container source to stdout.",
}, ""),
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
if args[0] == "" {
return fmt.Errorf("source can not be empty")
}
if args[1] == "" {
return fmt.Errorf("destination can not be empty")
}
opts.source = args[0]
opts.destination = args[1]
return runCopy(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.followLink, "follow-link", "L", false, "Always follow symbol link in SRC_PATH")
return cmd
}
func runCopy(dockerCli *client.DockerCli, opts copyOptions) error {
srcContainer, srcPath := splitCpArg(opts.source)
dstContainer, dstPath := splitCpArg(opts.destination)
var direction copyDirection
if srcContainer != "" {
direction |= fromContainer
}
if dstContainer != "" {
direction |= toContainer
}
cpParam := &cpConfig{
followLink: opts.followLink,
}
ctx := context.Background()
switch direction {
case fromContainer:
return copyFromContainer(ctx, dockerCli, srcContainer, srcPath, dstPath, cpParam)
case toContainer:
return copyToContainer(ctx, dockerCli, srcPath, dstContainer, dstPath, cpParam)
case acrossContainers:
// Copying between containers isn't supported.
return fmt.Errorf("copying between containers is not supported")
default:
// User didn't specify any container.
return fmt.Errorf("must specify at least one container source")
}
}
func statContainerPath(ctx context.Context, dockerCli *client.DockerCli, containerName, path string) (types.ContainerPathStat, error) {
return dockerCli.Client().ContainerStatPath(ctx, containerName, path)
}
func resolveLocalPath(localPath string) (absPath string, err error) {
if absPath, err = filepath.Abs(localPath); err != nil {
return
}
return archive.PreserveTrailingDotOrSeparator(absPath, localPath), nil
}
func copyFromContainer(ctx context.Context, dockerCli *client.DockerCli, srcContainer, srcPath, dstPath string, cpParam *cpConfig) (err error) {
if dstPath != "-" {
// Get an absolute destination path.
dstPath, err = resolveLocalPath(dstPath)
if err != nil {
return err
}
}
// if client requests to follow symbol link, then must decide target file to be copied
var rebaseName string
if cpParam.followLink {
srcStat, err := statContainerPath(ctx, dockerCli, srcContainer, srcPath)
// If the destination is a symbolic link, we should follow it.
if err == nil && srcStat.Mode&os.ModeSymlink != 0 {
linkTarget := srcStat.LinkTarget
if !system.IsAbs(linkTarget) {
// Join with the parent directory.
srcParent, _ := archive.SplitPathDirEntry(srcPath)
linkTarget = filepath.Join(srcParent, linkTarget)
}
linkTarget, rebaseName = archive.GetRebaseName(srcPath, linkTarget)
srcPath = linkTarget
}
}
content, stat, err := dockerCli.Client().CopyFromContainer(ctx, srcContainer, srcPath)
if err != nil {
return err
}
defer content.Close()
if dstPath == "-" {
// Send the response to STDOUT.
_, err = io.Copy(os.Stdout, content)
return err
}
// Prepare source copy info.
srcInfo := archive.CopyInfo{
Path: srcPath,
Exists: true,
IsDir: stat.Mode.IsDir(),
RebaseName: rebaseName,
}
preArchive := content
if len(srcInfo.RebaseName) != 0 {
_, srcBase := archive.SplitPathDirEntry(srcInfo.Path)
preArchive = archive.RebaseArchiveEntries(content, srcBase, srcInfo.RebaseName)
}
// See comments in the implementation of `archive.CopyTo` for exactly what
// goes into deciding how and whether the source archive needs to be
// altered for the correct copy behavior.
return archive.CopyTo(preArchive, srcInfo, dstPath)
}
func copyToContainer(ctx context.Context, dockerCli *client.DockerCli, srcPath, dstContainer, dstPath string, cpParam *cpConfig) (err error) {
if srcPath != "-" {
// Get an absolute source path.
srcPath, err = resolveLocalPath(srcPath)
if err != nil {
return err
}
}
// In order to get the copy behavior right, we need to know information
// about both the source and destination. The API is a simple tar
// archive/extract API but we can use the stat info header about the
// destination to be more informed about exactly what the destination is.
// Prepare destination copy info by stat-ing the container path.
dstInfo := archive.CopyInfo{Path: dstPath}
dstStat, err := statContainerPath(ctx, dockerCli, dstContainer, dstPath)
// If the destination is a symbolic link, we should evaluate it.
if err == nil && dstStat.Mode&os.ModeSymlink != 0 {
linkTarget := dstStat.LinkTarget
if !system.IsAbs(linkTarget) {
// Join with the parent directory.
dstParent, _ := archive.SplitPathDirEntry(dstPath)
linkTarget = filepath.Join(dstParent, linkTarget)
}
dstInfo.Path = linkTarget
dstStat, err = statContainerPath(ctx, dockerCli, dstContainer, linkTarget)
}
// Ignore any error and assume that the parent directory of the destination
// path exists, in which case the copy may still succeed. If there is any
// type of conflict (e.g., non-directory overwriting an existing directory
// or vice versa) the extraction will fail. If the destination simply did
// not exist, but the parent directory does, the extraction will still
// succeed.
if err == nil {
dstInfo.Exists, dstInfo.IsDir = true, dstStat.Mode.IsDir()
}
var (
content io.Reader
resolvedDstPath string
)
if srcPath == "-" {
// Use STDIN.
content = os.Stdin
resolvedDstPath = dstInfo.Path
if !dstInfo.IsDir {
return fmt.Errorf("destination %q must be a directory", fmt.Sprintf("%s:%s", dstContainer, dstPath))
}
} else {
// Prepare source copy info.
srcInfo, err := archive.CopyInfoSourcePath(srcPath, cpParam.followLink)
if err != nil {
return err
}
srcArchive, err := archive.TarResource(srcInfo)
if err != nil {
return err
}
defer srcArchive.Close()
// With the stat info about the local source as well as the
// destination, we have enough information to know whether we need to
// alter the archive that we upload so that when the server extracts
// it to the specified directory in the container we get the desired
// copy behavior.
// See comments in the implementation of `archive.PrepareArchiveCopy`
// for exactly what goes into deciding how and whether the source
// archive needs to be altered for the correct copy behavior when it is
// extracted. This function also infers from the source and destination
// info which directory to extract to, which may be the parent of the
// destination that the user specified.
dstDir, preparedArchive, err := archive.PrepareArchiveCopy(srcArchive, srcInfo, dstInfo)
if err != nil {
return err
}
defer preparedArchive.Close()
resolvedDstPath = dstDir
content = preparedArchive
}
options := types.CopyToContainerOptions{
AllowOverwriteDirWithFile: false,
}
return dockerCli.Client().CopyToContainer(ctx, dstContainer, resolvedDstPath, content, options)
}
// We use `:` as a delimiter between CONTAINER and PATH, but `:` could also be
// in a valid LOCALPATH, like `file:name.txt`. We can resolve this ambiguity by
// requiring a LOCALPATH with a `:` to be made explicit with a relative or
// absolute path:
// `/path/to/file:name.txt` or `./file:name.txt`
//
// This is apparently how `scp` handles this as well:
// http://www.cyberciti.biz/faq/rsync-scp-file-name-with-colon-punctuation-in-it/
//
// We can't simply check for a filepath separator because container names may
// have a separator, e.g., "host0/cname1" if container is in a Docker cluster,
// so we have to check for a `/` or `.` prefix. Also, in the case of a Windows
// client, a `:` could be part of an absolute Windows path, in which case it
// is immediately proceeded by a backslash.
func splitCpArg(arg string) (container, path string) {
if system.IsAbs(arg) {
// Explicit local absolute path, e.g., `C:\foo` or `/foo`.
return "", arg
}
parts := strings.SplitN(arg, ":", 2)
if len(parts) == 1 || strings.HasPrefix(parts[0], ".") {
// Either there's no `:` in the arg
// OR it's an explicit local relative path like `./file:name.txt`.
return "", arg
}
return parts[0], parts[1]
}

View file

@ -0,0 +1,217 @@
package container
import (
"fmt"
"io"
"os"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/jsonmessage"
// FIXME migrate to docker/distribution/reference
"github.com/docker/docker/reference"
"github.com/docker/docker/registry"
runconfigopts "github.com/docker/docker/runconfig/opts"
apiclient "github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
networktypes "github.com/docker/engine-api/types/network"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
type createOptions struct {
name string
}
// NewCreateCommand creats a new cobra.Command for `docker create`
func NewCreateCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts createOptions
var copts *runconfigopts.ContainerOptions
cmd := &cobra.Command{
Use: "create [OPTIONS] IMAGE [COMMAND] [ARG...]",
Short: "Create a new container",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
copts.Image = args[0]
if len(args) > 1 {
copts.Args = args[1:]
}
return runCreate(dockerCli, cmd.Flags(), &opts, copts)
},
}
flags := cmd.Flags()
flags.SetInterspersed(false)
flags.StringVar(&opts.name, "name", "", "Assign a name to the container")
// Add an explicit help that doesn't have a `-h` to prevent the conflict
// with hostname
flags.Bool("help", false, "Print usage")
client.AddTrustedFlags(flags, true)
copts = runconfigopts.AddFlags(flags)
return cmd
}
func runCreate(dockerCli *client.DockerCli, flags *pflag.FlagSet, opts *createOptions, copts *runconfigopts.ContainerOptions) error {
config, hostConfig, networkingConfig, err := runconfigopts.Parse(flags, copts)
if err != nil {
reportError(dockerCli.Err(), "create", err.Error(), true)
return cli.StatusError{StatusCode: 125}
}
response, err := createContainer(context.Background(), dockerCli, config, hostConfig, networkingConfig, hostConfig.ContainerIDFile, opts.name)
if err != nil {
return err
}
fmt.Fprintf(dockerCli.Out(), "%s\n", response.ID)
return nil
}
func pullImage(ctx context.Context, dockerCli *client.DockerCli, image string, out io.Writer) error {
ref, err := reference.ParseNamed(image)
if err != nil {
return err
}
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(ref)
if err != nil {
return err
}
authConfig := dockerCli.ResolveAuthConfig(ctx, repoInfo.Index)
encodedAuth, err := client.EncodeAuthToBase64(authConfig)
if err != nil {
return err
}
options := types.ImageCreateOptions{
RegistryAuth: encodedAuth,
}
responseBody, err := dockerCli.Client().ImageCreate(ctx, image, options)
if err != nil {
return err
}
defer responseBody.Close()
return jsonmessage.DisplayJSONMessagesStream(
responseBody,
out,
dockerCli.OutFd(),
dockerCli.IsTerminalOut(),
nil)
}
type cidFile struct {
path string
file *os.File
written bool
}
func (cid *cidFile) Close() error {
cid.file.Close()
if !cid.written {
if err := os.Remove(cid.path); err != nil {
return fmt.Errorf("failed to remove the CID file '%s': %s \n", cid.path, err)
}
}
return nil
}
func (cid *cidFile) Write(id string) error {
if _, err := cid.file.Write([]byte(id)); err != nil {
return fmt.Errorf("Failed to write the container ID to the file: %s", err)
}
cid.written = true
return nil
}
func newCIDFile(path string) (*cidFile, error) {
if _, err := os.Stat(path); err == nil {
return nil, fmt.Errorf("Container ID file found, make sure the other container isn't running or delete %s", path)
}
f, err := os.Create(path)
if err != nil {
return nil, fmt.Errorf("Failed to create the container ID file: %s", err)
}
return &cidFile{path: path, file: f}, nil
}
func createContainer(ctx context.Context, dockerCli *client.DockerCli, config *container.Config, hostConfig *container.HostConfig, networkingConfig *networktypes.NetworkingConfig, cidfile, name string) (*types.ContainerCreateResponse, error) {
stderr := dockerCli.Err()
var containerIDFile *cidFile
if cidfile != "" {
var err error
if containerIDFile, err = newCIDFile(cidfile); err != nil {
return nil, err
}
defer containerIDFile.Close()
}
var trustedRef reference.Canonical
_, ref, err := reference.ParseIDOrReference(config.Image)
if err != nil {
return nil, err
}
if ref != nil {
ref = reference.WithDefaultTag(ref)
if ref, ok := ref.(reference.NamedTagged); ok && client.IsTrusted() {
var err error
trustedRef, err = dockerCli.TrustedReference(ctx, ref)
if err != nil {
return nil, err
}
config.Image = trustedRef.String()
}
}
//create the container
response, err := dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, name)
//if image not found try to pull it
if err != nil {
if apiclient.IsErrImageNotFound(err) && ref != nil {
fmt.Fprintf(stderr, "Unable to find image '%s' locally\n", ref.String())
// we don't want to write to stdout anything apart from container.ID
if err = pullImage(ctx, dockerCli, config.Image, stderr); err != nil {
return nil, err
}
if ref, ok := ref.(reference.NamedTagged); ok && trustedRef != nil {
if err := dockerCli.TagTrusted(ctx, trustedRef, ref); err != nil {
return nil, err
}
}
// Retry
var retryErr error
response, retryErr = dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, name)
if retryErr != nil {
return nil, retryErr
}
} else {
return nil, err
}
}
for _, warning := range response.Warnings {
fmt.Fprintf(stderr, "WARNING: %s\n", warning)
}
if containerIDFile != nil {
if err = containerIDFile.Write(response.ID); err != nil {
return nil, err
}
}
return &response, nil
}

View file

@ -0,0 +1,60 @@
package container
import (
"fmt"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/archive"
"github.com/spf13/cobra"
)
type diffOptions struct {
container string
}
// NewDiffCommand creates a new cobra.Command for `docker diff`
func NewDiffCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts diffOptions
cmd := &cobra.Command{
Use: "diff CONTAINER",
Short: "Inspect changes on a container's filesystem",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.container = args[0]
return runDiff(dockerCli, &opts)
},
}
return cmd
}
func runDiff(dockerCli *client.DockerCli, opts *diffOptions) error {
if opts.container == "" {
return fmt.Errorf("Container name cannot be empty")
}
ctx := context.Background()
changes, err := dockerCli.Client().ContainerDiff(ctx, opts.container)
if err != nil {
return err
}
for _, change := range changes {
var kind string
switch change.Kind {
case archive.ChangeModify:
kind = "C"
case archive.ChangeAdd:
kind = "A"
case archive.ChangeDelete:
kind = "D"
}
fmt.Fprintf(dockerCli.Out(), "%s %s\n", kind, change.Path)
}
return nil
}

View file

@ -0,0 +1,59 @@
package container
import (
"errors"
"io"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type exportOptions struct {
container string
output string
}
// NewExportCommand creates a new `docker export` command
func NewExportCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts exportOptions
cmd := &cobra.Command{
Use: "export [OPTIONS] CONTAINER",
Short: "Export a container's filesystem as a tar archive",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.container = args[0]
return runExport(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.StringVarP(&opts.output, "output", "o", "", "Write to a file, instead of STDOUT")
return cmd
}
func runExport(dockerCli *client.DockerCli, opts exportOptions) error {
if opts.output == "" && dockerCli.IsTerminalOut() {
return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
}
clnt := dockerCli.Client()
responseBody, err := clnt.ContainerExport(context.Background(), opts.container)
if err != nil {
return err
}
defer responseBody.Close()
if opts.output == "" {
_, err := io.Copy(dockerCli.Out(), responseBody)
return err
}
return client.CopyToFile(opts.output, responseBody)
}

View file

@ -0,0 +1,53 @@
package container
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type killOptions struct {
signal string
containers []string
}
// NewKillCommand creats a new cobra.Command for `docker kill`
func NewKillCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts killOptions
cmd := &cobra.Command{
Use: "kill [OPTIONS] CONTAINER [CONTAINER...]",
Short: "Kill one or more running containers",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runKill(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.StringVarP(&opts.signal, "signal", "s", "KILL", "Signal to send to the container")
return cmd
}
func runKill(dockerCli *client.DockerCli, opts *killOptions) error {
var errs []string
ctx := context.Background()
for _, name := range opts.containers {
if err := dockerCli.Client().ContainerKill(ctx, name, opts.signal); err != nil {
errs = append(errs, err.Error())
} else {
fmt.Fprintf(dockerCli.Out(), "%s\n", name)
}
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, "\n"))
}
return nil
}

View file

@ -0,0 +1,87 @@
package container
import (
"fmt"
"io"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
var validDrivers = map[string]bool{
"json-file": true,
"journald": true,
}
type logsOptions struct {
follow bool
since string
timestamps bool
details bool
tail string
container string
}
// NewLogsCommand creats a new cobra.Command for `docker logs`
func NewLogsCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts logsOptions
cmd := &cobra.Command{
Use: "logs [OPTIONS] CONTAINER",
Short: "Fetch the logs of a container",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.container = args[0]
return runLogs(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output")
flags.StringVar(&opts.since, "since", "", "Show logs since timestamp")
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps")
flags.BoolVar(&opts.details, "details", false, "Show extra details provided to logs")
flags.StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs")
return cmd
}
func runLogs(dockerCli *client.DockerCli, opts *logsOptions) error {
ctx := context.Background()
c, err := dockerCli.Client().ContainerInspect(ctx, opts.container)
if err != nil {
return err
}
if !validDrivers[c.HostConfig.LogConfig.Type] {
return fmt.Errorf("\"logs\" command is supported only for \"json-file\" and \"journald\" logging drivers (got: %s)", c.HostConfig.LogConfig.Type)
}
options := types.ContainerLogsOptions{
ShowStdout: true,
ShowStderr: true,
Since: opts.since,
Timestamps: opts.timestamps,
Follow: opts.follow,
Tail: opts.tail,
Details: opts.details,
}
responseBody, err := dockerCli.Client().ContainerLogs(ctx, opts.container, options)
if err != nil {
return err
}
defer responseBody.Close()
if c.Config.Tty {
_, err = io.Copy(dockerCli.Out(), responseBody)
} else {
_, err = stdcopy.StdCopy(dockerCli.Out(), dockerCli.Err(), responseBody)
}
return err
}

View file

@ -0,0 +1,50 @@
package container
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type pauseOptions struct {
containers []string
}
// NewPauseCommand creats a new cobra.Command for `docker pause`
func NewPauseCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts pauseOptions
cmd := &cobra.Command{
Use: "pause CONTAINER [CONTAINER...]",
Short: "Pause all processes within one or more containers",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runPause(dockerCli, &opts)
},
}
return cmd
}
func runPause(dockerCli *client.DockerCli, opts *pauseOptions) error {
ctx := context.Background()
var errs []string
for _, container := range opts.containers {
if err := dockerCli.Client().ContainerPause(ctx, container); err != nil {
errs = append(errs, err.Error())
} else {
fmt.Fprintf(dockerCli.Out(), "%s\n", container)
}
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, "\n"))
}
return nil
}

View file

@ -0,0 +1,79 @@
package container
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/go-connections/nat"
"github.com/spf13/cobra"
)
type portOptions struct {
container string
port string
}
// NewPortCommand creats a new cobra.Command for `docker port`
func NewPortCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts portOptions
cmd := &cobra.Command{
Use: "port CONTAINER [PRIVATE_PORT[/PROTO]]",
Short: "List port mappings or a specific mapping for the container",
Args: cli.RequiresRangeArgs(1, 2),
RunE: func(cmd *cobra.Command, args []string) error {
opts.container = args[0]
if len(args) > 1 {
opts.port = args[1]
}
return runPort(dockerCli, &opts)
},
}
return cmd
}
func runPort(dockerCli *client.DockerCli, opts *portOptions) error {
ctx := context.Background()
c, err := dockerCli.Client().ContainerInspect(ctx, opts.container)
if err != nil {
return err
}
if opts.port != "" {
port := opts.port
proto := "tcp"
parts := strings.SplitN(port, "/", 2)
if len(parts) == 2 && len(parts[1]) != 0 {
port = parts[0]
proto = parts[1]
}
natPort := port + "/" + proto
newP, err := nat.NewPort(proto, port)
if err != nil {
return err
}
if frontends, exists := c.NetworkSettings.Ports[newP]; exists && frontends != nil {
for _, frontend := range frontends {
fmt.Fprintf(dockerCli.Out(), "%s:%s\n", frontend.HostIP, frontend.HostPort)
}
return nil
}
return fmt.Errorf("Error: No public port '%s' published for %s", natPort, opts.container)
}
for from, frontends := range c.NetworkSettings.Ports {
for _, frontend := range frontends {
fmt.Fprintf(dockerCli.Out(), "%s -> %s:%s\n", from, frontend.HostIP, frontend.HostPort)
}
}
return nil
}

125
api/client/container/ps.go Normal file
View file

@ -0,0 +1,125 @@
package container
import (
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/api/client/formatter"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/docker/docker/utils/templates"
"github.com/spf13/cobra"
"io/ioutil"
)
type psOptions struct {
quiet bool
size bool
all bool
noTrunc bool
nLatest bool
last int
format string
filter []string
}
type preProcessor struct {
opts *types.ContainerListOptions
}
// Size sets the size option when called by a template execution.
func (p *preProcessor) Size() bool {
p.opts.Size = true
return true
}
// NewPsCommand creates a new cobra.Command for `docker ps`
func NewPsCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts psOptions
cmd := &cobra.Command{
Use: "ps [OPTIONS]",
Short: "List containers",
Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return runPs(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Only display numeric IDs")
flags.BoolVarP(&opts.size, "size", "s", false, "Display total file sizes")
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, "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")
return cmd
}
func runPs(dockerCli *client.DockerCli, opts *psOptions) error {
ctx := context.Background()
if opts.nLatest && opts.last == -1 {
opts.last = 1
}
containerFilterArgs := filters.NewArgs()
for _, f := range opts.filter {
var err error
containerFilterArgs, err = filters.ParseFlag(f, containerFilterArgs)
if err != nil {
return err
}
}
options := types.ContainerListOptions{
All: opts.all,
Limit: opts.last,
Size: opts.size,
Filter: containerFilterArgs,
}
pre := &preProcessor{opts: &options}
tmpl, err := templates.Parse(opts.format)
if err != nil {
return err
}
_ = tmpl.Execute(ioutil.Discard, pre)
containers, err := dockerCli.Client().ContainerList(ctx, options)
if err != nil {
return err
}
f := opts.format
if len(f) == 0 {
if len(dockerCli.PsFormat()) > 0 && !opts.quiet {
f = dockerCli.PsFormat()
} else {
f = "table"
}
}
psCtx := formatter.ContainerContext{
Context: formatter.Context{
Output: dockerCli.Out(),
Format: f,
Quiet: opts.quiet,
Trunc: !opts.noTrunc,
},
Size: opts.size,
Containers: containers,
}
psCtx.Write()
return nil
}

View file

@ -0,0 +1,52 @@
package container
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type renameOptions struct {
oldName string
newName string
}
// NewRenameCommand creats a new cobra.Command for `docker rename`
func NewRenameCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts renameOptions
cmd := &cobra.Command{
Use: "rename CONTAINER NEW_NAME",
Short: "Rename a container",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
opts.oldName = args[0]
opts.newName = args[1]
return runRename(dockerCli, &opts)
},
}
return cmd
}
func runRename(dockerCli *client.DockerCli, opts *renameOptions) error {
ctx := context.Background()
oldName := strings.TrimSpace(opts.oldName)
newName := strings.TrimSpace(opts.newName)
if oldName == "" || newName == "" {
return fmt.Errorf("Error: Neither old nor new names may be empty")
}
if err := dockerCli.Client().ContainerRename(ctx, oldName, newName); err != nil {
fmt.Fprintf(dockerCli.Err(), "%s\n", err)
return fmt.Errorf("Error: failed to rename container named %s", oldName)
}
return nil
}

View file

@ -0,0 +1,55 @@
package container
import (
"fmt"
"strings"
"time"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type restartOptions struct {
nSeconds int
containers []string
}
// NewRestartCommand creates a new cobra.Command for `docker restart`
func NewRestartCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts restartOptions
cmd := &cobra.Command{
Use: "restart [OPTIONS] CONTAINER [CONTAINER...]",
Short: "Restart a container",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runRestart(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.IntVarP(&opts.nSeconds, "time", "t", 10, "Seconds to wait for stop before killing the container")
return cmd
}
func runRestart(dockerCli *client.DockerCli, opts *restartOptions) error {
ctx := context.Background()
var errs []string
for _, name := range opts.containers {
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)
}
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, "\n"))
}
return nil
}

View file

@ -0,0 +1,76 @@
package container
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
type rmOptions struct {
rmVolumes bool
rmLink bool
force bool
containers []string
}
// NewRmCommand creates a new cobra.Command for `docker rm`
func NewRmCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts rmOptions
cmd := &cobra.Command{
Use: "rm [OPTIONS] CONTAINER [CONTAINER...]",
Short: "Remove one or more containers",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runRm(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.rmVolumes, "volumes", "v", false, "Remove the volumes associated with the container")
flags.BoolVarP(&opts.rmLink, "link", "l", false, "Remove the specified link")
flags.BoolVarP(&opts.force, "force", "f", false, "Force the removal of a running container (uses SIGKILL)")
return cmd
}
func runRm(dockerCli *client.DockerCli, opts *rmOptions) error {
ctx := context.Background()
var errs []string
for _, name := range opts.containers {
if name == "" {
return fmt.Errorf("Container name cannot be empty")
}
name = strings.Trim(name, "/")
if err := removeContainer(dockerCli, ctx, name, opts.rmVolumes, opts.rmLink, opts.force); err != nil {
errs = append(errs, err.Error())
} else {
fmt.Fprintf(dockerCli.Out(), "%s\n", name)
}
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, "\n"))
}
return nil
}
func removeContainer(dockerCli *client.DockerCli, ctx context.Context, container string, removeVolumes, removeLinks, force bool) error {
options := types.ContainerRemoveOptions{
RemoveVolumes: removeVolumes,
RemoveLinks: removeLinks,
Force: force,
}
if err := dockerCli.Client().ContainerRemove(ctx, container, options); err != nil {
return err
}
return nil
}

326
api/client/container/run.go Normal file
View file

@ -0,0 +1,326 @@
package container
import (
"fmt"
"io"
"net/http/httputil"
"os"
"runtime"
"strings"
"syscall"
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
opttypes "github.com/docker/docker/opts"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/signal"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/engine-api/types"
"github.com/docker/libnetwork/resolvconf/dns"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
const (
errCmdNotFound = "not found or does not exist"
errCmdCouldNotBeInvoked = "could not be invoked"
)
type runOptions struct {
autoRemove bool
detach bool
sigProxy bool
name string
detachKeys string
}
// NewRunCommand create a new `docker run` command
func NewRunCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts runOptions
var copts *runconfigopts.ContainerOptions
cmd := &cobra.Command{
Use: "run [OPTIONS] IMAGE [COMMAND] [ARG...]",
Short: "Run a command in a new container",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
copts.Image = args[0]
if len(args) > 1 {
copts.Args = args[1:]
}
return runRun(dockerCli, cmd.Flags(), &opts, copts)
},
}
flags := cmd.Flags()
flags.SetInterspersed(false)
// These are flags not stored in Config/HostConfig
flags.BoolVar(&opts.autoRemove, "rm", false, "Automatically remove the container when it exits")
flags.BoolVarP(&opts.detach, "detach", "d", false, "Run container in background and print container ID")
flags.BoolVar(&opts.sigProxy, "sig-proxy", true, "Proxy received signals to the process")
flags.StringVar(&opts.name, "name", "", "Assign a name to the container")
flags.StringVar(&opts.detachKeys, "detach-keys", "", "Override the key sequence for detaching a container")
// Add an explicit help that doesn't have a `-h` to prevent the conflict
// with hostname
flags.Bool("help", false, "Print usage")
client.AddTrustedFlags(flags, true)
copts = runconfigopts.AddFlags(flags)
return cmd
}
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()
// TODO: pass this as an argument
cmdPath := "run"
var (
flAttach *opttypes.ListOpts
ErrConflictAttachDetach = fmt.Errorf("Conflicting options: -a and -d")
ErrConflictRestartPolicyAndAutoRemove = fmt.Errorf("Conflicting options: --restart and --rm")
ErrConflictDetachAutoRemove = fmt.Errorf("Conflicting options: --rm and -d")
)
config, hostConfig, networkingConfig, err := runconfigopts.Parse(flags, copts)
// just in case the Parse does not exit
if err != nil {
reportError(stderr, cmdPath, err.Error(), true)
return cli.StatusError{StatusCode: 125}
}
if hostConfig.OomKillDisable != nil && *hostConfig.OomKillDisable && hostConfig.Memory == 0 {
fmt.Fprintf(stderr, "WARNING: Disabling the OOM killer on containers without setting a '-m/--memory' limit may be dangerous.\n")
}
if len(hostConfig.DNS) > 0 {
// check the DNS settings passed via --dns against
// localhost regexp to warn if they are trying to
// set a DNS to a localhost address
for _, dnsIP := range hostConfig.DNS {
if dns.IsLocalhost(dnsIP) {
fmt.Fprintf(stderr, "WARNING: Localhost DNS setting (--dns=%s) may fail in containers.\n", dnsIP)
break
}
}
}
config.ArgsEscaped = false
if !opts.detach {
if err := dockerCli.CheckTtyInput(config.AttachStdin, config.Tty); err != nil {
return err
}
} else {
if fl := flags.Lookup("attach"); fl != nil {
flAttach = fl.Value.(*opttypes.ListOpts)
if flAttach.Len() != 0 {
return ErrConflictAttachDetach
}
}
if opts.autoRemove {
return ErrConflictDetachAutoRemove
}
config.AttachStdin = false
config.AttachStdout = false
config.AttachStderr = false
config.StdinOnce = false
}
// Disable sigProxy when in TTY mode
if config.Tty {
opts.sigProxy = false
}
// Telling the Windows daemon the initial size of the tty during start makes
// a far better user experience rather than relying on subsequent resizes
// to cause things to catch up.
if runtime.GOOS == "windows" {
hostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = dockerCli.GetTtySize()
}
ctx, cancelFun := context.WithCancel(context.Background())
createResponse, err := createContainer(ctx, dockerCli, config, hostConfig, networkingConfig, hostConfig.ContainerIDFile, opts.name)
if err != nil {
reportError(stderr, cmdPath, err.Error(), true)
return runStartContainerErr(err)
}
if opts.sigProxy {
sigc := dockerCli.ForwardAllSignals(ctx, createResponse.ID)
defer signal.StopCatch(sigc)
}
var (
waitDisplayID chan struct{}
errCh chan error
)
if !config.AttachStdout && !config.AttachStderr {
// Make this asynchronous to allow the client to write to stdin before having to read the ID
waitDisplayID = make(chan struct{})
go func() {
defer close(waitDisplayID)
fmt.Fprintf(stdout, "%s\n", createResponse.ID)
}()
}
if opts.autoRemove && (hostConfig.RestartPolicy.IsAlways() || hostConfig.RestartPolicy.IsOnFailure()) {
return ErrConflictRestartPolicyAndAutoRemove
}
attach := config.AttachStdin || config.AttachStdout || config.AttachStderr
if attach {
var (
out, cerr io.Writer
in io.ReadCloser
)
if config.AttachStdin {
in = stdin
}
if config.AttachStdout {
out = stdout
}
if config.AttachStderr {
if config.Tty {
cerr = stdout
} else {
cerr = stderr
}
}
if opts.detachKeys != "" {
dockerCli.ConfigFile().DetachKeys = opts.detachKeys
}
options := types.ContainerAttachOptions{
Stream: true,
Stdin: config.AttachStdin,
Stdout: config.AttachStdout,
Stderr: config.AttachStderr,
DetachKeys: dockerCli.ConfigFile().DetachKeys,
}
resp, errAttach := client.ContainerAttach(ctx, createResponse.ID, options)
if errAttach != nil && errAttach != httputil.ErrPersistEOF {
// ContainerAttach returns an ErrPersistEOF (connection closed)
// means server met an error and put it in Hijacked connection
// keep the error and read detailed error message from hijacked connection later
return errAttach
}
defer resp.Close()
errCh = promise.Go(func() error {
errHijack := dockerCli.HoldHijackedConnection(ctx, config.Tty, in, out, cerr, resp)
if errHijack == nil {
return errAttach
}
return errHijack
})
}
if opts.autoRemove {
defer func() {
// Explicitly not sharing the context as it could be "Done" (by calling cancelFun)
// and thus the container would not be removed.
if err := removeContainer(dockerCli, context.Background(), createResponse.ID, true, false, true); err != nil {
fmt.Fprintf(stderr, "%v\n", err)
}
}()
}
//start the container
if err := client.ContainerStart(ctx, createResponse.ID, types.ContainerStartOptions{}); err != nil {
// If we have holdHijackedConnection, we should notify
// holdHijackedConnection we are going to exit and wait
// to avoid the terminal are not restored.
if attach {
cancelFun()
<-errCh
}
reportError(stderr, cmdPath, err.Error(), false)
return runStartContainerErr(err)
}
if (config.AttachStdin || config.AttachStdout || config.AttachStderr) && config.Tty && dockerCli.IsTerminalOut() {
if err := dockerCli.MonitorTtySize(ctx, createResponse.ID, false); err != nil {
fmt.Fprintf(stderr, "Error monitoring TTY size: %s\n", err)
}
}
if errCh != nil {
if err := <-errCh; err != nil {
logrus.Debugf("Error hijack: %s", err)
return err
}
}
// Detached mode: wait for the id to be displayed and return.
if !config.AttachStdout && !config.AttachStderr {
// Detached mode
<-waitDisplayID
return nil
}
var status int
// Attached mode
if opts.autoRemove {
// Autoremove: wait for the container to finish, retrieve
// the exit code and remove the container
if status, err = client.ContainerWait(ctx, createResponse.ID); err != nil {
return runStartContainerErr(err)
}
if _, status, err = getExitCode(dockerCli, ctx, createResponse.ID); err != nil {
return err
}
} else {
// No Autoremove: Simply retrieve the exit code
if !config.Tty && hostConfig.RestartPolicy.IsNone() {
// In non-TTY mode, we can't detach, so we must wait for container exit
if status, err = client.ContainerWait(ctx, createResponse.ID); err != nil {
return err
}
} else {
// In TTY mode, there is a race: if the process dies too slowly, the state could
// be updated after the getExitCode call and result in the wrong exit code being reported
if _, status, err = getExitCode(dockerCli, ctx, createResponse.ID); err != nil {
return err
}
}
}
if status != 0 {
return cli.StatusError{StatusCode: status}
}
return nil
}
// reportError is a utility method that prints a user-friendly message
// containing the error that occurred during parsing and a suggestion to get help
func reportError(stderr io.Writer, name string, str string, withHelp bool) {
if withHelp {
str += ".\nSee '" + os.Args[0] + " " + name + " --help'"
}
fmt.Fprintf(stderr, "%s: %s.\n", os.Args[0], str)
}
// if container start fails with 'not found'/'no such' error, return 127
// if container start fails with 'permission denied' error, return 126
// return 125 for generic docker daemon failures
func runStartContainerErr(err error) error {
trimmedErr := strings.TrimPrefix(err.Error(), "Error response from daemon: ")
statusError := cli.StatusError{StatusCode: 125}
if strings.Contains(trimmedErr, "executable file not found") ||
strings.Contains(trimmedErr, "no such file or directory") ||
strings.Contains(trimmedErr, "system cannot find the file specified") {
statusError = cli.StatusError{StatusCode: 127}
} else if strings.Contains(trimmedErr, syscall.EACCES.Error()) {
statusError = cli.StatusError{StatusCode: 126}
}
return statusError
}

View file

@ -0,0 +1,152 @@
package container
import (
"fmt"
"io"
"net/http/httputil"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/signal"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
type startOptions struct {
attach bool
openStdin bool
detachKeys string
containers []string
}
// NewStartCommand creats a new cobra.Command for `docker start`
func NewStartCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts startOptions
cmd := &cobra.Command{
Use: "start [OPTIONS] CONTAINER [CONTAINER...]",
Short: "Start one or more stopped containers",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runStart(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.attach, "attach", "a", false, "Attach STDOUT/STDERR and forward signals")
flags.BoolVarP(&opts.openStdin, "interactive", "i", false, "Attach container's STDIN")
flags.StringVar(&opts.detachKeys, "detach-keys", "", "Override the key sequence for detaching a container")
return cmd
}
func runStart(dockerCli *client.DockerCli, opts *startOptions) error {
ctx, cancelFun := context.WithCancel(context.Background())
if opts.attach || opts.openStdin {
// We're going to attach to a container.
// 1. Ensure we only have one container.
if len(opts.containers) > 1 {
return fmt.Errorf("You cannot start and attach multiple containers at once.")
}
// 2. Attach to the container.
container := opts.containers[0]
c, err := dockerCli.Client().ContainerInspect(ctx, container)
if err != nil {
return err
}
// We always use c.ID instead of container to maintain consistency during `docker start`
if !c.Config.Tty {
sigc := dockerCli.ForwardAllSignals(ctx, c.ID)
defer signal.StopCatch(sigc)
}
if opts.detachKeys != "" {
dockerCli.ConfigFile().DetachKeys = opts.detachKeys
}
options := types.ContainerAttachOptions{
Stream: true,
Stdin: opts.openStdin && c.Config.OpenStdin,
Stdout: true,
Stderr: true,
DetachKeys: dockerCli.ConfigFile().DetachKeys,
}
var in io.ReadCloser
if options.Stdin {
in = dockerCli.In()
}
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
// keep the error and read detailed error message from hijacked connection
return errAttach
}
defer resp.Close()
cErr := promise.Go(func() error {
errHijack := dockerCli.HoldHijackedConnection(ctx, c.Config.Tty, in, dockerCli.Out(), dockerCli.Err(), resp)
if errHijack == nil {
return errAttach
}
return errHijack
})
// 3. Start the container.
if err := dockerCli.Client().ContainerStart(ctx, c.ID, types.ContainerStartOptions{}); err != nil {
cancelFun()
<-cErr
return err
}
// 4. Wait for attachment to break.
if c.Config.Tty && dockerCli.IsTerminalOut() {
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, c.ID)
if err != nil {
return err
}
if status != 0 {
return cli.StatusError{StatusCode: status}
}
} else {
// We're not going to attach to anything.
// Start as many containers as we want.
return startContainersWithoutAttachments(dockerCli, ctx, opts.containers)
}
return nil
}
func startContainersWithoutAttachments(dockerCli *client.DockerCli, ctx context.Context, containers []string) error {
var failedContainers []string
for _, container := range containers {
if err := dockerCli.Client().ContainerStart(ctx, container, types.ContainerStartOptions{}); err != nil {
fmt.Fprintf(dockerCli.Err(), "%s\n", err)
failedContainers = append(failedContainers, container)
} else {
fmt.Fprintf(dockerCli.Out(), "%s\n", container)
}
}
if len(failedContainers) > 0 {
return fmt.Errorf("Error: failed to start containers: %v", strings.Join(failedContainers, ", "))
}
return nil
}

View file

@ -0,0 +1,233 @@
package container
import (
"fmt"
"io"
"strings"
"sync"
"text/tabwriter"
"time"
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/client"
"github.com/docker/docker/api/client/system"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/events"
"github.com/docker/engine-api/types/filters"
"github.com/spf13/cobra"
)
type statsOptions struct {
all bool
noStream bool
containers []string
}
// NewStatsCommand creats a new cobra.Command for `docker stats`
func NewStatsCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts statsOptions
cmd := &cobra.Command{
Use: "stats [OPTIONS] [CONTAINER...]",
Short: "Display a live stream of container(s) resource usage statistics",
Args: cli.RequiresMinArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runStats(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.all, "all", "a", false, "Show all containers (default shows just running)")
flags.BoolVar(&opts.noStream, "no-stream", false, "Disable streaming stats and only pull the first result")
return cmd
}
// runStats displays a live stream of resource usage statistics for one or more containers.
// This shows real-time information on CPU usage, memory usage, and network I/O.
func runStats(dockerCli *client.DockerCli, opts *statsOptions) error {
showAll := len(opts.containers) == 0
closeChan := make(chan error)
ctx := context.Background()
// monitorContainerEvents watches for container creation and removal (only
// used when calling `docker stats` without arguments).
monitorContainerEvents := func(started chan<- struct{}, c chan events.Message) {
f := filters.NewArgs()
f.Add("type", "container")
options := types.EventsOptions{
Filters: f,
}
resBody, err := dockerCli.Client().Events(ctx, options)
// Whether we successfully subscribed to events or not, we can now
// unblock the main goroutine.
close(started)
if err != nil {
closeChan <- err
return
}
defer resBody.Close()
system.DecodeEvents(resBody, func(event events.Message, err error) error {
if err != nil {
closeChan <- err
return nil
}
c <- event
return nil
})
}
// waitFirst is a WaitGroup to wait first stat data's reach for each container
waitFirst := &sync.WaitGroup{}
cStats := stats{}
// getContainerList simulates creation event for all previously existing
// containers (only used when calling `docker stats` without arguments).
getContainerList := func() {
options := types.ContainerListOptions{
All: opts.all,
}
cs, err := dockerCli.Client().ContainerList(ctx, options)
if err != nil {
closeChan <- err
}
for _, container := range cs {
s := &containerStats{Name: container.ID[:12]}
if cStats.add(s) {
waitFirst.Add(1)
go s.Collect(ctx, dockerCli.Client(), !opts.noStream, waitFirst)
}
}
}
if showAll {
// If no names were specified, start a long running goroutine which
// monitors container events. We make sure we're subscribed before
// retrieving the list of running containers to avoid a race where we
// would "miss" a creation.
started := make(chan struct{})
eh := system.InitEventHandler()
eh.Handle("create", func(e events.Message) {
if opts.all {
s := &containerStats{Name: e.ID[:12]}
if cStats.add(s) {
waitFirst.Add(1)
go s.Collect(ctx, dockerCli.Client(), !opts.noStream, waitFirst)
}
}
})
eh.Handle("start", func(e events.Message) {
s := &containerStats{Name: e.ID[:12]}
if cStats.add(s) {
waitFirst.Add(1)
go s.Collect(ctx, dockerCli.Client(), !opts.noStream, waitFirst)
}
})
eh.Handle("die", func(e events.Message) {
if !opts.all {
cStats.remove(e.ID[:12])
}
})
eventChan := make(chan events.Message)
go eh.Watch(eventChan)
go monitorContainerEvents(started, eventChan)
defer close(eventChan)
<-started
// Start a short-lived goroutine to retrieve the initial list of
// containers.
getContainerList()
} else {
// Artificially send creation events for the containers we were asked to
// monitor (same code path than we use when monitoring all containers).
for _, name := range opts.containers {
s := &containerStats{Name: name}
if cStats.add(s) {
waitFirst.Add(1)
go s.Collect(ctx, dockerCli.Client(), !opts.noStream, waitFirst)
}
}
// We don't expect any asynchronous errors: closeChan can be closed.
close(closeChan)
// Do a quick pause to detect any error with the provided list of
// container names.
time.Sleep(1500 * time.Millisecond)
var errs []string
cStats.mu.Lock()
for _, c := range cStats.cs {
c.mu.Lock()
if c.err != nil {
errs = append(errs, fmt.Sprintf("%s: %v", c.Name, c.err))
}
c.mu.Unlock()
}
cStats.mu.Unlock()
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, ", "))
}
}
// before print to screen, make sure each container get at least one valid stat data
waitFirst.Wait()
w := tabwriter.NewWriter(dockerCli.Out(), 20, 1, 3, ' ', 0)
printHeader := func() {
if !opts.noStream {
fmt.Fprint(dockerCli.Out(), "\033[2J")
fmt.Fprint(dockerCli.Out(), "\033[H")
}
io.WriteString(w, "CONTAINER\tCPU %\tMEM USAGE / LIMIT\tMEM %\tNET I/O\tBLOCK I/O\tPIDS\n")
}
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
}
select {
case err, ok := <-closeChan:
if ok {
if err != nil {
// this is suppressing "unexpected EOF" in the cli when the
// daemon restarts so it shutdowns cleanly
if err == io.ErrUnexpectedEOF {
return nil
}
return err
}
}
default:
// just skip
}
}
return nil
}

View file

@ -0,0 +1,238 @@
package container
import (
"encoding/json"
"errors"
"fmt"
"io"
"strings"
"sync"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
"github.com/docker/go-units"
"golang.org/x/net/context"
)
type containerStats struct {
Name string
CPUPercentage float64
Memory float64
MemoryLimit float64
MemoryPercentage float64
NetworkRx float64
NetworkTx float64
BlockRead float64
BlockWrite float64
PidsCurrent uint64
mu sync.Mutex
err error
}
type stats struct {
mu sync.Mutex
cs []*containerStats
}
func (s *stats) add(cs *containerStats) bool {
s.mu.Lock()
defer s.mu.Unlock()
if _, exists := s.isKnownContainer(cs.Name); !exists {
s.cs = append(s.cs, cs)
return true
}
return false
}
func (s *stats) remove(id string) {
s.mu.Lock()
if i, exists := s.isKnownContainer(id); exists {
s.cs = append(s.cs[:i], s.cs[i+1:]...)
}
s.mu.Unlock()
}
func (s *stats) isKnownContainer(cid string) (int, bool) {
for i, c := range s.cs {
if c.Name == cid {
return i, true
}
}
return -1, false
}
func (s *containerStats) Collect(ctx context.Context, cli client.APIClient, streamStats bool, waitFirst *sync.WaitGroup) {
logrus.Debugf("collecting stats for %s", s.Name)
var (
getFirst bool
previousCPU uint64
previousSystem uint64
u = make(chan error, 1)
)
defer func() {
// if error happens and we get nothing of stats, release wait group whatever
if !getFirst {
getFirst = true
waitFirst.Done()
}
}()
responseBody, err := cli.ContainerStats(ctx, s.Name, streamStats)
if err != nil {
s.mu.Lock()
s.err = err
s.mu.Unlock()
return
}
defer responseBody.Close()
dec := json.NewDecoder(responseBody)
go func() {
for {
var v *types.StatsJSON
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
}
var memPercent = 0.0
var cpuPercent = 0.0
// MemoryStats.Limit will never be 0 unless the container is not running and we haven't
// got any data from cgroup
if v.MemoryStats.Limit != 0 {
memPercent = float64(v.MemoryStats.Usage) / float64(v.MemoryStats.Limit) * 100.0
}
previousCPU = v.PreCPUStats.CPUUsage.TotalUsage
previousSystem = v.PreCPUStats.SystemUsage
cpuPercent = calculateCPUPercent(previousCPU, previousSystem, v)
blkRead, blkWrite := calculateBlockIO(v.BlkioStats)
s.mu.Lock()
s.CPUPercentage = cpuPercent
s.Memory = float64(v.MemoryStats.Usage)
s.MemoryLimit = float64(v.MemoryStats.Limit)
s.MemoryPercentage = memPercent
s.NetworkRx, s.NetworkTx = calculateNetwork(v.Networks)
s.BlockRead = float64(blkRead)
s.BlockWrite = float64(blkWrite)
s.PidsCurrent = v.PidsStats.Current
s.mu.Unlock()
u <- nil
if !streamStats {
return
}
}
}()
for {
select {
case <-time.After(2 * time.Second):
// zero out the values if we have not received an update within
// the specified duration.
s.mu.Lock()
s.CPUPercentage = 0
s.Memory = 0
s.MemoryPercentage = 0
s.MemoryLimit = 0
s.NetworkRx = 0
s.NetworkTx = 0
s.BlockRead = 0
s.BlockWrite = 0
s.PidsCurrent = 0
s.err = errors.New("timeout waiting for stats")
s.mu.Unlock()
// if this is the first stat you get, release WaitGroup
if !getFirst {
getFirst = true
waitFirst.Done()
}
case err := <-u:
if err != nil {
s.mu.Lock()
s.err = err
s.mu.Unlock()
continue
}
s.err = nil
// if this is the first stat you get, release WaitGroup
if !getFirst {
getFirst = true
waitFirst.Done()
}
}
if !streamStats {
return
}
}
}
func (s *containerStats) Display(w io.Writer) error {
s.mu.Lock()
defer s.mu.Unlock()
// NOTE: if you change this format, you must also change the err format below!
format := "%s\t%.2f%%\t%s / %s\t%.2f%%\t%s / %s\t%s / %s\t%d\n"
if s.err != nil {
format = "%s\t%s\t%s / %s\t%s\t%s / %s\t%s / %s\t%s\n"
errStr := "--"
fmt.Fprintf(w, format,
s.Name, errStr, errStr, errStr, errStr, errStr, errStr, errStr, errStr, errStr,
)
err := s.err
return err
}
fmt.Fprintf(w, format,
s.Name,
s.CPUPercentage,
units.BytesSize(s.Memory), units.BytesSize(s.MemoryLimit),
s.MemoryPercentage,
units.HumanSize(s.NetworkRx), units.HumanSize(s.NetworkTx),
units.HumanSize(s.BlockRead), units.HumanSize(s.BlockWrite),
s.PidsCurrent)
return nil
}
func calculateCPUPercent(previousCPU, previousSystem uint64, v *types.StatsJSON) float64 {
var (
cpuPercent = 0.0
// calculate the change for the cpu usage of the container in between readings
cpuDelta = float64(v.CPUStats.CPUUsage.TotalUsage) - float64(previousCPU)
// calculate the change for the entire system between readings
systemDelta = float64(v.CPUStats.SystemUsage) - float64(previousSystem)
)
if systemDelta > 0.0 && cpuDelta > 0.0 {
cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CPUStats.CPUUsage.PercpuUsage)) * 100.0
}
return cpuPercent
}
func calculateBlockIO(blkio types.BlkioStats) (blkRead uint64, blkWrite uint64) {
for _, bioEntry := range blkio.IoServiceBytesRecursive {
switch strings.ToLower(bioEntry.Op) {
case "read":
blkRead = blkRead + bioEntry.Value
case "write":
blkWrite = blkWrite + bioEntry.Value
}
}
return
}
func calculateNetwork(network map[string]types.NetworkStats) (float64, float64) {
var rx, tx float64
for _, v := range network {
rx += float64(v.RxBytes)
tx += float64(v.TxBytes)
}
return rx, tx
}

View file

@ -0,0 +1,45 @@
package container
import (
"bytes"
"testing"
"github.com/docker/engine-api/types"
)
func TestDisplay(t *testing.T) {
c := &containerStats{
Name: "app",
CPUPercentage: 30.0,
Memory: 100 * 1024 * 1024.0,
MemoryLimit: 2048 * 1024 * 1024.0,
MemoryPercentage: 100.0 / 2048.0 * 100.0,
NetworkRx: 100 * 1024 * 1024,
NetworkTx: 800 * 1024 * 1024,
BlockRead: 100 * 1024 * 1024,
BlockWrite: 800 * 1024 * 1024,
PidsCurrent: 1,
}
var b bytes.Buffer
if err := c.Display(&b); err != nil {
t.Fatalf("c.Display() gave error: %s", err)
}
got := b.String()
want := "app\t30.00%\t100 MiB / 2 GiB\t4.88%\t104.9 MB / 838.9 MB\t104.9 MB / 838.9 MB\t1\n"
if got != want {
t.Fatalf("c.Display() = %q, want %q", got, want)
}
}
func TestCalculBlockIO(t *testing.T) {
blkio := types.BlkioStats{
IoServiceBytesRecursive: []types.BlkioStatEntry{{8, 0, "read", 1234}, {8, 1, "read", 4567}, {8, 0, "write", 123}, {8, 1, "write", 456}},
}
blkRead, blkWrite := calculateBlockIO(blkio)
if blkRead != 5801 {
t.Fatalf("blkRead = %d, want 5801", blkRead)
}
if blkWrite != 579 {
t.Fatalf("blkWrite = %d, want 579", blkWrite)
}
}

View file

@ -0,0 +1,56 @@
package container
import (
"fmt"
"strings"
"time"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type stopOptions struct {
time int
containers []string
}
// NewStopCommand creats a new cobra.Command for `docker stop`
func NewStopCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts stopOptions
cmd := &cobra.Command{
Use: "stop [OPTIONS] CONTAINER [CONTAINER...]",
Short: "Stop one or more running containers",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runStop(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.IntVarP(&opts.time, "time", "t", 10, "Seconds to wait for stop before killing it")
return cmd
}
func runStop(dockerCli *client.DockerCli, opts *stopOptions) error {
ctx := context.Background()
var errs []string
for _, container := range opts.containers {
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)
}
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, "\n"))
}
return nil
}

View file

@ -0,0 +1,58 @@
package container
import (
"fmt"
"strings"
"text/tabwriter"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type topOptions struct {
container string
args []string
}
// NewTopCommand creates a new cobra.Command for `docker top`
func NewTopCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts topOptions
cmd := &cobra.Command{
Use: "top CONTAINER [ps OPTIONS]",
Short: "Display the running processes of a container",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.container = args[0]
opts.args = args[1:]
return runTop(dockerCli, &opts)
},
}
flags := cmd.Flags()
flags.SetInterspersed(false)
return cmd
}
func runTop(dockerCli *client.DockerCli, opts *topOptions) error {
ctx := context.Background()
procList, err := dockerCli.Client().ContainerTop(ctx, opts.container, opts.args)
if err != nil {
return err
}
w := tabwriter.NewWriter(dockerCli.Out(), 20, 1, 3, ' ', 0)
fmt.Fprintln(w, strings.Join(procList.Titles, "\t"))
for _, proc := range procList.Processes {
fmt.Fprintln(w, strings.Join(proc, "\t"))
}
w.Flush()
return nil
}

View file

@ -0,0 +1,50 @@
package container
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type unpauseOptions struct {
containers []string
}
// NewUnpauseCommand creats a new cobra.Command for `docker unpause`
func NewUnpauseCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts unpauseOptions
cmd := &cobra.Command{
Use: "unpause CONTAINER [CONTAINER...]",
Short: "Unpause all processes within one or more containers",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runUnpause(dockerCli, &opts)
},
}
return cmd
}
func runUnpause(dockerCli *client.DockerCli, opts *unpauseOptions) error {
ctx := context.Background()
var errs []string
for _, container := range opts.containers {
if err := dockerCli.Client().ContainerUnpause(ctx, container); err != nil {
errs = append(errs, err.Error())
} else {
fmt.Fprintf(dockerCli.Out(), "%s\n", container)
}
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, "\n"))
}
return nil
}

View file

@ -0,0 +1,22 @@
package container
import (
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
clientapi "github.com/docker/engine-api/client"
)
// 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)
if err != nil {
// If we can't connect, then the daemon probably died.
if err != clientapi.ErrConnectionFailed {
return false, -1, err
}
return false, -1, nil
}
return c.State.Running, c.State.ExitCode, nil
}

View file

@ -0,0 +1,51 @@
package container
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type waitOptions struct {
containers []string
}
// NewWaitCommand creates a new cobra.Command for `docker wait`
func NewWaitCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts waitOptions
cmd := &cobra.Command{
Use: "wait CONTAINER [CONTAINER...]",
Short: "Block until a container stops, then print its exit code",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runWait(dockerCli, &opts)
},
}
return cmd
}
func runWait(dockerCli *client.DockerCli, opts *waitOptions) error {
ctx := context.Background()
var errs []string
for _, container := range opts.containers {
status, err := dockerCli.Client().ContainerWait(ctx, container)
if err != nil {
errs = append(errs, err.Error())
} else {
fmt.Fprintf(dockerCli.Out(), "%d\n", status)
}
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, "\n"))
}
return nil
}

44
api/client/credentials.go Normal file
View file

@ -0,0 +1,44 @@
package client
import (
"github.com/docker/docker/cliconfig/configfile"
"github.com/docker/docker/cliconfig/credentials"
"github.com/docker/engine-api/types"
)
// GetCredentials loads the user credentials from a credentials store.
// The store is determined by the config file settings.
func GetCredentials(c *configfile.ConfigFile, serverAddress string) (types.AuthConfig, error) {
s := LoadCredentialsStore(c)
return s.Get(serverAddress)
}
// GetAllCredentials loads all credentials from a credentials store.
// The store is determined by the config file settings.
func GetAllCredentials(c *configfile.ConfigFile) (map[string]types.AuthConfig, error) {
s := LoadCredentialsStore(c)
return s.GetAll()
}
// StoreCredentials saves the user credentials in a credentials store.
// The store is determined by the config file settings.
func StoreCredentials(c *configfile.ConfigFile, auth types.AuthConfig) error {
s := LoadCredentialsStore(c)
return s.Store(auth)
}
// EraseCredentials removes the user credentials from a credentials store.
// The store is determined by the config file settings.
func EraseCredentials(c *configfile.ConfigFile, serverAddress string) error {
s := LoadCredentialsStore(c)
return s.Erase(serverAddress)
}
// LoadCredentialsStore initializes a new credentials store based
// in the settings provided in the configuration file.
func LoadCredentialsStore(c *configfile.ConfigFile) credentials.Store {
if c.CredentialsStore != "" {
return credentials.NewNativeStore(c)
}
return credentials.NewFileStore(c)
}

160
api/client/exec.go Normal file
View file

@ -0,0 +1,160 @@
package client
import (
"fmt"
"io"
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/promise"
"github.com/docker/engine-api/types"
)
// CmdExec runs a command in a running container.
//
// Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
func (cli *DockerCli) CmdExec(args ...string) error {
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)
container := cmd.Arg(0)
// just in case the ParseExec does not exit
if container == "" || err != nil {
return Cli.StatusError{StatusCode: 1}
}
if *detachKeys != "" {
cli.configFile.DetachKeys = *detachKeys
}
// Send client escape keys
execConfig.DetachKeys = cli.configFile.DetachKeys
ctx := context.Background()
response, err := cli.client.ContainerExecCreate(ctx, container, *execConfig)
if err != nil {
return err
}
execID := response.ID
if execID == "" {
fmt.Fprintf(cli.out, "exec ID empty")
return nil
}
//Temp struct for execStart so that we don't need to transfer all the execConfig
if !execConfig.Detach {
if err := cli.CheckTtyInput(execConfig.AttachStdin, execConfig.Tty); err != nil {
return err
}
} else {
execStartCheck := types.ExecStartCheck{
Detach: execConfig.Detach,
Tty: execConfig.Tty,
}
if err := cli.client.ContainerExecStart(ctx, execID, execStartCheck); err != nil {
return err
}
// For now don't print this - wait for when we support exec wait()
// fmt.Fprintf(cli.out, "%s\n", execID)
return nil
}
// Interactive exec requested.
var (
out, stderr io.Writer
in io.ReadCloser
errCh chan error
)
if execConfig.AttachStdin {
in = cli.in
}
if execConfig.AttachStdout {
out = cli.out
}
if execConfig.AttachStderr {
if execConfig.Tty {
stderr = cli.out
} else {
stderr = cli.err
}
}
resp, err := cli.client.ContainerExecAttach(ctx, execID, *execConfig)
if err != nil {
return err
}
defer resp.Close()
errCh = promise.Go(func() error {
return cli.HoldHijackedConnection(ctx, execConfig.Tty, in, out, stderr, resp)
})
if execConfig.Tty && cli.isTerminalIn {
if err := cli.MonitorTtySize(ctx, execID, true); err != nil {
fmt.Fprintf(cli.err, "Error monitoring TTY size: %s\n", err)
}
}
if err := <-errCh; err != nil {
logrus.Debugf("Error hijack: %s", err)
return err
}
var status int
if _, status, err = cli.getExecExitCode(ctx, execID); err != nil {
return err
}
if status != 0 {
return Cli.StatusError{StatusCode: status}
}
return nil
}
// ParseExec parses the specified args for the specified command and generates
// an ExecConfig from it.
// If the minimal number of specified args is not right or if specified args are
// not valid, it will return an error.
func ParseExec(cmd *flag.FlagSet, args []string) (*types.ExecConfig, error) {
var (
flStdin = cmd.Bool([]string{"i", "-interactive"}, false, "Keep STDIN open even if not attached")
flTty = cmd.Bool([]string{"t", "-tty"}, false, "Allocate a pseudo-TTY")
flDetach = cmd.Bool([]string{"d", "-detach"}, false, "Detached mode: run command in the background")
flUser = cmd.String([]string{"u", "-user"}, "", "Username or UID (format: <name|uid>[:<group|gid>])")
flPrivileged = cmd.Bool([]string{"-privileged"}, false, "Give extended privileges to the command")
execCmd []string
)
cmd.Require(flag.Min, 2)
if err := cmd.ParseFlags(args, true); err != nil {
return nil, err
}
parsedArgs := cmd.Args()
execCmd = parsedArgs[1:]
execConfig := &types.ExecConfig{
User: *flUser,
Privileged: *flPrivileged,
Tty: *flTty,
Cmd: execCmd,
Detach: *flDetach,
}
// If -d is not set, attach to everything by default
if !*flDetach {
execConfig.AttachStdout = true
execConfig.AttachStderr = true
if *flStdin {
execConfig.AttachStdin = true
}
}
return execConfig, nil
}

122
api/client/exec_test.go Normal file
View file

@ -0,0 +1,122 @@
package client
import (
"fmt"
"io/ioutil"
"testing"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/engine-api/types"
)
type arguments struct {
args []string
}
func TestParseExec(t *testing.T) {
invalids := map[*arguments]error{
&arguments{[]string{"-unknown"}}: fmt.Errorf("flag provided but not defined: -unknown"),
&arguments{[]string{"-u"}}: fmt.Errorf("flag needs an argument: -u"),
&arguments{[]string{"--user"}}: fmt.Errorf("flag needs an argument: --user"),
}
valids := map[*arguments]*types.ExecConfig{
&arguments{
[]string{"container", "command"},
}: {
Cmd: []string{"command"},
AttachStdout: true,
AttachStderr: true,
},
&arguments{
[]string{"container", "command1", "command2"},
}: {
Cmd: []string{"command1", "command2"},
AttachStdout: true,
AttachStderr: true,
},
&arguments{
[]string{"-i", "-t", "-u", "uid", "container", "command"},
}: {
User: "uid",
AttachStdin: true,
AttachStdout: true,
AttachStderr: true,
Tty: true,
Cmd: []string{"command"},
},
&arguments{
[]string{"-d", "container", "command"},
}: {
AttachStdin: false,
AttachStdout: false,
AttachStderr: false,
Detach: true,
Cmd: []string{"command"},
},
&arguments{
[]string{"-t", "-i", "-d", "container", "command"},
}: {
AttachStdin: false,
AttachStdout: false,
AttachStderr: false,
Detach: true,
Tty: true,
Cmd: []string{"command"},
},
}
for invalid, expectedError := range invalids {
cmd := flag.NewFlagSet("exec", flag.ContinueOnError)
cmd.ShortUsage = func() {}
cmd.SetOutput(ioutil.Discard)
_, err := ParseExec(cmd, invalid.args)
if err == nil || err.Error() != expectedError.Error() {
t.Fatalf("Expected an error [%v] for %v, got %v", expectedError, invalid, err)
}
}
for valid, expectedExecConfig := range valids {
cmd := flag.NewFlagSet("exec", flag.ContinueOnError)
cmd.ShortUsage = func() {}
cmd.SetOutput(ioutil.Discard)
execConfig, err := ParseExec(cmd, valid.args)
if err != nil {
t.Fatal(err)
}
if !compareExecConfig(expectedExecConfig, execConfig) {
t.Fatalf("Expected [%v] for %v, got [%v]", expectedExecConfig, valid, execConfig)
}
}
}
func compareExecConfig(config1 *types.ExecConfig, config2 *types.ExecConfig) bool {
if config1.AttachStderr != config2.AttachStderr {
return false
}
if config1.AttachStdin != config2.AttachStdin {
return false
}
if config1.AttachStdout != config2.AttachStdout {
return false
}
if config1.Detach != config2.Detach {
return false
}
if config1.Privileged != config2.Privileged {
return false
}
if config1.Tty != config2.Tty {
return false
}
if config1.User != config2.User {
return false
}
if len(config1.Cmd) != len(config2.Cmd) {
return false
}
for index, value := range config1.Cmd {
if value != config2.Cmd[index] {
return false
}
}
return true
}

View file

@ -0,0 +1,243 @@
package formatter
import (
"fmt"
"strconv"
"strings"
"time"
"github.com/docker/docker/api"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/engine-api/types"
"github.com/docker/go-units"
)
const (
tableKey = "table"
containerIDHeader = "CONTAINER ID"
imageHeader = "IMAGE"
namesHeader = "NAMES"
commandHeader = "COMMAND"
createdSinceHeader = "CREATED"
createdAtHeader = "CREATED AT"
runningForHeader = "CREATED"
statusHeader = "STATUS"
portsHeader = "PORTS"
sizeHeader = "SIZE"
labelsHeader = "LABELS"
imageIDHeader = "IMAGE ID"
repositoryHeader = "REPOSITORY"
tagHeader = "TAG"
digestHeader = "DIGEST"
mountsHeader = "MOUNTS"
)
type containerContext struct {
baseSubContext
trunc bool
c types.Container
}
func (c *containerContext) ID() string {
c.addHeader(containerIDHeader)
if c.trunc {
return stringid.TruncateID(c.c.ID)
}
return c.c.ID
}
func (c *containerContext) Names() string {
c.addHeader(namesHeader)
names := stripNamePrefix(c.c.Names)
if c.trunc {
for _, name := range names {
if len(strings.Split(name, "/")) == 1 {
names = []string{name}
break
}
}
}
return strings.Join(names, ",")
}
func (c *containerContext) Image() string {
c.addHeader(imageHeader)
if c.c.Image == "" {
return "<no image>"
}
if c.trunc {
if trunc := stringid.TruncateID(c.c.ImageID); trunc == stringid.TruncateID(c.c.Image) {
return trunc
}
}
return c.c.Image
}
func (c *containerContext) Command() string {
c.addHeader(commandHeader)
command := c.c.Command
if c.trunc {
command = stringutils.Truncate(command, 20)
}
return strconv.Quote(command)
}
func (c *containerContext) CreatedAt() string {
c.addHeader(createdAtHeader)
return time.Unix(int64(c.c.Created), 0).String()
}
func (c *containerContext) RunningFor() string {
c.addHeader(runningForHeader)
createdAt := time.Unix(int64(c.c.Created), 0)
return units.HumanDuration(time.Now().UTC().Sub(createdAt))
}
func (c *containerContext) Ports() string {
c.addHeader(portsHeader)
return api.DisplayablePorts(c.c.Ports)
}
func (c *containerContext) Status() string {
c.addHeader(statusHeader)
return c.c.Status
}
func (c *containerContext) Size() string {
c.addHeader(sizeHeader)
srw := units.HumanSize(float64(c.c.SizeRw))
sv := units.HumanSize(float64(c.c.SizeRootFs))
sf := srw
if c.c.SizeRootFs > 0 {
sf = fmt.Sprintf("%s (virtual %s)", srw, sv)
}
return sf
}
func (c *containerContext) Labels() string {
c.addHeader(labelsHeader)
if c.c.Labels == nil {
return ""
}
var joinLabels []string
for k, v := range c.c.Labels {
joinLabels = append(joinLabels, fmt.Sprintf("%s=%s", k, v))
}
return strings.Join(joinLabels, ",")
}
func (c *containerContext) Label(name string) string {
n := strings.Split(name, ".")
r := strings.NewReplacer("-", " ", "_", " ")
h := r.Replace(n[len(n)-1])
c.addHeader(h)
if c.c.Labels == nil {
return ""
}
return c.c.Labels[name]
}
func (c *containerContext) Mounts() string {
c.addHeader(mountsHeader)
var name string
var mounts []string
for _, m := range c.c.Mounts {
if m.Name == "" {
name = m.Source
} else {
name = m.Name
}
if c.trunc {
name = stringutils.Truncate(name, 15)
}
mounts = append(mounts, name)
}
return strings.Join(mounts, ",")
}
type imageContext struct {
baseSubContext
trunc bool
i types.Image
repo string
tag string
digest string
}
func (c *imageContext) ID() string {
c.addHeader(imageIDHeader)
if c.trunc {
return stringid.TruncateID(c.i.ID)
}
return c.i.ID
}
func (c *imageContext) Repository() string {
c.addHeader(repositoryHeader)
return c.repo
}
func (c *imageContext) Tag() string {
c.addHeader(tagHeader)
return c.tag
}
func (c *imageContext) Digest() string {
c.addHeader(digestHeader)
return c.digest
}
func (c *imageContext) CreatedSince() string {
c.addHeader(createdSinceHeader)
createdAt := time.Unix(int64(c.i.Created), 0)
return units.HumanDuration(time.Now().UTC().Sub(createdAt))
}
func (c *imageContext) CreatedAt() string {
c.addHeader(createdAtHeader)
return time.Unix(int64(c.i.Created), 0).String()
}
func (c *imageContext) Size() string {
c.addHeader(sizeHeader)
return units.HumanSize(float64(c.i.Size))
}
type subContext interface {
fullHeader() string
addHeader(header string)
}
type baseSubContext struct {
header []string
}
func (c *baseSubContext) fullHeader() string {
if c.header == nil {
return ""
}
return strings.Join(c.header, "\t")
}
func (c *baseSubContext) addHeader(header string) {
if c.header == nil {
c.header = []string{}
}
c.header = append(c.header, strings.ToUpper(header))
}
func stripNamePrefix(ss []string) []string {
sss := make([]string, len(ss))
for i, s := range ss {
sss[i] = s[1:]
}
return sss
}

View file

@ -0,0 +1,192 @@
package formatter
import (
"reflect"
"strings"
"testing"
"time"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/engine-api/types"
)
func TestContainerPsContext(t *testing.T) {
containerID := stringid.GenerateRandomID()
unix := time.Now().Add(-65 * time.Second).Unix()
var ctx containerContext
cases := []struct {
container types.Container
trunc bool
expValue string
expHeader string
call func() string
}{
{types.Container{ID: containerID}, true, stringid.TruncateID(containerID), containerIDHeader, ctx.ID},
{types.Container{ID: containerID}, false, containerID, containerIDHeader, ctx.ID},
{types.Container{Names: []string{"/foobar_baz"}}, true, "foobar_baz", namesHeader, ctx.Names},
{types.Container{Image: "ubuntu"}, true, "ubuntu", imageHeader, ctx.Image},
{types.Container{Image: "verylongimagename"}, true, "verylongimagename", imageHeader, ctx.Image},
{types.Container{Image: "verylongimagename"}, false, "verylongimagename", imageHeader, ctx.Image},
{types.Container{
Image: "a5a665ff33eced1e0803148700880edab4",
ImageID: "a5a665ff33eced1e0803148700880edab4269067ed77e27737a708d0d293fbf5",
},
true,
"a5a665ff33ec",
imageHeader,
ctx.Image,
},
{types.Container{
Image: "a5a665ff33eced1e0803148700880edab4",
ImageID: "a5a665ff33eced1e0803148700880edab4269067ed77e27737a708d0d293fbf5",
},
false,
"a5a665ff33eced1e0803148700880edab4",
imageHeader,
ctx.Image,
},
{types.Container{Image: ""}, true, "<no image>", imageHeader, ctx.Image},
{types.Container{Command: "sh -c 'ls -la'"}, true, `"sh -c 'ls -la'"`, commandHeader, ctx.Command},
{types.Container{Created: unix}, true, time.Unix(unix, 0).String(), createdAtHeader, ctx.CreatedAt},
{types.Container{Ports: []types.Port{{PrivatePort: 8080, PublicPort: 8080, Type: "tcp"}}}, true, "8080/tcp", portsHeader, ctx.Ports},
{types.Container{Status: "RUNNING"}, true, "RUNNING", statusHeader, ctx.Status},
{types.Container{SizeRw: 10}, true, "10 B", sizeHeader, ctx.Size},
{types.Container{SizeRw: 10, SizeRootFs: 20}, true, "10 B (virtual 20 B)", sizeHeader, ctx.Size},
{types.Container{}, true, "", labelsHeader, ctx.Labels},
{types.Container{Labels: map[string]string{"cpu": "6", "storage": "ssd"}}, true, "cpu=6,storage=ssd", labelsHeader, ctx.Labels},
{types.Container{Created: unix}, true, "About a minute", runningForHeader, ctx.RunningFor},
}
for _, c := range cases {
ctx = containerContext{c: c.container, trunc: c.trunc}
v := c.call()
if strings.Contains(v, ",") {
compareMultipleValues(t, v, c.expValue)
} else if v != c.expValue {
t.Fatalf("Expected %s, was %s\n", c.expValue, v)
}
h := ctx.fullHeader()
if h != c.expHeader {
t.Fatalf("Expected %s, was %s\n", c.expHeader, h)
}
}
c1 := types.Container{Labels: map[string]string{"com.docker.swarm.swarm-id": "33", "com.docker.swarm.node_name": "ubuntu"}}
ctx = containerContext{c: c1, trunc: true}
sid := ctx.Label("com.docker.swarm.swarm-id")
node := ctx.Label("com.docker.swarm.node_name")
if sid != "33" {
t.Fatalf("Expected 33, was %s\n", sid)
}
if node != "ubuntu" {
t.Fatalf("Expected ubuntu, was %s\n", node)
}
h := ctx.fullHeader()
if h != "SWARM ID\tNODE NAME" {
t.Fatalf("Expected %s, was %s\n", "SWARM ID\tNODE NAME", h)
}
c2 := types.Container{}
ctx = containerContext{c: c2, trunc: true}
label := ctx.Label("anything.really")
if label != "" {
t.Fatalf("Expected an empty string, was %s", label)
}
ctx = containerContext{c: c2, trunc: true}
fullHeader := ctx.fullHeader()
if fullHeader != "" {
t.Fatalf("Expected fullHeader to be empty, was %s", fullHeader)
}
}
func TestImagesContext(t *testing.T) {
imageID := stringid.GenerateRandomID()
unix := time.Now().Unix()
var ctx imageContext
cases := []struct {
imageCtx imageContext
expValue string
expHeader string
call func() string
}{
{imageContext{
i: types.Image{ID: imageID},
trunc: true,
}, stringid.TruncateID(imageID), imageIDHeader, ctx.ID},
{imageContext{
i: types.Image{ID: imageID},
trunc: false,
}, imageID, imageIDHeader, ctx.ID},
{imageContext{
i: types.Image{Size: 10},
trunc: true,
}, "10 B", sizeHeader, ctx.Size},
{imageContext{
i: types.Image{Created: unix},
trunc: true,
}, time.Unix(unix, 0).String(), createdAtHeader, ctx.CreatedAt},
// FIXME
// {imageContext{
// i: types.Image{Created: unix},
// trunc: true,
// }, units.HumanDuration(time.Unix(unix, 0)), createdSinceHeader, ctx.CreatedSince},
{imageContext{
i: types.Image{},
repo: "busybox",
}, "busybox", repositoryHeader, ctx.Repository},
{imageContext{
i: types.Image{},
tag: "latest",
}, "latest", tagHeader, ctx.Tag},
{imageContext{
i: types.Image{},
digest: "sha256:d149ab53f8718e987c3a3024bb8aa0e2caadf6c0328f1d9d850b2a2a67f2819a",
}, "sha256:d149ab53f8718e987c3a3024bb8aa0e2caadf6c0328f1d9d850b2a2a67f2819a", digestHeader, ctx.Digest},
}
for _, c := range cases {
ctx = c.imageCtx
v := c.call()
if strings.Contains(v, ",") {
compareMultipleValues(t, v, c.expValue)
} else if v != c.expValue {
t.Fatalf("Expected %s, was %s\n", c.expValue, v)
}
h := ctx.fullHeader()
if h != c.expHeader {
t.Fatalf("Expected %s, was %s\n", c.expHeader, h)
}
}
}
func compareMultipleValues(t *testing.T, value, expected string) {
// comma-separated values means probably a map input, which won't
// be guaranteed to have the same order as our expected value
// We'll create maps and use reflect.DeepEquals to check instead:
entriesMap := make(map[string]string)
expMap := make(map[string]string)
entries := strings.Split(value, ",")
expectedEntries := strings.Split(expected, ",")
for _, entry := range entries {
keyval := strings.Split(entry, "=")
entriesMap[keyval[0]] = keyval[1]
}
for _, expected := range expectedEntries {
keyval := strings.Split(expected, "=")
expMap[keyval[0]] = keyval[1]
}
if !reflect.DeepEqual(expMap, entriesMap) {
t.Fatalf("Expected entries: %v, got: %v", expected, value)
}
}

View file

@ -0,0 +1,307 @@
package formatter
import (
"bytes"
"fmt"
"io"
"strings"
"text/tabwriter"
"text/template"
"github.com/docker/docker/reference"
"github.com/docker/docker/utils/templates"
"github.com/docker/engine-api/types"
)
const (
tableFormatKey = "table"
rawFormatKey = "raw"
defaultContainerTableFormat = "table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.RunningFor}} ago\t{{.Status}}\t{{.Ports}}\t{{.Names}}"
defaultImageTableFormat = "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedSince}} ago\t{{.Size}}"
defaultImageTableFormatWithDigest = "table {{.Repository}}\t{{.Tag}}\t{{.Digest}}\t{{.ID}}\t{{.CreatedSince}} ago\t{{.Size}}"
defaultQuietFormat = "{{.ID}}"
)
// Context contains information required by the formatter to print the output as desired.
type Context struct {
// Output is the output stream to which the formatted string is written.
Output io.Writer
// Format is used to choose raw, table or custom format for the output.
Format string
// Quiet when set to true will simply print minimal information.
Quiet bool
// Trunc when set to true will truncate the output of certain fields such as Container ID.
Trunc bool
// internal element
table bool
finalFormat string
header string
buffer *bytes.Buffer
}
func (c *Context) preformat() {
c.finalFormat = c.Format
if strings.HasPrefix(c.Format, tableKey) {
c.table = true
c.finalFormat = c.finalFormat[len(tableKey):]
}
c.finalFormat = strings.Trim(c.finalFormat, " ")
r := strings.NewReplacer(`\t`, "\t", `\n`, "\n")
c.finalFormat = r.Replace(c.finalFormat)
}
func (c *Context) parseFormat() (*template.Template, error) {
tmpl, err := templates.Parse(c.finalFormat)
if err != nil {
c.buffer.WriteString(fmt.Sprintf("Template parsing error: %v\n", err))
c.buffer.WriteTo(c.Output)
}
return tmpl, err
}
func (c *Context) postformat(tmpl *template.Template, subContext subContext) {
if c.table {
if len(c.header) == 0 {
// if we still don't have a header, we didn't have any containers so we need to fake it to get the right headers from the template
tmpl.Execute(bytes.NewBufferString(""), subContext)
c.header = subContext.fullHeader()
}
t := tabwriter.NewWriter(c.Output, 20, 1, 3, ' ', 0)
t.Write([]byte(c.header))
t.Write([]byte("\n"))
c.buffer.WriteTo(t)
t.Flush()
} else {
c.buffer.WriteTo(c.Output)
}
}
func (c *Context) contextFormat(tmpl *template.Template, subContext subContext) error {
if err := tmpl.Execute(c.buffer, subContext); err != nil {
c.buffer = bytes.NewBufferString(fmt.Sprintf("Template parsing error: %v\n", err))
c.buffer.WriteTo(c.Output)
return err
}
if c.table && len(c.header) == 0 {
c.header = subContext.fullHeader()
}
c.buffer.WriteString("\n")
return nil
}
// ContainerContext contains container specific information required by the formater, encapsulate a Context struct.
type ContainerContext struct {
Context
// Size when set to true will display the size of the output.
Size bool
// Containers
Containers []types.Container
}
// ImageContext contains image specific information required by the formater, encapsulate a Context struct.
type ImageContext struct {
Context
Digest bool
// Images
Images []types.Image
}
func (ctx ContainerContext) Write() {
switch ctx.Format {
case tableFormatKey:
if ctx.Quiet {
ctx.Format = defaultQuietFormat
} else {
ctx.Format = defaultContainerTableFormat
if ctx.Size {
ctx.Format += `\t{{.Size}}`
}
}
case rawFormatKey:
if ctx.Quiet {
ctx.Format = `container_id: {{.ID}}`
} else {
ctx.Format = `container_id: {{.ID}}\nimage: {{.Image}}\ncommand: {{.Command}}\ncreated_at: {{.CreatedAt}}\nstatus: {{.Status}}\nnames: {{.Names}}\nlabels: {{.Labels}}\nports: {{.Ports}}\n`
if ctx.Size {
ctx.Format += `size: {{.Size}}\n`
}
}
}
ctx.buffer = bytes.NewBufferString("")
ctx.preformat()
tmpl, err := ctx.parseFormat()
if err != nil {
return
}
for _, container := range ctx.Containers {
containerCtx := &containerContext{
trunc: ctx.Trunc,
c: container,
}
err = ctx.contextFormat(tmpl, containerCtx)
if err != nil {
return
}
}
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:
ctx.Format = defaultImageTableFormat
if ctx.Digest {
ctx.Format = defaultImageTableFormatWithDigest
}
if ctx.Quiet {
ctx.Format = defaultQuietFormat
}
case rawFormatKey:
if ctx.Quiet {
ctx.Format = `image_id: {{.ID}}`
} else {
if ctx.Digest {
ctx.Format = `repository: {{ .Repository }}
tag: {{.Tag}}
digest: {{.Digest}}
image_id: {{.ID}}
created_at: {{.CreatedAt}}
virtual_size: {{.Size}}
`
} else {
ctx.Format = `repository: {{ .Repository }}
tag: {{.Tag}}
image_id: {{.ID}}
created_at: {{.CreatedAt}}
virtual_size: {{.Size}}
`
}
}
}
ctx.buffer = bytes.NewBufferString("")
ctx.preformat()
if ctx.table && ctx.Digest && !strings.Contains(ctx.Format, "{{.Digest}}") {
ctx.finalFormat += "\t{{.Digest}}"
}
tmpl, err := ctx.parseFormat()
if err != nil {
return
}
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{}
for _, refString := range append(image.RepoTags) {
ref, err := reference.ParseNamed(refString)
if err != nil {
continue
}
if nt, ok := ref.(reference.NamedTagged); ok {
repoTags[ref.Name()] = append(repoTags[ref.Name()], nt.Tag())
}
}
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
}
}
}
ctx.postformat(tmpl, &imageContext{})
}

View file

@ -0,0 +1,537 @@
package formatter
import (
"bytes"
"fmt"
"testing"
"time"
"github.com/docker/engine-api/types"
)
func TestContainerContextWrite(t *testing.T) {
unixTime := time.Now().AddDate(0, 0, -1).Unix()
expectedTime := time.Unix(unixTime, 0).String()
contexts := []struct {
context ContainerContext
expected string
}{
// Errors
{
ContainerContext{
Context: Context{
Format: "{{InvalidFunction}}",
},
},
`Template parsing error: template: :1: function "InvalidFunction" not defined
`,
},
{
ContainerContext{
Context: Context{
Format: "{{nil}}",
},
},
`Template parsing error: template: :1:2: executing "" at <nil>: nil is not a command
`,
},
// Table Format
{
ContainerContext{
Context: Context{
Format: "table",
},
},
`CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
containerID1 ubuntu "" 24 hours ago foobar_baz
containerID2 ubuntu "" 24 hours ago foobar_bar
`,
},
{
ContainerContext{
Context: Context{
Format: "table {{.Image}}",
},
},
"IMAGE\nubuntu\nubuntu\n",
},
{
ContainerContext{
Context: Context{
Format: "table {{.Image}}",
},
Size: true,
},
"IMAGE\nubuntu\nubuntu\n",
},
{
ContainerContext{
Context: Context{
Format: "table {{.Image}}",
Quiet: true,
},
},
"IMAGE\nubuntu\nubuntu\n",
},
{
ContainerContext{
Context: Context{
Format: "table",
Quiet: true,
},
},
"containerID1\ncontainerID2\n",
},
// Raw Format
{
ContainerContext{
Context: Context{
Format: "raw",
},
},
fmt.Sprintf(`container_id: containerID1
image: ubuntu
command: ""
created_at: %s
status:
names: foobar_baz
labels:
ports:
container_id: containerID2
image: ubuntu
command: ""
created_at: %s
status:
names: foobar_bar
labels:
ports:
`, expectedTime, expectedTime),
},
{
ContainerContext{
Context: Context{
Format: "raw",
},
Size: true,
},
fmt.Sprintf(`container_id: containerID1
image: ubuntu
command: ""
created_at: %s
status:
names: foobar_baz
labels:
ports:
size: 0 B
container_id: containerID2
image: ubuntu
command: ""
created_at: %s
status:
names: foobar_bar
labels:
ports:
size: 0 B
`, expectedTime, expectedTime),
},
{
ContainerContext{
Context: Context{
Format: "raw",
Quiet: true,
},
},
"container_id: containerID1\ncontainer_id: containerID2\n",
},
// Custom Format
{
ContainerContext{
Context: Context{
Format: "{{.Image}}",
},
},
"ubuntu\nubuntu\n",
},
{
ContainerContext{
Context: Context{
Format: "{{.Image}}",
},
Size: true,
},
"ubuntu\nubuntu\n",
},
}
for _, context := range contexts {
containers := []types.Container{
{ID: "containerID1", Names: []string{"/foobar_baz"}, Image: "ubuntu", Created: unixTime},
{ID: "containerID2", Names: []string{"/foobar_bar"}, Image: "ubuntu", Created: unixTime},
}
out := bytes.NewBufferString("")
context.context.Output = out
context.context.Containers = containers
context.context.Write()
actual := out.String()
if actual != context.expected {
t.Fatalf("Expected \n%s, got \n%s", context.expected, actual)
}
// Clean buffer
out.Reset()
}
}
func TestContainerContextWriteWithNoContainers(t *testing.T) {
out := bytes.NewBufferString("")
containers := []types.Container{}
contexts := []struct {
context ContainerContext
expected string
}{
{
ContainerContext{
Context: Context{
Format: "{{.Image}}",
Output: out,
},
},
"",
},
{
ContainerContext{
Context: Context{
Format: "table {{.Image}}",
Output: out,
},
},
"IMAGE\n",
},
{
ContainerContext{
Context: Context{
Format: "{{.Image}}",
Output: out,
},
Size: true,
},
"",
},
{
ContainerContext{
Context: Context{
Format: "table {{.Image}}",
Output: out,
},
Size: true,
},
"IMAGE\n",
},
{
ContainerContext{
Context: Context{
Format: "table {{.Image}}\t{{.Size}}",
Output: out,
},
},
"IMAGE SIZE\n",
},
{
ContainerContext{
Context: Context{
Format: "table {{.Image}}\t{{.Size}}",
Output: out,
},
Size: true,
},
"IMAGE SIZE\n",
},
}
for _, context := range contexts {
context.context.Containers = containers
context.context.Write()
actual := out.String()
if actual != context.expected {
t.Fatalf("Expected \n%s, got \n%s", context.expected, actual)
}
// Clean buffer
out.Reset()
}
}
func TestImageContextWrite(t *testing.T) {
unixTime := time.Now().AddDate(0, 0, -1).Unix()
expectedTime := time.Unix(unixTime, 0).String()
contexts := []struct {
context ImageContext
expected string
}{
// Errors
{
ImageContext{
Context: Context{
Format: "{{InvalidFunction}}",
},
},
`Template parsing error: template: :1: function "InvalidFunction" not defined
`,
},
{
ImageContext{
Context: Context{
Format: "{{nil}}",
},
},
`Template parsing error: template: :1:2: executing "" at <nil>: nil is not a command
`,
},
// Table Format
{
ImageContext{
Context: Context{
Format: "table",
},
},
`REPOSITORY TAG IMAGE ID CREATED SIZE
image tag1 imageID1 24 hours ago 0 B
image tag2 imageID2 24 hours ago 0 B
<none> <none> imageID3 24 hours ago 0 B
`,
},
{
ImageContext{
Context: Context{
Format: "table {{.Repository}}",
},
},
"REPOSITORY\nimage\nimage\n<none>\n",
},
{
ImageContext{
Context: Context{
Format: "table {{.Repository}}",
},
Digest: true,
},
`REPOSITORY DIGEST
image sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
image <none>
<none> <none>
`,
},
{
ImageContext{
Context: Context{
Format: "table {{.Repository}}",
Quiet: true,
},
},
"REPOSITORY\nimage\nimage\n<none>\n",
},
{
ImageContext{
Context: Context{
Format: "table",
Quiet: true,
},
},
"imageID1\nimageID2\nimageID3\n",
},
{
ImageContext{
Context: Context{
Format: "table",
Quiet: false,
},
Digest: true,
},
`REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
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
`,
},
{
ImageContext{
Context: Context{
Format: "table",
Quiet: true,
},
Digest: true,
},
"imageID1\nimageID2\nimageID3\n",
},
// Raw Format
{
ImageContext{
Context: Context{
Format: "raw",
},
},
fmt.Sprintf(`repository: image
tag: tag1
image_id: imageID1
created_at: %s
virtual_size: 0 B
repository: image
tag: tag2
image_id: imageID2
created_at: %s
virtual_size: 0 B
repository: <none>
tag: <none>
image_id: imageID3
created_at: %s
virtual_size: 0 B
`, expectedTime, expectedTime, expectedTime),
},
{
ImageContext{
Context: Context{
Format: "raw",
},
Digest: true,
},
fmt.Sprintf(`repository: image
tag: tag1
digest: sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
image_id: imageID1
created_at: %s
virtual_size: 0 B
repository: image
tag: tag2
digest: <none>
image_id: imageID2
created_at: %s
virtual_size: 0 B
repository: <none>
tag: <none>
digest: <none>
image_id: imageID3
created_at: %s
virtual_size: 0 B
`, expectedTime, expectedTime, expectedTime),
},
{
ImageContext{
Context: Context{
Format: "raw",
Quiet: true,
},
},
`image_id: imageID1
image_id: imageID2
image_id: imageID3
`,
},
// Custom Format
{
ImageContext{
Context: Context{
Format: "{{.Repository}}",
},
},
"image\nimage\n<none>\n",
},
{
ImageContext{
Context: Context{
Format: "{{.Repository}}",
},
Digest: true,
},
"image\nimage\n<none>\n",
},
}
for _, context := range contexts {
images := []types.Image{
{ID: "imageID1", RepoTags: []string{"image:tag1"}, RepoDigests: []string{"image@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"}, Created: unixTime},
{ID: "imageID2", RepoTags: []string{"image:tag2"}, Created: unixTime},
{ID: "imageID3", RepoTags: []string{"<none>:<none>"}, RepoDigests: []string{"<none>@<none>"}, Created: unixTime},
}
out := bytes.NewBufferString("")
context.context.Output = out
context.context.Images = images
context.context.Write()
actual := out.String()
if actual != context.expected {
t.Fatalf("Expected \n%s, got \n%s", context.expected, actual)
}
// Clean buffer
out.Reset()
}
}
func TestImageContextWriteWithNoImage(t *testing.T) {
out := bytes.NewBufferString("")
images := []types.Image{}
contexts := []struct {
context ImageContext
expected string
}{
{
ImageContext{
Context: Context{
Format: "{{.Repository}}",
Output: out,
},
},
"",
},
{
ImageContext{
Context: Context{
Format: "table {{.Repository}}",
Output: out,
},
},
"REPOSITORY\n",
},
{
ImageContext{
Context: Context{
Format: "{{.Repository}}",
Output: out,
},
Digest: true,
},
"",
},
{
ImageContext{
Context: Context{
Format: "table {{.Repository}}",
Output: out,
},
Digest: true,
},
"REPOSITORY DIGEST\n",
},
}
for _, context := range contexts {
context.context.Images = images
context.context.Write()
actual := out.String()
if actual != context.expected {
t.Fatalf("Expected \n%s, got \n%s", context.expected, actual)
}
// Clean buffer
out.Reset()
}
}

95
api/client/hijack.go Normal file
View file

@ -0,0 +1,95 @@
package client
import (
"io"
"sync"
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/engine-api/types"
)
// HoldHijackedConnection handles copying input to and output from streams to the
// connection
func (cli *DockerCli) HoldHijackedConnection(ctx context.Context, tty bool, inputStream io.ReadCloser, outputStream, errorStream io.Writer, resp types.HijackedResponse) error {
var (
err error
restoreOnce sync.Once
)
if inputStream != nil && tty {
if err := cli.setRawTerminal(); err != nil {
return err
}
defer func() {
restoreOnce.Do(func() {
cli.restoreTerminal(inputStream)
})
}()
}
receiveStdout := make(chan error, 1)
if outputStream != nil || errorStream != nil {
go func() {
// When TTY is ON, use regular copy
if tty && outputStream != nil {
_, err = io.Copy(outputStream, resp.Reader)
// we should restore the terminal as soon as possible once connection end
// so any following print messages will be in normal type.
if inputStream != nil {
restoreOnce.Do(func() {
cli.restoreTerminal(inputStream)
})
}
} else {
_, err = stdcopy.StdCopy(outputStream, errorStream, resp.Reader)
}
logrus.Debug("[hijack] End of stdout")
receiveStdout <- err
}()
}
stdinDone := make(chan struct{})
go func() {
if inputStream != nil {
io.Copy(resp.Conn, inputStream)
// we should restore the terminal as soon as possible once connection end
// so any following print messages will be in normal type.
if tty {
restoreOnce.Do(func() {
cli.restoreTerminal(inputStream)
})
}
logrus.Debug("[hijack] End of stdin")
}
if err := resp.CloseWrite(); err != nil {
logrus.Debugf("Couldn't send EOF: %s", err)
}
close(stdinDone)
}()
select {
case err := <-receiveStdout:
if err != nil {
logrus.Debugf("Error receiveStdout: %s", err)
return err
}
case <-stdinDone:
if outputStream != nil || errorStream != nil {
select {
case err := <-receiveStdout:
if err != nil {
logrus.Debugf("Error receiveStdout: %s", err)
return err
}
case <-ctx.Done():
}
}
case <-ctx.Done():
}
return nil
}

View file

@ -0,0 +1,70 @@
package idresolver
import (
"fmt"
"golang.org/x/net/context"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types/swarm"
)
// IDResolver provides ID to Name resolution.
type IDResolver struct {
client client.APIClient
noResolve bool
cache map[string]string
}
// New creates a new IDResolver.
func New(client client.APIClient, noResolve bool) *IDResolver {
return &IDResolver{
client: client,
noResolve: noResolve,
cache: make(map[string]string),
}
}
func (r *IDResolver) get(ctx context.Context, t interface{}, id string) (string, error) {
switch t.(type) {
case swarm.Node:
node, _, err := r.client.NodeInspectWithRaw(ctx, id)
if err != nil {
return id, nil
}
if node.Spec.Annotations.Name != "" {
return node.Spec.Annotations.Name, nil
}
if node.Description.Hostname != "" {
return node.Description.Hostname, nil
}
return id, nil
case swarm.Service:
service, _, err := r.client.ServiceInspectWithRaw(ctx, id)
if err != nil {
return id, nil
}
return service.Spec.Annotations.Name, nil
default:
return "", fmt.Errorf("unsupported type")
}
}
// Resolve will attempt to resolve an ID to a Name by querying the manager.
// Results are stored into a cache.
// If the `-n` flag is used in the command-line, resolution is disabled.
func (r *IDResolver) Resolve(ctx context.Context, t interface{}, id string) (string, error) {
if r.noResolve {
return id, nil
}
if name, ok := r.cache[id]; ok {
return name, nil
}
name, err := r.get(ctx, t, id)
if err != nil {
return "", err
}
r.cache[id] = name
return name, nil
}

433
api/client/image/build.go Normal file
View file

@ -0,0 +1,433 @@
package image
import (
"archive/tar"
"bufio"
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"regexp"
"runtime"
"golang.org/x/net/context"
"github.com/docker/docker/api"
"github.com/docker/docker/api/client"
"github.com/docker/docker/builder"
"github.com/docker/docker/builder/dockerignore"
"github.com/docker/docker/cli"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/progress"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/reference"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/docker/go-units"
"github.com/spf13/cobra"
)
type buildOptions struct {
context string
dockerfileName string
tags opts.ListOpts
labels opts.ListOpts
buildArgs opts.ListOpts
ulimits *runconfigopts.UlimitOpt
memory string
memorySwap string
shmSize string
cpuShares int64
cpuPeriod int64
cpuQuota int64
cpuSetCpus string
cpuSetMems string
cgroupParent string
isolation string
quiet bool
noCache bool
rm bool
forceRm bool
pull bool
}
// NewBuildCommand creates a new `docker build` command
func NewBuildCommand(dockerCli *client.DockerCli) *cobra.Command {
ulimits := make(map[string]*units.Ulimit)
options := buildOptions{
tags: opts.NewListOpts(validateTag),
buildArgs: opts.NewListOpts(runconfigopts.ValidateEnv),
ulimits: runconfigopts.NewUlimitOpt(&ulimits),
labels: opts.NewListOpts(runconfigopts.ValidateEnv),
}
cmd := &cobra.Command{
Use: "build [OPTIONS] PATH | URL | -",
Short: "Build an image from a Dockerfile",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
options.context = args[0]
return runBuild(dockerCli, options)
},
}
flags := cmd.Flags()
flags.VarP(&options.tags, "tag", "t", "Name and optionally a tag in the 'name:tag' format")
flags.Var(&options.buildArgs, "build-arg", "Set build-time variables")
flags.Var(options.ulimits, "ulimit", "Ulimit options")
flags.StringVarP(&options.dockerfileName, "file", "f", "", "Name of the Dockerfile (Default is 'PATH/Dockerfile')")
flags.StringVarP(&options.memory, "memory", "m", "", "Memory limit")
flags.StringVar(&options.memorySwap, "memory-swap", "", "Swap limit equal to memory plus swap: '-1' to enable unlimited swap")
flags.StringVar(&options.shmSize, "shm-size", "", "Size of /dev/shm, default value is 64MB")
flags.Int64VarP(&options.cpuShares, "cpu-shares", "c", 0, "CPU shares (relative weight)")
flags.Int64Var(&options.cpuPeriod, "cpu-period", 0, "Limit the CPU CFS (Completely Fair Scheduler) period")
flags.Int64Var(&options.cpuQuota, "cpu-quota", 0, "Limit the CPU CFS (Completely Fair Scheduler) quota")
flags.StringVar(&options.cpuSetCpus, "cpuset-cpus", "", "CPUs in which to allow execution (0-3, 0,1)")
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.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")
flags.BoolVarP(&options.quiet, "quiet", "q", false, "Suppress the build output and print image ID on success")
flags.BoolVar(&options.pull, "pull", false, "Always attempt to pull a newer version of the image")
client.AddTrustedFlags(flags, true)
return cmd
}
func runBuild(dockerCli *client.DockerCli, options buildOptions) error {
var (
buildCtx io.ReadCloser
err error
)
specifiedContext := options.context
var (
contextDir string
tempDir string
relDockerfile string
progBuff io.Writer
buildBuff io.Writer
)
progBuff = dockerCli.Out()
buildBuff = dockerCli.Out()
if options.quiet {
progBuff = bytes.NewBuffer(nil)
buildBuff = bytes.NewBuffer(nil)
}
switch {
case specifiedContext == "-":
buildCtx, relDockerfile, err = builder.GetContextFromReader(dockerCli.In(), options.dockerfileName)
case urlutil.IsGitURL(specifiedContext):
tempDir, relDockerfile, err = builder.GetContextFromGitURL(specifiedContext, options.dockerfileName)
case urlutil.IsURL(specifiedContext):
buildCtx, relDockerfile, err = builder.GetContextFromURL(progBuff, specifiedContext, options.dockerfileName)
default:
contextDir, relDockerfile, err = builder.GetContextFromLocalDir(specifiedContext, options.dockerfileName)
}
if err != nil {
if options.quiet && urlutil.IsURL(specifiedContext) {
fmt.Fprintln(dockerCli.Err(), progBuff)
}
return fmt.Errorf("unable to prepare context: %s", err)
}
if tempDir != "" {
defer os.RemoveAll(tempDir)
contextDir = tempDir
}
if buildCtx == nil {
// And canonicalize dockerfile name to a platform-independent one
relDockerfile, err = archive.CanonicalTarNameForPath(relDockerfile)
if err != nil {
return fmt.Errorf("cannot canonicalize dockerfile path %s: %v", relDockerfile, err)
}
f, err := os.Open(filepath.Join(contextDir, ".dockerignore"))
if err != nil && !os.IsNotExist(err) {
return err
}
var excludes []string
if err == nil {
excludes, err = dockerignore.ReadAll(f)
if err != nil {
return err
}
}
if err := builder.ValidateContextDirectory(contextDir, excludes); err != nil {
return fmt.Errorf("Error checking context: '%s'.", err)
}
// If .dockerignore mentions .dockerignore or the Dockerfile
// then make sure we send both files over to the daemon
// because Dockerfile is, obviously, needed no matter what, and
// .dockerignore is needed to know if either one needs to be
// removed. The daemon will remove them for us, if needed, after it
// parses the Dockerfile. Ignore errors here, as they will have been
// caught by validateContextDirectory above.
var includes = []string{"."}
keepThem1, _ := fileutils.Matches(".dockerignore", excludes)
keepThem2, _ := fileutils.Matches(relDockerfile, excludes)
if keepThem1 || keepThem2 {
includes = append(includes, ".dockerignore", relDockerfile)
}
buildCtx, err = archive.TarWithOptions(contextDir, &archive.TarOptions{
Compression: archive.Uncompressed,
ExcludePatterns: excludes,
IncludeFiles: includes,
})
if err != nil {
return err
}
}
ctx := context.Background()
var resolvedTags []*resolvedTag
if client.IsTrusted() {
// Wrap the tar archive to replace the Dockerfile entry with the rewritten
// Dockerfile which uses trusted pulls.
buildCtx = replaceDockerfileTarWrapper(ctx, buildCtx, relDockerfile, dockerCli.TrustedReference, &resolvedTags)
}
// Setup an upload progress bar
progressOutput := streamformatter.NewStreamFormatter().NewProgressOutput(progBuff, true)
var body io.Reader = progress.NewProgressReader(buildCtx, progressOutput, 0, "", "Sending build context to Docker daemon")
var memory int64
if options.memory != "" {
parsedMemory, err := units.RAMInBytes(options.memory)
if err != nil {
return err
}
memory = parsedMemory
}
var memorySwap int64
if options.memorySwap != "" {
if options.memorySwap == "-1" {
memorySwap = -1
} else {
parsedMemorySwap, err := units.RAMInBytes(options.memorySwap)
if err != nil {
return err
}
memorySwap = parsedMemorySwap
}
}
var shmSize int64
if options.shmSize != "" {
shmSize, err = units.RAMInBytes(options.shmSize)
if err != nil {
return err
}
}
buildOptions := types.ImageBuildOptions{
Memory: memory,
MemorySwap: memorySwap,
Tags: options.tags.GetAll(),
SuppressOutput: options.quiet,
NoCache: options.noCache,
Remove: options.rm,
ForceRemove: options.forceRm,
PullParent: options.pull,
Isolation: container.Isolation(options.isolation),
CPUSetCPUs: options.cpuSetCpus,
CPUSetMems: options.cpuSetMems,
CPUShares: options.cpuShares,
CPUQuota: options.cpuQuota,
CPUPeriod: options.cpuPeriod,
CgroupParent: options.cgroupParent,
Dockerfile: relDockerfile,
ShmSize: shmSize,
Ulimits: options.ulimits.GetList(),
BuildArgs: runconfigopts.ConvertKVStringsToMap(options.buildArgs.GetAll()),
AuthConfigs: dockerCli.RetrieveAuthConfigs(),
Labels: runconfigopts.ConvertKVStringsToMap(options.labels.GetAll()),
}
response, err := dockerCli.Client().ImageBuild(ctx, body, buildOptions)
if err != nil {
return err
}
defer response.Body.Close()
err = jsonmessage.DisplayJSONMessagesStream(response.Body, buildBuff, dockerCli.OutFd(), dockerCli.IsTerminalOut(), nil)
if err != nil {
if jerr, ok := err.(*jsonmessage.JSONError); ok {
// If no error code is set, default to 1
if jerr.Code == 0 {
jerr.Code = 1
}
if options.quiet {
fmt.Fprintf(dockerCli.Err(), "%s%s", progBuff, buildBuff)
}
return cli.StatusError{Status: jerr.Message, StatusCode: jerr.Code}
}
}
// Windows: show error message about modified file permissions if the
// daemon isn't running Windows.
if response.OSType != "windows" && runtime.GOOS == "windows" {
fmt.Fprintln(dockerCli.Err(), `SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`)
}
// Everything worked so if -q was provided the output from the daemon
// should be just the image ID and we'll print that to stdout.
if options.quiet {
fmt.Fprintf(dockerCli.Out(), "%s", buildBuff)
}
if client.IsTrusted() {
// Since the build was successful, now we must tag any of the resolved
// images from the above Dockerfile rewrite.
for _, resolved := range resolvedTags {
if err := dockerCli.TagTrusted(ctx, resolved.digestRef, resolved.tagRef); err != nil {
return err
}
}
}
return nil
}
type translatorFunc func(context.Context, reference.NamedTagged) (reference.Canonical, error)
// validateTag checks if the given image name can be resolved.
func validateTag(rawRepo string) (string, error) {
_, err := reference.ParseNamed(rawRepo)
if err != nil {
return "", err
}
return rawRepo, nil
}
var dockerfileFromLinePattern = regexp.MustCompile(`(?i)^[\s]*FROM[ \f\r\t\v]+(?P<image>[^ \f\r\t\v\n#]+)`)
// resolvedTag records the repository, tag, and resolved digest reference
// from a Dockerfile rewrite.
type resolvedTag struct {
digestRef reference.Canonical
tagRef reference.NamedTagged
}
// rewriteDockerfileFrom rewrites the given Dockerfile by resolving images in
// "FROM <image>" instructions to a digest reference. `translator` is a
// function that takes a repository name and tag reference and returns a
// trusted digest reference.
func rewriteDockerfileFrom(ctx context.Context, dockerfile io.Reader, translator translatorFunc) (newDockerfile []byte, resolvedTags []*resolvedTag, err error) {
scanner := bufio.NewScanner(dockerfile)
buf := bytes.NewBuffer(nil)
// Scan the lines of the Dockerfile, looking for a "FROM" line.
for scanner.Scan() {
line := scanner.Text()
matches := dockerfileFromLinePattern.FindStringSubmatch(line)
if matches != nil && matches[1] != api.NoBaseImageSpecifier {
// Replace the line with a resolved "FROM repo@digest"
ref, err := reference.ParseNamed(matches[1])
if err != nil {
return nil, nil, err
}
ref = reference.WithDefaultTag(ref)
if ref, ok := ref.(reference.NamedTagged); ok && client.IsTrusted() {
trustedRef, err := translator(ctx, ref)
if err != nil {
return nil, nil, err
}
line = dockerfileFromLinePattern.ReplaceAllLiteralString(line, fmt.Sprintf("FROM %s", trustedRef.String()))
resolvedTags = append(resolvedTags, &resolvedTag{
digestRef: trustedRef,
tagRef: ref,
})
}
}
_, err := fmt.Fprintln(buf, line)
if err != nil {
return nil, nil, err
}
}
return buf.Bytes(), resolvedTags, scanner.Err()
}
// replaceDockerfileTarWrapper wraps the given input tar archive stream and
// replaces the entry with the given Dockerfile name with the contents of the
// new Dockerfile. Returns a new tar archive stream with the replaced
// Dockerfile.
func replaceDockerfileTarWrapper(ctx context.Context, inputTarStream io.ReadCloser, dockerfileName string, translator translatorFunc, resolvedTags *[]*resolvedTag) io.ReadCloser {
pipeReader, pipeWriter := io.Pipe()
go func() {
tarReader := tar.NewReader(inputTarStream)
tarWriter := tar.NewWriter(pipeWriter)
defer inputTarStream.Close()
for {
hdr, err := tarReader.Next()
if err == io.EOF {
// Signals end of archive.
tarWriter.Close()
pipeWriter.Close()
return
}
if err != nil {
pipeWriter.CloseWithError(err)
return
}
var content io.Reader = tarReader
if hdr.Name == dockerfileName {
// This entry is the Dockerfile. Since the tar archive was
// generated from a directory on the local filesystem, the
// Dockerfile will only appear once in the archive.
var newDockerfile []byte
newDockerfile, *resolvedTags, err = rewriteDockerfileFrom(ctx, content, translator)
if err != nil {
pipeWriter.CloseWithError(err)
return
}
hdr.Size = int64(len(newDockerfile))
content = bytes.NewBuffer(newDockerfile)
}
if err := tarWriter.WriteHeader(hdr); err != nil {
pipeWriter.CloseWithError(err)
return
}
if _, err := io.Copy(tarWriter, content); err != nil {
pipeWriter.CloseWithError(err)
return
}
}
}()
return pipeReader
}

View file

@ -0,0 +1,99 @@
package image
import (
"fmt"
"strconv"
"strings"
"text/tabwriter"
"time"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/go-units"
"github.com/spf13/cobra"
)
type historyOptions struct {
image string
human bool
quiet bool
noTrunc bool
}
// NewHistoryCommand create a new `docker history` command
func NewHistoryCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts historyOptions
cmd := &cobra.Command{
Use: "history [OPTIONS] IMAGE",
Short: "Show the history of an image",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.image = args[0]
return runHistory(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.human, "human", "H", true, "Print sizes and dates in human readable format")
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Only show numeric IDs")
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Don't truncate output")
return cmd
}
func runHistory(dockerCli *client.DockerCli, opts historyOptions) error {
ctx := context.Background()
history, err := dockerCli.Client().ImageHistory(ctx, opts.image)
if err != nil {
return err
}
w := tabwriter.NewWriter(dockerCli.Out(), 20, 1, 3, ' ', 0)
if opts.quiet {
for _, entry := range history {
if opts.noTrunc {
fmt.Fprintf(w, "%s\n", entry.ID)
} else {
fmt.Fprintf(w, "%s\n", stringid.TruncateID(entry.ID))
}
}
w.Flush()
return nil
}
var imageID string
var createdBy string
var created string
var size string
fmt.Fprintln(w, "IMAGE\tCREATED\tCREATED BY\tSIZE\tCOMMENT")
for _, entry := range history {
imageID = entry.ID
createdBy = strings.Replace(entry.CreatedBy, "\t", " ", -1)
if opts.noTrunc == false {
createdBy = stringutils.Truncate(createdBy, 45)
imageID = stringid.TruncateID(entry.ID)
}
if opts.human {
created = units.HumanDuration(time.Now().UTC().Sub(time.Unix(entry.Created, 0))) + " ago"
size = units.HumanSize(float64(entry.Size))
} else {
created = time.Unix(entry.Created, 0).Format(time.RFC3339)
size = strconv.FormatInt(entry.Size, 10)
}
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", imageID, created, createdBy, size, entry.Comment)
}
w.Flush()
return nil
}

103
api/client/image/images.go Normal file
View file

@ -0,0 +1,103 @@
package image
import (
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/api/client/formatter"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
"github.com/spf13/cobra"
)
type imagesOptions struct {
matchName string
quiet bool
all bool
noTrunc bool
showDigests bool
format string
filter []string
}
// NewImagesCommand create a new `docker images` command
func NewImagesCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts imagesOptions
cmd := &cobra.Command{
Use: "images [OPTIONS] [REPOSITORY[:TAG]]",
Short: "List images",
Args: cli.RequiresMaxArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) > 0 {
opts.matchName = args[0]
}
return runImages(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Only show numeric IDs")
flags.BoolVarP(&opts.all, "all", "a", false, "Show all images (default hides intermediate images)")
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Don't truncate output")
flags.BoolVar(&opts.showDigests, "digests", false, "Show digests")
flags.StringVar(&opts.format, "format", "", "Pretty-print images using a Go template")
flags.StringSliceVarP(&opts.filter, "filter", "f", []string{}, "Filter output based on conditions provided")
return cmd
}
func runImages(dockerCli *client.DockerCli, opts imagesOptions) error {
ctx := context.Background()
// Consolidate all filter flags, and sanity check them early.
// They'll get process in the daemon/server.
imageFilterArgs := filters.NewArgs()
for _, f := range opts.filter {
var err error
imageFilterArgs, err = filters.ParseFlag(f, imageFilterArgs)
if err != nil {
return err
}
}
matchName := opts.matchName
options := types.ImageListOptions{
MatchName: matchName,
All: opts.all,
Filters: imageFilterArgs,
}
images, err := dockerCli.Client().ImageList(ctx, options)
if err != nil {
return err
}
f := opts.format
if len(f) == 0 {
if len(dockerCli.ImagesFormat()) > 0 && !opts.quiet {
f = dockerCli.ImagesFormat()
} else {
f = "table"
}
}
imagesCtx := formatter.ImageContext{
Context: formatter.Context{
Output: dockerCli.Out(),
Format: f,
Quiet: opts.quiet,
Trunc: !opts.noTrunc,
},
Digest: opts.showDigests,
Images: images,
}
imagesCtx.Write()
return nil
}

View file

@ -0,0 +1,86 @@
package image
import (
"io"
"os"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
type importOptions struct {
source string
reference string
changes []string
message string
}
// NewImportCommand creates a new `docker import` command
func NewImportCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts importOptions
cmd := &cobra.Command{
Use: "import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]",
Short: "Import the contents from a tarball to create a filesystem image",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.source = args[0]
if len(args) > 1 {
opts.reference = args[1]
}
return runImport(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.StringSliceVarP(&opts.changes, "change", "c", []string{}, "Apply Dockerfile instruction to the created image")
flags.StringVarP(&opts.message, "message", "m", "", "Set commit message for imported image")
return cmd
}
func runImport(dockerCli *client.DockerCli, opts importOptions) error {
var (
in io.Reader
srcName = opts.source
)
if opts.source == "-" {
in = dockerCli.In()
} else if !urlutil.IsURL(opts.source) {
srcName = "-"
file, err := os.Open(opts.source)
if err != nil {
return err
}
defer file.Close()
in = file
}
source := types.ImageImportSource{
Source: in,
SourceName: srcName,
}
options := types.ImageImportOptions{
Message: opts.message,
Changes: opts.changes,
}
clnt := dockerCli.Client()
responseBody, err := clnt.ImageImport(context.Background(), source, opts.reference, options)
if err != nil {
return err
}
defer responseBody.Close()
return jsonmessage.DisplayJSONMessagesStream(responseBody, dockerCli.Out(), dockerCli.OutFd(), dockerCli.IsTerminalOut(), nil)
}

67
api/client/image/load.go Normal file
View file

@ -0,0 +1,67 @@
package image
import (
"io"
"os"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/spf13/cobra"
)
type loadOptions struct {
input string
quiet bool
}
// NewLoadCommand creates a new `docker load` command
func NewLoadCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts loadOptions
cmd := &cobra.Command{
Use: "load [OPTIONS]",
Short: "Load an image from a tar archive or STDIN",
Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return runLoad(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.StringVarP(&opts.input, "input", "i", "", "Read from tar archive file, instead of STDIN")
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Suppress the load output")
return cmd
}
func runLoad(dockerCli *client.DockerCli, opts loadOptions) error {
var input io.Reader = dockerCli.In()
if opts.input != "" {
file, err := os.Open(opts.input)
if err != nil {
return err
}
defer file.Close()
input = file
}
if !dockerCli.IsTerminalOut() {
opts.quiet = true
}
response, err := dockerCli.Client().ImageLoad(context.Background(), input, opts.quiet)
if err != nil {
return err
}
defer response.Body.Close()
if response.Body != nil && response.JSON {
return jsonmessage.DisplayJSONMessagesStream(response.Body, dockerCli.Out(), dockerCli.OutFd(), dockerCli.IsTerminalOut(), nil)
}
_, err = io.Copy(dockerCli.Out(), response.Body)
return err
}

89
api/client/image/pull.go Normal file
View file

@ -0,0 +1,89 @@
package image
import (
"errors"
"fmt"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/reference"
"github.com/docker/docker/registry"
"github.com/spf13/cobra"
)
type pullOptions struct {
remote string
all bool
}
// NewPullCommand creates a new `docker pull` command
func NewPullCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts pullOptions
cmd := &cobra.Command{
Use: "pull [OPTIONS] NAME[:TAG|@DIGEST]",
Short: "Pull an image or a repository from a registry",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.remote = args[0]
return runPull(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.all, "all-tags", "a", false, "Download all tagged images in the repository")
client.AddTrustedFlags(flags, true)
return cmd
}
func runPull(dockerCli *client.DockerCli, opts pullOptions) error {
distributionRef, err := reference.ParseNamed(opts.remote)
if err != nil {
return err
}
if opts.all && !reference.IsNameOnly(distributionRef) {
return errors.New("tag can't be used with --all-tags/-a")
}
if !opts.all && reference.IsNameOnly(distributionRef) {
distributionRef = reference.WithDefaultTag(distributionRef)
fmt.Fprintf(dockerCli.Out(), "Using default tag: %s\n", reference.DefaultTag)
}
var tag string
switch x := distributionRef.(type) {
case reference.Canonical:
tag = x.Digest().String()
case reference.NamedTagged:
tag = x.Tag()
}
registryRef := registry.ParseReference(tag)
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(distributionRef)
if err != nil {
return err
}
ctx := context.Background()
authConfig := dockerCli.ResolveAuthConfig(ctx, repoInfo.Index)
requestPrivilege := dockerCli.RegistryAuthenticationPrivilegedFunc(repoInfo.Index, "pull")
if client.IsTrusted() && !registryRef.HasDigest() {
// Check if tag is digest
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 nil
}

62
api/client/image/push.go Normal file
View file

@ -0,0 +1,62 @@
package image
import (
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/reference"
"github.com/docker/docker/registry"
"github.com/spf13/cobra"
)
// NewPushCommand creates a new `docker push` command
func NewPushCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
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 {
return runPush(dockerCli, args[0])
},
}
flags := cmd.Flags()
client.AddTrustedFlags(flags, true)
return cmd
}
func runPush(dockerCli *client.DockerCli, remote string) error {
ref, err := reference.ParseNamed(remote)
if err != nil {
return err
}
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(ref)
if err != nil {
return err
}
ctx := context.Background()
// Resolve the Auth config relevant for this server
authConfig := dockerCli.ResolveAuthConfig(ctx, repoInfo.Index)
requestPrivilege := dockerCli.RegistryAuthenticationPrivilegedFunc(repoInfo.Index, "push")
if client.IsTrusted() {
return dockerCli.TrustedPush(ctx, repoInfo, ref, authConfig, requestPrivilege)
}
responseBody, err := dockerCli.ImagePushPrivileged(ctx, authConfig, ref.String(), requestPrivilege)
if err != nil {
return err
}
defer responseBody.Close()
return jsonmessage.DisplayJSONMessagesStream(responseBody, dockerCli.Out(), dockerCli.OutFd(), dockerCli.IsTerminalOut(), nil)
}

View file

@ -0,0 +1,70 @@
package image
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)
type removeOptions struct {
force bool
noPrune bool
}
// NewRemoveCommand create a new `docker remove` command
func NewRemoveCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts removeOptions
cmd := &cobra.Command{
Use: "rmi [OPTIONS] IMAGE [IMAGE...]",
Short: "Remove one or more images",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runRemove(dockerCli, opts, args)
},
}
flags := cmd.Flags()
flags.BoolVarP(&opts.force, "force", "f", false, "Force removal of the image")
flags.BoolVar(&opts.noPrune, "no-prune", false, "Do not delete untagged parents")
return cmd
}
func runRemove(dockerCli *client.DockerCli, opts removeOptions, images []string) error {
client := dockerCli.Client()
ctx := context.Background()
options := types.ImageRemoveOptions{
Force: opts.force,
PruneChildren: !opts.noPrune,
}
var errs []string
for _, image := range images {
dels, err := client.ImageRemove(ctx, image, options)
if err != nil {
errs = append(errs, err.Error())
} else {
for _, del := range dels {
if del.Deleted != "" {
fmt.Fprintf(dockerCli.Out(), "Deleted: %s\n", del.Deleted)
} else {
fmt.Fprintf(dockerCli.Out(), "Untagged: %s\n", del.Untagged)
}
}
}
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, "\n"))
}
return nil
}

57
api/client/image/save.go Normal file
View file

@ -0,0 +1,57 @@
package image
import (
"errors"
"io"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type saveOptions struct {
images []string
output string
}
// NewSaveCommand creates a new `docker save` command
func NewSaveCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts saveOptions
cmd := &cobra.Command{
Use: "save [OPTIONS] IMAGE [IMAGE...]",
Short: "Save one or more images to a tar archive (streamed to STDOUT by default)",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.images = args
return runSave(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.StringVarP(&opts.output, "output", "o", "", "Write to a file, instead of STDOUT")
return cmd
}
func runSave(dockerCli *client.DockerCli, opts saveOptions) error {
if opts.output == "" && dockerCli.IsTerminalOut() {
return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
}
responseBody, err := dockerCli.Client().ImageSave(context.Background(), opts.images)
if err != nil {
return err
}
defer responseBody.Close()
if opts.output == "" {
_, err := io.Copy(dockerCli.Out(), responseBody)
return err
}
return client.CopyToFile(opts.output, responseBody)
}

135
api/client/image/search.go Normal file
View file

@ -0,0 +1,135 @@
package image
import (
"fmt"
"sort"
"strings"
"text/tabwriter"
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/docker/registry"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/filters"
registrytypes "github.com/docker/engine-api/types/registry"
"github.com/spf13/cobra"
)
type searchOptions struct {
term string
noTrunc bool
limit int
filter []string
// Deprecated
stars uint
automated bool
}
// NewSearchCommand create a new `docker search` command
func NewSearchCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts searchOptions
cmd := &cobra.Command{
Use: "search [OPTIONS] TERM",
Short: "Search the Docker Hub for images",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.term = args[0]
return runSearch(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Don't truncate output")
flags.StringSliceVarP(&opts.filter, "filter", "f", []string{}, "Filter output based on conditions provided")
flags.IntVar(&opts.limit, "limit", registry.DefaultSearchLimit, "Max number of search results")
flags.BoolVar(&opts.automated, "automated", false, "Only show automated builds")
flags.UintVarP(&opts.stars, "stars", "s", 0, "Only displays with at least x stars")
flags.MarkDeprecated("automated", "use --filter=automated=true instead")
flags.MarkDeprecated("stars", "use --filter=stars=3 instead")
return cmd
}
func runSearch(dockerCli *client.DockerCli, opts searchOptions) error {
indexInfo, err := registry.ParseSearchIndexInfo(opts.term)
if err != nil {
return err
}
ctx := context.Background()
authConfig := dockerCli.ResolveAuthConfig(ctx, indexInfo)
requestPrivilege := dockerCli.RegistryAuthenticationPrivilegedFunc(indexInfo, "search")
encodedAuth, err := client.EncodeAuthToBase64(authConfig)
if err != nil {
return err
}
searchFilters := filters.NewArgs()
for _, f := range opts.filter {
var err error
searchFilters, err = filters.ParseFlag(f, searchFilters)
if err != nil {
return err
}
}
options := types.ImageSearchOptions{
RegistryAuth: encodedAuth,
PrivilegeFunc: requestPrivilege,
Filters: searchFilters,
Limit: opts.limit,
}
clnt := dockerCli.Client()
unorderedResults, err := clnt.ImageSearch(ctx, opts.term, options)
if err != nil {
return err
}
results := searchResultsByStars(unorderedResults)
sort.Sort(results)
w := tabwriter.NewWriter(dockerCli.Out(), 10, 1, 3, ' ', 0)
fmt.Fprintf(w, "NAME\tDESCRIPTION\tSTARS\tOFFICIAL\tAUTOMATED\n")
for _, res := range results {
// --automated and -s, --stars are deprecated since Docker 1.12
if (opts.automated && !res.IsAutomated) || (int(opts.stars) > res.StarCount) {
continue
}
desc := strings.Replace(res.Description, "\n", " ", -1)
desc = strings.Replace(desc, "\r", " ", -1)
if !opts.noTrunc && len(desc) > 45 {
desc = stringutils.Truncate(desc, 42) + "..."
}
fmt.Fprintf(w, "%s\t%s\t%d\t", res.Name, desc, res.StarCount)
if res.IsOfficial {
fmt.Fprint(w, "[OK]")
}
fmt.Fprint(w, "\t")
if res.IsAutomated {
fmt.Fprint(w, "[OK]")
}
fmt.Fprint(w, "\n")
}
w.Flush()
return nil
}
// SearchResultsByStars sorts search results in descending order by number of stars.
type searchResultsByStars []registrytypes.SearchResult
func (r searchResultsByStars) Len() int { return len(r) }
func (r searchResultsByStars) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r searchResultsByStars) Less(i, j int) bool { return r[j].StarCount < r[i].StarCount }

41
api/client/image/tag.go Normal file
View file

@ -0,0 +1,41 @@
package image
import (
"golang.org/x/net/context"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/spf13/cobra"
)
type tagOptions struct {
image string
name string
}
// NewTagCommand create a new `docker tag` command
func NewTagCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts tagOptions
cmd := &cobra.Command{
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 {
opts.image = args[0]
opts.name = args[1]
return runTag(dockerCli, opts)
},
}
flags := cmd.Flags()
flags.SetInterspersed(false)
return cmd
}
func runTag(dockerCli *client.DockerCli, opts tagOptions) error {
ctx := context.Background()
return dockerCli.Client().ImageTag(ctx, opts.image, opts.name)
}

215
api/client/info.go Normal file
View file

@ -0,0 +1,215 @@
package client
import (
"fmt"
"strings"
"time"
"golang.org/x/net/context"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/pkg/ioutils"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/utils"
"github.com/docker/engine-api/types/swarm"
"github.com/docker/go-units"
)
// CmdInfo displays system-wide information.
//
// Usage: docker info
func (cli *DockerCli) CmdInfo(args ...string) error {
cmd := Cli.Subcmd("info", nil, Cli.DockerCommands["info"].Description, true)
cmd.Require(flag.Exact, 0)
cmd.ParseFlags(args, true)
ctx := context.Background()
info, err := cli.client.Info(ctx)
if err != nil {
return err
}
fmt.Fprintf(cli.out, "Containers: %d\n", info.Containers)
fmt.Fprintf(cli.out, " Running: %d\n", info.ContainersRunning)
fmt.Fprintf(cli.out, " Paused: %d\n", info.ContainersPaused)
fmt.Fprintf(cli.out, " Stopped: %d\n", info.ContainersStopped)
fmt.Fprintf(cli.out, "Images: %d\n", info.Images)
ioutils.FprintfIfNotEmpty(cli.out, "Server Version: %s\n", info.ServerVersion)
ioutils.FprintfIfNotEmpty(cli.out, "Storage Driver: %s\n", info.Driver)
if info.DriverStatus != nil {
for _, pair := range info.DriverStatus {
fmt.Fprintf(cli.out, " %s: %s\n", pair[0], pair[1])
// 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. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.")
}
}
}
if info.SystemStatus != nil {
for _, pair := range info.SystemStatus {
fmt.Fprintf(cli.out, "%s: %s\n", pair[0], pair[1])
}
}
ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Cgroup Driver: %s\n", info.CgroupDriver)
fmt.Fprintf(cli.out, "Plugins:\n")
fmt.Fprintf(cli.out, " Volume:")
fmt.Fprintf(cli.out, " %s", strings.Join(info.Plugins.Volume, " "))
fmt.Fprintf(cli.out, "\n")
fmt.Fprintf(cli.out, " Network:")
fmt.Fprintf(cli.out, " %s", strings.Join(info.Plugins.Network, " "))
fmt.Fprintf(cli.out, "\n")
if len(info.Plugins.Authorization) != 0 {
fmt.Fprintf(cli.out, " Authorization:")
fmt.Fprintf(cli.out, " %s", strings.Join(info.Plugins.Authorization, " "))
fmt.Fprintf(cli.out, "\n")
}
fmt.Fprintf(cli.out, "Swarm: %v\n", info.Swarm.LocalNodeState)
if info.Swarm.LocalNodeState != swarm.LocalNodeStateInactive {
fmt.Fprintf(cli.out, " NodeID: %s\n", info.Swarm.NodeID)
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, " 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)
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 {
fmt.Fprintf(cli.out, "Runtimes:")
for name := range info.Runtimes {
fmt.Fprintf(cli.out, " %s", name)
}
fmt.Fprint(cli.out, "\n")
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)
ioutils.FprintfIfNotEmpty(cli.out, "Architecture: %s\n", info.Architecture)
fmt.Fprintf(cli.out, "CPUs: %d\n", info.NCPU)
fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(info.MemTotal)))
ioutils.FprintfIfNotEmpty(cli.out, "Name: %s\n", info.Name)
ioutils.FprintfIfNotEmpty(cli.out, "ID: %s\n", info.ID)
fmt.Fprintf(cli.out, "Docker Root Dir: %s\n", info.DockerRootDir)
fmt.Fprintf(cli.out, "Debug Mode (client): %v\n", utils.IsDebugEnabled())
fmt.Fprintf(cli.out, "Debug Mode (server): %v\n", info.Debug)
if info.Debug {
fmt.Fprintf(cli.out, " File Descriptors: %d\n", info.NFd)
fmt.Fprintf(cli.out, " Goroutines: %d\n", info.NGoroutines)
fmt.Fprintf(cli.out, " System Time: %s\n", info.SystemTime)
fmt.Fprintf(cli.out, " EventsListeners: %d\n", info.NEventsListener)
}
ioutils.FprintfIfNotEmpty(cli.out, "Http Proxy: %s\n", info.HTTPProxy)
ioutils.FprintfIfNotEmpty(cli.out, "Https Proxy: %s\n", info.HTTPSProxy)
ioutils.FprintfIfNotEmpty(cli.out, "No Proxy: %s\n", info.NoProxy)
if info.IndexServerAddress != "" {
u := cli.configFile.AuthConfigs[info.IndexServerAddress].Username
if len(u) > 0 {
fmt.Fprintf(cli.out, "Username: %v\n", u)
}
fmt.Fprintf(cli.out, "Registry: %v\n", info.IndexServerAddress)
}
// Only output these warnings if the server does not support these features
if info.OSType != "windows" {
if !info.MemoryLimit {
fmt.Fprintln(cli.err, "WARNING: No memory limit support")
}
if !info.SwapLimit {
fmt.Fprintln(cli.err, "WARNING: No swap limit support")
}
if !info.KernelMemory {
fmt.Fprintln(cli.err, "WARNING: No kernel memory limit support")
}
if !info.OomKillDisable {
fmt.Fprintln(cli.err, "WARNING: No oom kill disable support")
}
if !info.CPUCfsQuota {
fmt.Fprintln(cli.err, "WARNING: No cpu cfs quota support")
}
if !info.CPUCfsPeriod {
fmt.Fprintln(cli.err, "WARNING: No cpu cfs period support")
}
if !info.CPUShares {
fmt.Fprintln(cli.err, "WARNING: No cpu shares support")
}
if !info.CPUSet {
fmt.Fprintln(cli.err, "WARNING: No cpuset support")
}
if !info.IPv4Forwarding {
fmt.Fprintln(cli.err, "WARNING: IPv4 forwarding is disabled")
}
if !info.BridgeNfIptables {
fmt.Fprintln(cli.err, "WARNING: bridge-nf-call-iptables is disabled")
}
if !info.BridgeNfIP6tables {
fmt.Fprintln(cli.err, "WARNING: bridge-nf-call-ip6tables is disabled")
}
}
if info.Labels != nil {
fmt.Fprintln(cli.out, "Labels:")
for _, attribute := range info.Labels {
fmt.Fprintf(cli.out, " %s\n", attribute)
}
}
ioutils.FprintfIfTrue(cli.out, "Experimental: %v\n", info.ExperimentalBuild)
if info.ClusterStore != "" {
fmt.Fprintf(cli.out, "Cluster Store: %s\n", info.ClusterStore)
}
if info.ClusterAdvertise != "" {
fmt.Fprintf(cli.out, "Cluster Advertise: %s\n", info.ClusterAdvertise)
}
if info.RegistryConfig != nil && (len(info.RegistryConfig.InsecureRegistryCIDRs) > 0 || len(info.RegistryConfig.IndexConfigs) > 0) {
fmt.Fprintln(cli.out, "Insecure Registries:")
for _, registry := range info.RegistryConfig.IndexConfigs {
if registry.Secure == false {
fmt.Fprintf(cli.out, " %s\n", registry.Name)
}
}
for _, registry := range info.RegistryConfig.InsecureRegistryCIDRs {
mask, _ := registry.Mask.Size()
fmt.Fprintf(cli.out, " %s/%d\n", registry.IP.String(), mask)
}
}
return nil
}

95
api/client/inspect.go Normal file
View file

@ -0,0 +1,95 @@
package client
import (
"fmt"
"golang.org/x/net/context"
"github.com/docker/docker/api/client/inspect"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/engine-api/client"
)
// CmdInspect displays low-level information on one or more containers, images or tasks.
//
// Usage: docker inspect [OPTIONS] CONTAINER|IMAGE|TASK [CONTAINER|IMAGE|TASK...]
func (cli *DockerCli) CmdInspect(args ...string) error {
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")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
if *inspectType != "" && *inspectType != "container" && *inspectType != "image" && *inspectType != "task" {
return fmt.Errorf("%q is not a valid value for --type", *inspectType)
}
ctx := context.Background()
var elementSearcher inspect.GetRefFunc
switch *inspectType {
case "container":
elementSearcher = cli.inspectContainers(ctx, *size)
case "image":
elementSearcher = cli.inspectImages(ctx, *size)
case "task":
if *size {
fmt.Fprintln(cli.err, "WARNING: --size ignored for tasks")
}
elementSearcher = cli.inspectTasks(ctx)
default:
elementSearcher = cli.inspectAll(ctx, *size)
}
return inspect.Inspect(cli.out, cmd.Args(), *tmplStr, elementSearcher)
}
func (cli *DockerCli) inspectContainers(ctx context.Context, getSize bool) inspect.GetRefFunc {
return func(ref string) (interface{}, []byte, error) {
return cli.client.ContainerInspectWithRaw(ctx, ref, getSize)
}
}
func (cli *DockerCli) inspectImages(ctx context.Context, getSize bool) inspect.GetRefFunc {
return func(ref string) (interface{}, []byte, error) {
return cli.client.ImageInspectWithRaw(ctx, ref, getSize)
}
}
func (cli *DockerCli) inspectTasks(ctx context.Context) inspect.GetRefFunc {
return func(ref string) (interface{}, []byte, error) {
return cli.client.TaskInspectWithRaw(ctx, ref)
}
}
func (cli *DockerCli) inspectAll(ctx context.Context, getSize bool) inspect.GetRefFunc {
return func(ref string) (interface{}, []byte, error) {
c, rawContainer, err := cli.client.ContainerInspectWithRaw(ctx, ref, getSize)
if err != nil {
// Search for image with that id if a container doesn't exist.
if client.IsErrContainerNotFound(err) {
i, rawImage, err := cli.client.ImageInspectWithRaw(ctx, ref, getSize)
if err != nil {
if client.IsErrImageNotFound(err) {
// Search for task with that id if an image doesn't exists.
t, rawTask, err := cli.client.TaskInspectWithRaw(ctx, ref)
if err != nil {
return nil, nil, fmt.Errorf("Error: No such image, container or task: %s", ref)
}
if getSize {
fmt.Fprintln(cli.err, "WARNING: --size ignored for tasks")
}
return t, rawTask, nil
}
return nil, nil, err
}
return i, rawImage, nil
}
return nil, nil, err
}
return c, rawContainer, nil
}
}

View file

@ -0,0 +1,195 @@
package inspect
import (
"bytes"
"encoding/json"
"fmt"
"io"
"text/template"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/cli"
"github.com/docker/docker/utils/templates"
)
// Inspector defines an interface to implement to process elements
type Inspector interface {
Inspect(typedElement interface{}, rawElement []byte) error
Flush() error
}
// TemplateInspector uses a text template to inspect elements.
type TemplateInspector struct {
outputStream io.Writer
buffer *bytes.Buffer
tmpl *template.Template
}
// NewTemplateInspector creates a new inspector with a template.
func NewTemplateInspector(outputStream io.Writer, tmpl *template.Template) Inspector {
return &TemplateInspector{
outputStream: outputStream,
buffer: new(bytes.Buffer),
tmpl: tmpl,
}
}
// NewTemplateInspectorFromString creates a new TemplateInspector from a string
// which is compiled into a template.
func NewTemplateInspectorFromString(out io.Writer, tmplStr string) (Inspector, error) {
if tmplStr == "" {
return NewIndentedInspector(out), nil
}
tmpl, err := templates.Parse(tmplStr)
if err != nil {
return nil, fmt.Errorf("Template parsing error: %s", err)
}
return NewTemplateInspector(out, tmpl), nil
}
// GetRefFunc is a function which used by Inspect to fetch an object from a
// reference
type GetRefFunc func(ref string) (interface{}, []byte, error)
// Inspect fetches objects by reference using GetRefFunc and writes the json
// representation to the output writer.
func Inspect(out io.Writer, references []string, tmplStr string, getRef GetRefFunc) error {
inspector, err := NewTemplateInspectorFromString(out, tmplStr)
if err != nil {
return cli.StatusError{StatusCode: 64, Status: err.Error()}
}
var inspectErr error
for _, ref := range references {
element, raw, err := getRef(ref)
if err != nil {
inspectErr = err
break
}
if err := inspector.Inspect(element, raw); err != nil {
inspectErr = err
break
}
}
if err := inspector.Flush(); err != nil {
logrus.Errorf("%s\n", err)
}
if inspectErr != nil {
return cli.StatusError{StatusCode: 1, Status: inspectErr.Error()}
}
return nil
}
// Inspect executes the inspect template.
// It decodes the raw element into a map if the initial execution fails.
// This allows docker cli to parse inspect structs injected with Swarm fields.
func (i *TemplateInspector) Inspect(typedElement interface{}, rawElement []byte) error {
buffer := new(bytes.Buffer)
if err := i.tmpl.Execute(buffer, typedElement); err != nil {
if rawElement == nil {
return fmt.Errorf("Template parsing error: %v", err)
}
return i.tryRawInspectFallback(rawElement)
}
i.buffer.Write(buffer.Bytes())
i.buffer.WriteByte('\n')
return nil
}
// tryRawInspectFallback executes the inspect template with a raw interface.
// This allows docker cli to parse inspect structs injected with Swarm fields.
func (i *TemplateInspector) tryRawInspectFallback(rawElement []byte) error {
var raw interface{}
buffer := new(bytes.Buffer)
rdr := bytes.NewReader(rawElement)
dec := json.NewDecoder(rdr)
if rawErr := dec.Decode(&raw); rawErr != nil {
return fmt.Errorf("unable to read inspect data: %v", rawErr)
}
tmplMissingKey := i.tmpl.Option("missingkey=error")
if rawErr := tmplMissingKey.Execute(buffer, raw); rawErr != nil {
return fmt.Errorf("Template parsing error: %v", rawErr)
}
i.buffer.Write(buffer.Bytes())
i.buffer.WriteByte('\n')
return nil
}
// Flush write the result of inspecting all elements into the output stream.
func (i *TemplateInspector) Flush() error {
if i.buffer.Len() == 0 {
_, err := io.WriteString(i.outputStream, "\n")
return err
}
_, err := io.Copy(i.outputStream, i.buffer)
return err
}
// IndentedInspector uses a buffer to stop the indented representation of an element.
type IndentedInspector struct {
outputStream io.Writer
elements []interface{}
rawElements [][]byte
}
// NewIndentedInspector generates a new IndentedInspector.
func NewIndentedInspector(outputStream io.Writer) Inspector {
return &IndentedInspector{
outputStream: outputStream,
}
}
// Inspect writes the raw element with an indented json format.
func (i *IndentedInspector) Inspect(typedElement interface{}, rawElement []byte) error {
if rawElement != nil {
i.rawElements = append(i.rawElements, rawElement)
} else {
i.elements = append(i.elements, typedElement)
}
return nil
}
// Flush write the result of inspecting all elements into the output stream.
func (i *IndentedInspector) Flush() error {
if len(i.elements) == 0 && len(i.rawElements) == 0 {
_, err := io.WriteString(i.outputStream, "[]\n")
return err
}
var buffer io.Reader
if len(i.rawElements) > 0 {
bytesBuffer := new(bytes.Buffer)
bytesBuffer.WriteString("[")
for idx, r := range i.rawElements {
bytesBuffer.Write(r)
if idx < len(i.rawElements)-1 {
bytesBuffer.WriteString(",")
}
}
bytesBuffer.WriteString("]")
indented := new(bytes.Buffer)
if err := json.Indent(indented, bytesBuffer.Bytes(), "", " "); err != nil {
return err
}
buffer = indented
} else {
b, err := json.MarshalIndent(i.elements, "", " ")
if err != nil {
return err
}
buffer = bytes.NewReader(b)
}
if _, err := io.Copy(i.outputStream, buffer); err != nil {
return err
}
_, err := io.WriteString(i.outputStream, "\n")
return err
}

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