Compare commits

...

681 commits

Author SHA1 Message Date
Misty Stanley-Jones
473c5701cb Merge pull request #32332 from mstanleyjones/1.13.x
Cherry-pick command-line ref improvements
2017-04-03 16:54:34 -07:00
Tibor Vass
71e6babfa2 Merge pull request #32215 from tiborvass/docs-yaml-fix-makefile
docs: fix Makefile for yaml docs generation
(cherry picked from commit 5ec88474b7)
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2017-04-03 16:14:49 -07:00
Sebastiaan van Stijn
979cb4fd1e remove Jekyll tags from CLI reference
These Markdown files are now embedded in a YAML
file for templating in the documentation, and
these special markers are no longer needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7e3169f26d)
2017-04-03 16:11:26 -07:00
French Ben
5f730ed857 docs: added support for CLI yaml file generation
Signed-off-by: French Ben <frenchben@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 5443f0152f)
2017-04-03 16:11:17 -07:00
Misty Stanley-Jones
68e914ce62 Standardized formatting of CLI reference commands
Command name should be a H1

Only Description, Examples, and Related Commands should be H2

Changed 'Related information' heading to 'Related commands' since 99% it is only linking commands

Added some examples where relevant

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 52df69f00d)
2017-04-03 15:12:33 -07:00
Victor Vieux
ce07fb6b0f fix CHANGELOG date
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-19 21:03:35 -08:00
Victor Vieux
1c44f35eb1 bump 17.03.1-ce-rc1
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-19 21:02:06 -08:00
Victor Vieux
d1c1b391bc Merge pull request #31170 from aboch/c1.13.x
[1.13.x/17.03.x] Vendoring libnetwork @ce28404
2017-02-19 15:42:59 -08:00
Sebastiaan van Stijn
8b1112be3b Merge pull request #31165 from vieux/update_version_client
[1.13] update client/client.go DefaultVersion
2017-02-19 13:57:04 -08:00
Alessandro Boch
855eb121aa Vendoring libnetwork @ce28404
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-19 13:35:31 -08:00
Victor Vieux
eb04072245 update client/client.gg DefaultVersion
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-19 01:26:16 -08:00
Victor Vieux
c9e1a9e16d Merge pull request #31150 from thaJeztah/1.13.2-completion-scripts
17.03 bash/zsh completion script cherry-picks
2017-02-19 00:46:42 -08:00
Victor Vieux
c9ae02ec59 Merge pull request #31143 from aaronlehmann/vendor-swarmkit-caa9c95
[1.13] Vendor swarmkit 30a4278
2017-02-19 00:46:21 -08:00
Victor Vieux
19460e43f4 Merge pull request #31155 from justincormack/1.13-sync-file-range
[1.13] Allow sync_file_range2 on supported architectures.
2017-02-19 00:39:20 -08:00
Victor Vieux
2a46799a87 Merge pull request #31140 from thaJeztah/1.13.2-cherry-picks
17.03 cherry picks
2017-02-19 00:36:22 -08:00
Gabriel Linder
aedc0ca2fd Allow sync_file_range2 on supported architectures.
Signed-off-by: Gabriel Linder <linder.gabriel@gmail.com>
2017-02-18 15:53:09 +00:00
Brian Goff
05516452d6
Merge pull request #30945 from sdurrheimer/zsh-completion-plugin
Add zsh completion for missing 'docker plugin' commands and options
(cherry picked from commit da9a162301)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-18 00:14:30 -08:00
Brian Goff
b53cef8425
Merge pull request #30944 from sdurrheimer/zsh-completion-build-squash
Add zsh completion for 'docker build --squash'
(cherry picked from commit 0d9bb4ee12)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-18 00:14:22 -08:00
Brian Goff
b975e02386
Merge pull request #30943 from sdurrheimer/zsh-completion-checkpoint
Add zsh completion for 'docker checkpoint' commands
(cherry picked from commit 4f6e4bfd02)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-18 00:14:15 -08:00
Brian Goff
aaff3d513e
Merge pull request #30941 from sdurrheimer/zsh-completion-service-logs
Add zsh completion for 'docker service logs' command
(cherry picked from commit 03db46362e)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-18 00:14:06 -08:00
Sebastiaan van Stijn
d4897c746f
Merge pull request #30940 from sdurrheimer/zsh-completion-swarm-unlock-cmds
Add zsh completion for 'docker swarm unlock|unlock-key' commands
(cherry picked from commit 27ab008626)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-18 00:13:59 -08:00
Vincent Demeester
9287b8f99e
Merge pull request #30939 from sdurrheimer/zsh-completion-swarm-init-update
Add zsh completion for missing 'docker swarm init|update' options
(cherry picked from commit 5d47cb901b)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-18 00:13:50 -08:00
Kenfe-Mickaël Laventure
7a02f05068
Merge pull request #30823 from albers/completion-plugin-upgrade
Add bash completion for `docker plugin upgrade`
(cherry picked from commit c9fa3eed1b)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-18 00:13:31 -08:00
Sebastiaan van Stijn
d4e2280b0f Merge pull request #31134 from thaJeztah/update-swagger
[1.13.x] swagger cherry-picks
2017-02-17 22:26:43 -08:00
Alexander Morozov
ecfddcf227
Merge pull request #29702 from WeiZhang555/stats-all-format-name-panic
Send "Name" and "ID" when stating stopped containers
(cherry picked from commit 22472c8be5)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:15:04 -08:00
Sebastiaan van Stijn
b0e4cf1ad2
Merge pull request #31141 from thaJeztah/swarm-node-error-return-503
fix status-code for "locked" swarm and "certificate expired"
(cherry picked from commit 6486924f0b)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:05:10 -08:00
Vincent Demeester
dffbf0bc73
Merge pull request #31103 from tonistiigi/update-docs-link
Update storage driver options link
(cherry picked from commit e1839ab953)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:05:03 -08:00
Brian Goff
671a4aa4a4
Merge pull request #31070 from cpuguy83/31060_fix_log_read_spin
Fix cpu spin waiting for log write events
(cherry picked from commit 39851eac0c)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:04:56 -08:00
Brian Goff
46af6a6a41
Merge pull request #31006 from vdemeester/30991-secret-mode-in-stack-deploy
Set 0444 as default secret mode in stack deploy
(cherry picked from commit a12454d7a9)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:04:50 -08:00
Brian Goff
87a53468b2
Merge pull request #30113 from thaJeztah/fix-autoremove-on-older-api
Don't use AutoRemove on older daemons
(cherry picked from commit e74623d283)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:04:44 -08:00
Victor Vieux
fe375a64db
Merge pull request #31055 from Microsoft/jjh/fix30278
Windows: Retry workaround for RS1/RS2 compute system enumeration
(cherry picked from commit 7761c69e23)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:04:37 -08:00
Tõnis Tiigi
2e440580bc
Merge pull request #30223 from mlaventure/fix-logwatcher-deadlock
Close logwatcher on context cancellation
(cherry picked from commit 0566f3ffc4)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:04:30 -08:00
Justin Cormack
4122443aa7
Merge pull request #30893 from Microsoft/jjh/disabletesttemporarily
Windows: Temporarily disable TestBuildLastModified
(cherry picked from commit eaffb3099a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:04:23 -08:00
Alexander Morozov
e301d956b7
Merge pull request #30776 from WeiZhang555/stats-all-format-name-panic-cli
Fix panic of "docker stats --format {{.Name}} --all"
(cherry picked from commit f5116c6802)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:04:16 -08:00
Sebastiaan van Stijn
1c47c89d76
Merge pull request #29497 from yongtang/29486-docker-build-tmp-file
Clean up tmp files for interrupted `docker build`
(cherry picked from commit 6138a02c87)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 22:03:36 -08:00
Victor Vieux
7e11df6273 Merge pull request #31138 from aboch/c1.13.x
[1.13.x] Release the network attachment on allocation failure
2017-02-17 18:18:46 -08:00
Aaron Lehmann
b326920b3e Vendor swarmkit 30a4278
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-02-17 17:46:12 -08:00
Sebastiaan van Stijn
56e99a8791
fix changes for 1.13.x branch
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 17:21:58 -08:00
Alessandro Boch
9e74ea8594 Release the network attachment on allocation failure
- otherwise the attachment task will stay in store and
  consume IP addresses and there is no way to remove it.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-17 16:05:49 -08:00
Brian Goff
740fbef836 Merge pull request #30952 from yongtang/02122017-swagger-attachable
Add `attachable` for network object in swagger api docs
(cherry picked from commit 0464441fb1)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 13:24:41 -08:00
Vincent Demeester
9dcb36dfa2 Merge pull request #30734 from allencloud/add-400-status-code-for-events-endpoint
add status code 400 for api endpoint /events
(cherry picked from commit f3da980a45)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 13:24:41 -08:00
allencloud
9f46122c94 add missing filter type and sort filter type in alphabets
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit da1f05d66d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 13:24:41 -08:00
Anusha Ragunathan
951ffc056b Merge pull request #30701 from allencloud/add-status-code-404-for-plugin-in-api-doc
add status code 404 for plugin api endpoint enable and disable
(cherry picked from commit 0113128b2a)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 13:24:40 -08:00
Sebastiaan van Stijn
ed6e849a1c Merge pull request #29906 from allencloud/update-events-related-things
update events related doc and swagger.yml
(cherry picked from commit dea528e8cd)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 13:24:40 -08:00
Sebastiaan van Stijn
e7e23df3f6 Merge pull request #29808 from jmzwcn/issue29796
API: Delete container can return 409, but that isn't documented.
(cherry picked from commit 86f962a4a8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 13:24:40 -08:00
Sebastiaan van Stijn
890f4c7aa5
Merge pull request #26576 from allencloud/change-cluster-response-status-code
update response status code for cluster request
(cherry picked from commit a58b5830b1)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-17 13:24:24 -08:00
Brian Goff
30a5e20cc0 Merge pull request #31011 from aboch/c1.13.x
[1.13.x] Vendoring libnetwork @bba65e5
2017-02-15 16:26:27 -05:00
Alexander Morozov
b3b30b0dcd Merge pull request #31030 from aboch/c1.13.x-2
[1.13.x] Vendoring swarmkit @c7df892
2017-02-15 09:32:45 -08:00
Alessandro Boch
2b0d7d2d86 [1.13.x] Vendoring swarmkit @c7df892
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-14 21:08:59 -08:00
Alessandro Boch
2e544b1513 [1.13.x] Vendoring libnetwork @bba65e5
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-14 09:42:44 -08:00
Vincent Demeester
e5a90d46e3 Merge pull request #30875 from albers/fix-30858
Fix bash completion for `docker service`
2017-02-12 22:00:28 +01:00
Harald Albers
018981111c Fix bash completion for docker service
Signed-off-by: Harald Albers <github@albersweb.de>
2017-02-09 15:35:46 +01:00
Victor Vieux
092cba3727 bump version to 1.13.1
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-07 21:58:41 -08:00
Victor Vieux
f26487b568 Merge pull request #30806 from vieux/bump_api_version
[1.13.x] Bump api version to 1.26
2017-02-07 21:46:17 -08:00
Victor Vieux
fc0b5dbedb bump api version to 1.26
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-07 16:42:41 -08:00
Brian Goff
19d67e6e4a Update swagger spec for plugin upgrade
This was added in 03c6949739 but spec was
not updated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit ae48cd04da)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-07 12:04:03 -08:00
Christopher Jones
e29c142293 added ppc64le and s390x fixes for manpages
Fixes manpages for p and z by downloading a specific version
of go instead of relying on the distro version.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit 5bec1b6864)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-07 11:59:54 -08:00
Victor Vieux
54f71fd84a bump version to 1.13.1-rc2
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-06 15:04:17 -08:00
Stephen J Day
516792001a cluster/executor: check mounts at start
While it is important to not create controllers for an invalid task,
certain properties should only be checked immediately before use. Early
host validation of mounts prevents resolution of the task Executor when
the mounts are not relevant to execution flow. In this case, we have a
check for the existence of a bind mount path in a creation function that
prevents a task controller from being resolved. Such early validation
prevents one from interacting directly with a controller and result in
unnecessary error reporting.

In accordance with the above, we move the validation of the existence of
host bind mount paths to the `Controller.Start` phase. We also call
these "checks", as they are valid mounts but reference non-existent
paths.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 92899ffac8)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-06 15:02:23 -08:00
Andrew Hsu
14deb7d32c remove musl-dev in man/Dockerfile.armhf
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit 1c7a66eda7)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-06 14:49:22 -08:00
Andrew Hsu
26ec0e71d1 use precompiled go from google, needs debian to work
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit a6886bfc52)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-06 14:49:16 -08:00
Andrew Hsu
5f696e6d48 from golang:1.7.5-alpine for docker-manpage-dev
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit 7b52ec5f10)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-06 14:49:09 -08:00
Tibor Vass
0406faf887 Show stacktrace in daemon logs only if 500 internal error
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit f7d9bb6248)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-06 13:02:39 -08:00
Victor Vieux
f6bf85f99c Merge pull request #30730 from dmcgowan/update-go-connections-1.13
[1.13] Update go connections 1.13
2017-02-03 20:53:35 -08:00
Victor Vieux
0220459168 Merge pull request #30728 from cpuguy83/plugin_upgrade_1.13
[1.13] Add plugin upgrade
2017-02-03 20:53:23 -08:00
Derek McGowan
b47fa5a5d1
Update go-connections package
fixes #30450

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-02-03 16:51:49 -08:00
Brian Goff
1a17bc6bc4 Make propagated mount persist outside rootfs
This persists the "propagated mount" for plugins outside the main
rootfs. This enables `docker plugin upgrade` to not remove potentially
important data during upgrade rather than forcing plugin authors to hard
code a host path to persist data to.

Also migrates old plugins that have a propagated mount which is in the
rootfs on daemon startup.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e8307b868d)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-03 19:15:23 -05:00
Brian Goff
96b0320d5c Add docker plugin upgrade
This allows a plugin to be upgraded without requiring to
uninstall/reinstall a plugin.
Since plugin resources (e.g. volumes) are tied to a plugin ID, this is
important to ensure resources aren't lost.

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

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

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 03c6949739)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-03 19:14:56 -05:00
Yong Tang
905cf26b43 Fix misleading default for --replicas
This fix tries to address the issue raised in 29291 where
the output of `--replicas` in `service create/update`:
```
      --replicas uint                    Number of tasks (default none)
```
is misleading. User might incorrectly assume the number of replicas
would be `0` (`none`) by default, while the actual default is `1`.

The issue comes from the fact that some of the default values are
from daemon and it is not possible for client to find out the default
value.

In this case, it might be better to just simply not displaying `(default none)`.

This fix returns "" for `Uint64Opt` so that `(default none)` is hidden.

In addition to `--replicas`, this fix also changes
`--restart-delay`, `--restart-max-attempts`, `--stop-grace-period`,
`--health-interval`, `--health-timeout`, and `--restart-window`
in a similiar fashion.

New Output:
```
      --health-interval duration         Time between running the check (ns|us|ms|s|m|h)
      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h)
...
      --replicas uint                    Number of tasks
...
      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)
      --restart-max-attempts uint        Maximum number of restarts before giving up
      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h)
...
      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)
```

The docs has been updated. Note the docs for help output of `service create/update`
is out of sync with the current master. This fix replace with the update-to-date
help output.

This fix fixes 29291.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit acc93db32b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-03 00:48:59 -08:00
John Howard
202df64a3b Windows: Unify workdir handling
Signed-off-by: John Howard <jhoward@microsoft.com>

Working directory processing was handled differently for Hyper-V and Windows-Server containers, as annotated in the builder documentation (updated in this PR). For Hyper-V containers, the working directory set by WORKDIR was not created. This PR makes Hyper-V containers work the same as Windows Server containers (and the same as Linux).

Example (only applies to Hyper-V containers, so not reproducible under CI environment)
Dockerfile:
FROM microsoft/nanoserver
WORKDIR c:\installer
ENV GOROOT=c:\installer
ADD go.exe .
RUN go --help
Running on Windows Server 2016, using docker master without this change, but with daemon set to --exec-opt isolation=hyperv as it would be for Client operating systems.
PS E:\go\src\github.com\docker\docker> dockerd -g c:\control --exec-opt isolation=hyperv
time="2017-02-01T15:48:09.657286100-08:00" level=info msg="Windows default isolation mode: hyperv"
time="2017-02-01T15:48:09.662720900-08:00" level=info msg="[graphdriver] using prior storage driver: windowsfilter"
time="2017-02-01T15:48:10.011588000-08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2017-02-01T15:48:10.016655800-08:00" level=info msg="Loading containers: start."
time="2017-02-01T15:48:10.460820000-08:00" level=info msg="Loading containers: done."
time="2017-02-01T15:48:10.509859600-08:00" level=info msg="Daemon has completed initialization"
time="2017-02-01T15:48:10.509859600-08:00" level=info msg="Docker daemon" commit=3c64061 graphdriver=windowsfilter version=1.14.0-dev
First with no explicit isolation:
PS E:\docker\build\unifyworkdir> docker build --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 7e0f41d08204
Removing intermediate container 236c7802042a
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in 8ea5237183c1
 ---> 394b70435261
Removing intermediate container 8ea5237183c1
Step 4/5 : ADD go.exe .
 ---> e47401a1745c
Removing intermediate container 88dcc28e74b1
Step 5/5 : RUN go --help
 ---> Running in efe90e1b6b8b
container efe90e1b6b8b76586abc5c1dc0e2797b75adc26517c48733d90651e767c8463b encountered an error during CreateProcess: failure in a Windows system call: The directory name is invalid. (0x10b) extra info: {"ApplicationName":"","CommandLine":"cmd /S /C go --help","User":"","WorkingDirectory":"C:\\installer","Environment":{"GOROOT":"c:\\installer"},"EmulateConsole":false,"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}
PS E:\docker\build\unifyworkdir>
Then forcing process isolation:
PS E:\docker\build\unifyworkdir> docker build --isolation=process --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 350c955980c8
Removing intermediate container 8339c1e9250c
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in bde511c5e3e0
 ---> b8820063b5b6
Removing intermediate container bde511c5e3e0
Step 4/5 : ADD go.exe .
 ---> e4ac32f8902b
Removing intermediate container d586e8492eda
Step 5/5 : RUN go --help
 ---> Running in 9e1aa235af5f
Cannot mkdir: C:\installer is not a directory
PS E:\docker\build\unifyworkdir>
Now compare the same results after this PR. Again, first with no explicit isolation (defaulting to Hyper-V containers as that's what the daemon it set to) - note it now succeeds 😄
PS E:\docker\build\unifyworkdir> docker build --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> 4f319f301c69
Removing intermediate container 61b9c0b1ff6f
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in c464a1d612d8
 ---> 96a26ab9a7b5
Removing intermediate container c464a1d612d8
Step 4/5 : ADD go.exe .
 ---> 0290d61faf57
Removing intermediate container dc5a085fffe3
Step 5/5 : RUN go --help
 ---> Running in 60bd56042ff8
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

The command 'cmd /S /C go --help' returned a non-zero code: 2
And the same with forcing process isolation. Also works 😄
PS E:\docker\build\unifyworkdir> docker build --isolation=process --no-cache .
Sending build context to Docker daemon  10.1 MB
Step 1/5 : FROM microsoft/nanoserver
 ---> 89b8556cb9ca
Step 2/5 : WORKDIR c:\installer
 ---> f423b9cc3e78
Removing intermediate container 41330c88893d
Step 3/5 : ENV GOROOT c:\installer
 ---> Running in 0b99a2d7bf19
 ---> e051144bf8ec
Removing intermediate container 0b99a2d7bf19
Step 4/5 : ADD go.exe .
 ---> 7072e32b7c37
Removing intermediate container a7a97aa37fd1
Step 5/5 : RUN go --help
 ---> Running in 7097438a54e5
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

The command 'cmd /S /C go --help' returned a non-zero code: 2
PS E:\docker\build\unifyworkdir>

(cherry picked from commit f42033ba94)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-03 00:40:46 -08:00
Madhu Venugopal
f709fd4e5b Merge pull request #30692 from aboch/c1.13.x
[1.13.x] Vendoring libnetwork @45b4086 for 1.13.x
2017-02-02 18:32:09 -08:00
Alessandro Boch
17e6f81948 Revert "Fix IT case for network name validation"
This reverts commit 9cebccfb95.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-02 15:32:59 -08:00
Alessandro Boch
778f9a86c4 Vendoring libnetwork @45b4086 for 1.13.x
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-02 12:58:16 -08:00
Vincent Demeester
fbc84e24aa Merge pull request #30646 from vieux/1.13.1-rc2-cherrypicks-2
1.13.1 rc2 cherrypicks 2
2017-02-02 11:31:19 +01:00
Sebastiaan van Stijn
553d56d456 install dirmngr if needed
as of Ubuntu Yakkety, dirmngr is now in a separate
package (see https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1634464)

this patch updates the install script to install
the dirmngr package if it's not installed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f5263c8074)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-01 17:26:26 -08:00
Victor Vieux
6e2e808146 Merge pull request #30650 from aluzzardi/1.13.x-swarmkit-bump
[1.13.x] Re-vendor swarmkit to 1c7f003d75f091d5f7051ed982594420e4515f77
2017-02-01 15:54:56 -08:00
Victor Vieux
2556b7a70a Merge pull request #30649 from thaJeztah/1.13-bump-runc
[1.13.x] bump RunC / libcontainer to fix SELinux regression
2017-02-01 15:13:49 -08:00
Andrea Luzzardi
14153795ba Re-vendor swarmkit to 1c7f003d75f091d5f7051ed982594420e4515f77
Includes docker/swarmkit#1914

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2017-02-01 13:23:39 -08:00
Harald Albers
ec0e3fe4e2 Add bash completion for docker checkpoint
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 926fa56c0d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-01 12:35:00 -08:00
Sebastiaan van Stijn
d00e249c26
[1.13.x] bump RunC / libcontainer to fix SELinux regression
This bumps RunC and libcontainer to fix a regression
in 1.13 that caused SELinux labels to not be
applied correctly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-01 12:27:00 -08:00
Tibor Vass
68f9fb9fd7 plugin: use pkg/errors in more places
Also provide stack trace output in daemon logs.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 26d0bac895)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-01 12:00:30 -08:00
John Howard
7b15b4a9b2 Revendor Microsoft/go-winio v0.3.8
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit da6739c99f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-01 12:00:11 -08:00
Christopher Jones
5e859cf3c1 Update systemd drop-in link
Right now it redirects, so change it to the correct one.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit 7c763b360a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-01 11:59:06 -08:00
Victor Vieux
96b87362e6 Merge pull request #30610 from mlaventure/update-containerd-1.13.x
[1.13.x] Update containerd to version aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
2017-01-31 17:56:51 -08:00
Victor Vieux
baf9288b78 Merge pull request #30574 from vieux/1.13.1-rc2-cherry
1.13.1-rc2 cherry-picks
2017-01-31 17:32:19 -08:00
Kenfe-Mickael Laventure
0311ed7b1c Update containerd to version aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-01-31 15:01:55 -08:00
allencloud
c74f17e91e add 400 status code for build api
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit c81a818b56)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-01-31 12:57:29 -08:00
unclejack
64856b7a24 Dockerfile*: bump Go to 1.7.5
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
(cherry picked from commit b6e2703230)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-01-31 12:57:29 -08:00
Anusha Ragunathan
c7f27f8c07 Add docs for service create based on plugins.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
(cherry picked from commit 62d399e811)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-01-31 12:55:45 -08:00
Joffrey F
171745b261 Fix typo in swagger.yaml for NetworkPrune operation
Signed-off-by: Joffrey F <joffrey@docker.com>
(cherry picked from commit 20c5fa3758)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-01-31 12:55:19 -08:00
Harald Albers
73b9bdc6cb Add bash completion for docker service logs
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 105231556a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-01-31 12:54:57 -08:00
Felix Abecassis
10d999d7ab install: map debian_version 9.X to debian stretch
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
(cherry picked from commit ac3d74b0b4)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-01-31 12:54:34 -08:00
Alexander Morozov
ee1b5c5944 Merge pull request #30579 from yongtang/1.13.x
[1.13.x] Cherry-pick SwarmKit update to 0af40501a9cc98cd3e9425d2e4246dd3eff5526e
2017-01-31 12:31:15 -08:00
Victor Vieux
c4d731c24c Merge pull request #30577 from justincormack/arm-seccomp-1.13
[1.13.x] Add two arm specific syscalls to seccomp profile
2017-01-30 17:15:27 -08:00
Yong Tang
1e0179589d [1.13.x] Cherry-pick SwarmKit update to 0af40501a9cc98cd3e9425d2e4246dd3eff5526e
This fix cherry-pick SwarmKit update to 0af40501a9cc98cd3e9425d2e4246dd3eff5526e
for branch 1.13.x. The following has been added:
- [docker/swarmkit#1909]: raft: Disable address change detection
- [docker/swarmkit#1910]: Fix issue in service update of published ports in host mode

This fix fixes #30199 in docker.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-30 15:22:48 -08:00
Justin Cormack
c1c5d30ee4 [1.13.x] Add two arm specific syscalls to seccomp profile
cherry pick #30545

These are arm variants with different argument ordering because of
register alignment requirements.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-30 23:01:28 +00:00
Victor Vieux
2527cfcc49 Merge pull request #30515 from vieux/1.13.1-rc1-changelog
bump to 1.13.1-rc1
2017-01-27 13:10:39 -08:00
Victor Vieux
de6c83de28 Merge pull request #30494 from vieux/cherry-pick-secrets-compose
[1.13.x] cherry-pick secrets to compose
2017-01-27 13:10:31 -08:00
Victor Vieux
e84317c735 bump to 1.13.1-rc1
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-27 11:46:09 -08:00
allencloud
e25c046488 update incorrect url in docs
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 5ae95d6245)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-27 11:32:10 -08:00
Sebastiaan van Stijn
749f8bfee8 document DOCKER_HIDE_LEGACY_COMMANDS env-var
The `DOCKER_HIDE_LEGACY_COMMANDS` environment
variable was added in a7c8bcac2b
but not documented.

This adds the variable to the documentation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2ef82fd237)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-27 11:31:55 -08:00
Lars-Magnus Skog
bdc5b347f5 update api docs on Placement.Constraints for services
Signed-off-by: Lars-Magnus Skog <ralphtheninja@riseup.net>
(cherry picked from commit 9c98bffc2b)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-27 11:31:34 -08:00
Janonymous
370e8f25d2 Fix json format of plugin
Signed-off-by: Janonymous <janonymous.codevulture@gmail.com>
(cherry picked from commit 2d24dbe896)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-27 11:31:20 -08:00
Harald Albers
e0c79df37d Add [OPTIONS] to usage of plugin disable|push
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit aad095f573)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-27 11:30:37 -08:00
Victor Vieux
e3441eb64c Merge pull request #30513 from mstanleyjones/1.13.x
Cherry-pick #30478 to 1.13.x
2017-01-27 11:10:08 -08:00
Victor Vieux
8d0198c59d fix cherry-pick
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-27 11:09:43 -08:00
Misty Stanley-Jones
ed7aea3533 Merge pull request #30478 from mstanleyjones/fix_broken_links
Fix broken relative links in old API docs
(cherry picked from commit 05d4c1314e)

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2017-01-27 09:48:48 -08:00
Victor Vieux
1b05e7aee7 Merge pull request #30331 from vieux/1.13.1-rc1-cherrypicks
1.13.1 rc1 cherrypicks
2017-01-26 19:21:38 -08:00
Victor Vieux
c5147e6ab5 Merge pull request #30467 from mavenugo/1.13-lncp
Vendoring libnetwork 2c8b683
2017-01-26 10:56:58 -08:00
Josh Hawn
692c98895f Add SecretUpdate docs to api/swagger.yaml
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

(cherry picked from commit 1cd5af59bf)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:38:32 -08:00
Josh Hawn
4dc1b6221d Add SecretUpdate method to client
closes #28678

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Update cli/command/service/update_test.go

Fixes test build error:

  secretAPIClientMock does not implement "github.com/docker/docker/client".SecretAPIClient (missing SecretUpdate method)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

(cherry picked from commit 77b8465d7e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:38:25 -08:00
Daniel Nephin
1afa22733c Set default values for uid and gid to prevent errors when starting a service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 167b3f95b7)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:21:01 -08:00
Daniel Nephin
c19f50acef Rebase Compose v3.1 schema on the latest v3 schema.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit b4f23bbc69)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:20:55 -08:00
Daniel Nephin
6b70c68a7c Remove secrets as part of stack remove.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit f0a5531c46)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:20:49 -08:00
Daniel Nephin
909014d324 Test and fix external secrets in stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit b3427e43ed)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:20:36 -08:00
Daniel Nephin
1fed3349fb Add integration test for stack deploy with secrets.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 6ec84ef76d)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:20:26 -08:00
Daniel Nephin
2f445705f9 Implement secret types for compose file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 9419e7df2b)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:19:49 -08:00
Daniel Nephin
118e55df62 Add v3.1 schema and support validating multiple version.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 65374488f9)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 06:18:26 -08:00
Madhu Venugopal
e6f89d1af5 Vendoring libnetwork 2c8b683
to address #30295

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-26 04:38:21 -08:00
Alessandro Boch
819bcf8182 Remove attachable network on swarm leave
- When the node leaves the cluster, if any user run
  container(s) is connected to the swarm network,
  then daemon needs to detach the container(s) and
  remove the network.

Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit 3cedca5d53)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-26 04:31:34 -08:00
Sebastiaan van Stijn
3fc246ded2 Merge pull request #29732 from vdemeester/29676-deploy-indempotent
[1.13.x] Make docker stack deploy a little bit more idempotent
2017-01-26 12:47:23 +01:00
Victor Vieux
426c4cb747 Merge pull request #30452 from dnephin/cherry-compose-refactor
Compose fixes for 1.13.1
2017-01-26 00:47:42 -08:00
Michael Irwin
017381aea4 Fixed secret creation usage during service create in docs
Using source, the following error is made:
invalid field in secret request: src

Signed-off-by: Michael Irwin <mikesir87@gmail.com>
(cherry picked from commit 9250117d58)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 22:17:04 -08:00
Sebastiaan van Stijn
214f42d541 Add "src" alias for --secret
This patch adds a "src" alias for `--secret`
to be consistent with `--mount`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 950658bbb6)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 22:16:32 -08:00
Yong Tang
a64c9357ca Fix incorrect Scope in network ls/inspect with duplicate network names
This fix tries to address the issue raised in 30242 where the `Scope`
field always changed to `swarm` in the ouput of `docker network ls/inspect`
when duplicate networks name exist.

The reason for the issue was that `buildNetworkResource()` use network name
(which may not be unique) to check for the scope.

This fix fixes the issue by always use network ID in `buildNetworkResource()`.

A test has been added. The test fails before the fix and passes after the fix.

This fix fixes 30242.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 05a831a775)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 22:13:13 -08:00
Darren Stahl
e7077f7d26 Windows: Add service dependency ConDrv
Signed-off-by: Darren Stahl <darst@microsoft.com>
(cherry picked from commit b2a7f6abb3)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 21:37:54 -08:00
Victor Vieux
328775ea4f removing trailing backslash in zsh completion
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 20:35:42 -08:00
Vincent Demeester
bf43d2a58d Make docker stack deploy a little bit more indempotent
Sort some slice fields before sending them to the swarm api so that it
won't trigger an update.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-25 20:31:09 -08:00
John Howard
6a9670b044 Windows: Bump to latest version of git
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 8a45eea2dd)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 20:07:49 -08:00
Christopher Jones
53576a5bf9 [ppc64le] use official go 1.7.4 binaries
go 1.7.4 introduced official go ppc64le binaries, so use those
instead of using older versions of go and building from src.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit 62ab6809bd)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 20:07:09 -08:00
Christopher Jones
6b4a835431 [project] bump go to go 1.7.4
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit 20e243780e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 20:06:06 -08:00
Daniel Nephin
92155e37b3 Add missing network.internal.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 16:43:05 -05:00
Daniel Nephin
7f396e8ea3 Update Compose schema to match docker-compose.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 16:43:05 -05:00
Daniel Nephin
d9bda3080a Add validation for compose schema bindata.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 16:43:05 -05:00
Daniel Nephin
007e492eac Add deps to test compose-file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 16:43:05 -05:00
Daniel Nephin
6bc7bc19df Fix some bad merges
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 16:43:02 -05:00
Tibor Vass
cbe6781501 plugins: add example docs for a rexray plugin
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 5f713cecc5)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 13:31:51 -08:00
Daniel Nephin
5bf7901f5d Replace vendor of aanand/compose-file with a local copy.
Add go-bindata for including the schema.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 16:04:05 -05:00
Harald Albers
06dae4eae5 Fix bash completion for completing nodes
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 550947e437)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-25 13:04:05 -08:00
Daniel Nephin
a757b9bea9 Move pkg to cli/compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 16:02:09 -05:00
Daniel Nephin
f147d9b0d1 More unit tests for converting services in stack deploy
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 15:59:23 -05:00
Daniel Nephin
5537dbde84 Move ConvertService to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 15:58:07 -05:00
Daniel Nephin
732e19892d Move ConvertVolumes to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 15:42:06 -05:00
Daniel Nephin
c9ffd3586c Move ConvertNetworks to composetransform package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-25 15:32:53 -05:00
Victor Vieux
0b27583f82 Merge pull request #30332 from anusha-ragunathan/1.13.x
Cherry pick docker #30145 and vendor corresponding swarmkit #1883
2017-01-25 12:21:45 -08:00
Victor Vieux
3fdce9676b Merge pull request #29826 from vdemeester/29809-fix-network-ipam-configuration
[1.13.x] Change the way IPAM configuration is handled on stack deploy
2017-01-25 11:51:35 -08:00
Anusha Ragunathan
f0f020a579 Vendor swarmkit
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-01-25 10:13:26 -08:00
Anusha Ragunathan
3048e50434 Update TestSwarmNetworkPlugin test.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-01-25 10:04:27 -08:00
Yong Tang
b194252d80 Fix failure in docker ps --format when .Label has args
This fix tries to fix the issue in 30279 where  `docker ps --format`
fails if `.Label` has args. For example:
```
docker ps --format '{{.ID}}\t{{.Names}}\t{{.Label "some.label"}}'
```

The reason for the failure is that during the preprocessing phase
to detect the existance of `.Size`, the `listOptionsProcessor`
does not has a method of `Label(name string) string`.

This results in the failure of
```
template: :1:24: executing "" at <.Label>: Label is not a method but has arguments
```

This fix fixes the issue by adding needed method of `Label(name string) string`.

This fix fixes 30279.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 2cd4ba1e56)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 17:45:05 -08:00
Brian Goff
e9751047e9 Fix deadlock on v1 plugin with activate error
When a plugin has an activation error, it was not being checked in the
`waitActive` loop. This means it will just wait forever for a manifest
to be populated even though it may never come.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit f2d384fca6)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 17:19:02 -08:00
Sebastiaan van Stijn
b875349fef do not create init-dir if not needed
commit 56f77d5ade
added support for cpu-rt-period and cpu-rt-runtime,
but always initialized the cgroup path, even if not
used.

As a result, containers failed to start on a
read-only filesystem.

This patch only creates the cgroup path if
one of these options is set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f285d5b3e8)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 17:00:52 -08:00
Doug Davis
b0970b629b Only show global warnings once
Upon each container create I'm seeing these warning **every** time in the
daemon output:
```
WARN[0002] Your kernel does not support swap memory limit
WARN[0002] Your kernel does not support cgroup rt period
WARN[0002] Your kernel does not support cgroup rt runtime
```
Showing them for each container.create() fills up the logs and encourages
people to ignore the output being generated - which means its less likely
they'll see real issues when they happen.  In short, I don't think we
need to show these warnings more than once, so let's only show these
warnings at daemon start-up time.

Signed-off-by: Doug Davis <dug@us.ibm.com>
(cherry picked from commit ff42a2eb41)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 17:00:24 -08:00
Anusha Ragunathan
e9779fd7df Fix pluginv1 Windows volumes
c54b717 caused a regression for pluginv1 on Windows, where extraneous
backslashes were added to BasePath of the plugin. For pluginv1 on windows,
BasePath() should return an empty string, since the plugin is fully aware
of the mount path. Also, unlike Linux where all paths are relative to "/",
Windows paths are dependent on system drives and mapped drives.

Fixes #30148

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
(cherry picked from commit 0ef21eb0e3)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 16:37:24 -08:00
Elan Ruusamäe
2dd2ac2c14 do not require custom build of tini
https://github.com/krallin/tini/issues/55#issuecomment-260507562
https://github.com/krallin/tini/issues/55#issuecomment-260538243
https://github.com/docker/docker/pull/28037

Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
(cherry picked from commit d7df731597)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 16:31:39 -08:00
Victor Vieux
b60f411292 Merge pull request #30038 from tonistiigi/setclusterprovider
[v1.13] Add workaround for possible SetClusterProvider deadlock
2017-01-24 16:13:20 -08:00
Sebastiaan van Stijn
482534ff5f Ignore certificate expiry error for top-level inspect
The top-level `docker inspect` command could return
an error if the nodes Swarm certificates were expired.

In situations where the user did not explicitly
ask for an object-type (`--type=foo`), we should
ignore these errors, and consider them equal to
"node is not a swarm manager".

This change makes `docker inspect` ignore these
errors if no type was specified.

As a further optimization, the "swarm status"
result is now stored in a variable, so that
other swarm-specific API calls can be skipped.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 66cf4cc7f7)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 16:05:53 -08:00
Kenfe-Mickael Laventure
25810f3f47 Remove timeout on fifos opening
Instead of a timeout the context is cancelled on error to ensure
proper cleanup of the associated fifos' goroutines.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit c178700a04)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 15:57:14 -08:00
Aaron Lehmann
37be2d4e9b distribution: Add text/html and application/json as image mediatypes
As noted by #30083, the new strict checking of mediatypes misses some
cases where earlier bugs caused nonstandard mediatypes to be stored in
manifests. Two of the known cases are text/html and application/json,
which were returned by certain registries and stored by earlier versions
of Docker. Add special cases for text/html and application/json.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit a215e15cb1)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 15:53:36 -08:00
Harald Albers
880c12df7d Add bash completion for run|create --init-path
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 182048f185)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 15:41:44 -08:00
Harald Albers
ecd95a41d2 Add docs for run|create --init|--init-path
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit d049ef2b0d)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 15:41:37 -08:00
Kenfe-Mickael Laventure
b9ee1c6880 Ensure proper value is used when computing reclaimable space
When Size was reverted to be equal to VirtualSize, the df command
formatter was not correctly updated to account for the change.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit dcc1b4baf6)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 15:41:06 -08:00
Steve Durrheimer
0c16980468 Add zsh completion for 'dockerd --init' and 'docker {create,run} --init'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit cdf57782fd)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 13:52:09 -08:00
Harald Albers
1ec7869443 Add bash completion for plugin install --disable-content-trust
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 725a864a04)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 13:49:24 -08:00
Steve Durrheimer
0fa35e2073 Add zsh completion for 'docker plugin install --alias'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 455b7bcbab)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 13:48:58 -08:00
Harald Albers
0be8ebd2a1 Fix bash completion for docker service update
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 01ac33ce16)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 13:48:18 -08:00
Harald Albers
b4fd48ce32 Add bash completion for docker service ps --filter node
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit a39a2bb6c2)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 13:47:54 -08:00
Harald Albers
9da299954f Add missing options to bash completion for docker swarm init|update
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit f93da79dc1)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 13:47:28 -08:00
Harald Albers
d4e6422212 Add bash completion for docker swarm unlock|unlock-key
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 07bd5152b3)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-24 13:47:03 -08:00
Victor Vieux
954520f0ef Merge pull request #30329 from johndmulhausen/patch-2
Fixing formatting errors in Run refdoc
2017-01-20 14:14:15 -08:00
Harald Albers
23e9d30cea Fix treatment of DOCKER_HIDE_LEGACY_COMMANDS in bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 12952f537c)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-20 14:07:19 -08:00
Harald Albers
7bb3740386 Honour $DOCKER_HIDE_LEGACY_COMMANDS in bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit aa006f1280)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-20 14:06:58 -08:00
Harald Albers
ba79dde9d2 Add bash completion for build --squash
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e91dbba7ff)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-20 14:06:01 -08:00
Harald Albers
d621d74f64 Add bash completion for dockerd --init and docker run|create --init
Fixes #30263

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 2076261757)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-20 14:05:33 -08:00
Steve Durrheimer
78e4fa2caa Add zsh completion for 'docker swarm --availability'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit ee2ce82c61)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-20 14:05:10 -08:00
Steve Durrheimer
f6d70d08a8 Add zsh completion for 'docker {container,image,network,system} prune --filter'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 784ebccffa)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-20 14:03:45 -08:00
Anusha Ragunathan
660a186e92 Pass plugingetter as part of swarm node config.
This is necessary for swarmkit to support cluster wide plugins, such as
globally scoped network plugins.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-01-20 13:44:22 -08:00
John Mulhausen
bd6c3ebed9 Fixing formatting errors
Fixing issues on https://docs.docker.com/engine/reference/builder/#arg

Signed-off-by: John Mulhausen <john@docker.com>
2017-01-20 13:26:30 -08:00
Victor Vieux
49bf474f9e bump version to 1.13.0
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-17 01:00:55 -08:00
Victor Vieux
d4f36676f0 Merge pull request #30188 from thaJeztah/update-1.13-changelog
[1.13] Add missing 1.13 features to changelog
2017-01-17 00:59:25 -08:00
Sebastiaan van Stijn
197977d7fd
Merge pull request #30108 from thaJeztah/update-changelog-1.12.6
Update changelog on master with changes from 1.12.x
(cherry picked from commit a4bc730298)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-17 09:53:25 +01:00
Sebastiaan van Stijn
8324f11b5a
Add missing 1.13 features to changelog
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-16 18:45:55 +01:00
Victor Vieux
48a9e53d70 bump version to 1.13.0-rc7
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-11 18:06:55 -08:00
Victor Vieux
bca3b05950 Merge pull request #30116 from vieux/cherry-pick-1.13.0-rc7
cherry pick 1.13.0-rc7
2017-01-12 22:03:51 -08:00
Yong Tang
4f914489e3 Add test for image size for v1.12 and v1.13 clients against v1.13 daemon
This test checks to make sure both v1.12 and v1.13 client against v1.13 daemon get correct `Size` after the fix.

This test is related to 30027.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit d9451f1c8c)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-11 17:59:31 -08:00
Kenfe-Mickael Laventure
e62d984138 Fix ImageSummary.Size value
The prune PR changed the meaning of the file to mean "space on disk
only unique to this image", this PR revert this change.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit be20dc15af)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-11 17:21:26 -08:00
Stefan J. Wernli
f6bc09c380 storeLayer.Parent should return describableStoreLayers
When storeLayer.Parent returns the parent layer, it needs to use the same logic as Get where it wraps in a describablyStoreLayer if the layer is describable. Otherwise, on Windows, this can result in pushing the foreign layers, which is not supposed to be allowed.
This fixes https://github.com/docker/docker/issues/30080.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
(cherry picked from commit d14b7212ad)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-11 14:54:09 -08:00
Victor Vieux
2f2d055013 bump version to 1.13.0-rc6
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-11 09:36:57 -08:00
Tõnis Tiigi
fc82c4b391 Merge pull request #30044 from tonistiigi/update-runc-113
[v1.13] vendor: update runc to 2f7393a4
2017-01-11 08:37:36 -08:00
Madhu Venugopal
e0c07ab799 Merge pull request #30042 from aaronlehmann/vendor-swarmkit-296fcfc
[1.13] Update vendored swarmkit to 296fcfc
2017-01-10 20:59:14 -08:00
Tonis Tiigi
acbad31dcd vendor: update runc to 2f7393a4
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-10 18:07:20 -08:00
Victor Vieux
7e792d6ca9 Merge pull request #30012 from tiborvass/plugin-devices-redone
[1.13] Plugins: Rename DeviceCreation to AllowAllDevices
2017-01-10 17:28:14 -08:00
Madhu Venugopal
c8083e8735 Modify network plugin test for swarm-mode
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-10 16:38:24 -08:00
Aaron Lehmann
18fd3885c6 Update vendored swarmkit to 296fcfc
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-01-10 16:07:45 -08:00
Tibor Vass
83b2782ea9 plugins: rename DeviceCreation to AllowAllDevices
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit f265727bdf)
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-01-10 15:21:46 -08:00
Alexander Morozov
ece7e8ba27 Merge pull request #30034 from aaronlehmann/vendor-swarmkit-70cb786
[1.13] Update vendored swarmkit to 70cb786
2017-01-10 15:19:17 -08:00
Tonis Tiigi
4b2b0eb608 Add workaround for possible SetClusterProvider deadlock
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-10 15:14:26 -08:00
Aaron Lehmann
3fc1510dff [1.13] Update vendored swarmkit to 70cb786
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-01-10 12:55:35 -08:00
Vincent Demeester
340f288211 Merge pull request #29962 from vieux/1.13.0-rc6-cherrypicks
1.13.0 rc6 cherrypicks
2017-01-10 10:09:04 +01:00
Victor Vieux
0b2a029e56 Merge pull request #30009 from thaJeztah/revert-27146
[1.13.x] Revert "Require continuation char to be last char in a line"
2017-01-09 17:45:17 -08:00
Brian Goff
b7f412ef44 Merge pull request #29958 from cpuguy83/1.13_fix_selinux_packaging
[1.13] Fix conflicts with newly updated selinux policies
2017-01-09 20:15:51 -05:00
Sebastiaan van Stijn
57c17882a3
Revert "Require continuation char to be last char in a line"
This reverts commit 105bc63295,
which (although correct), resulted in a backward incompatible
change.

We can re-implement this in future, after this changes
goes through a deprecation cycle

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-10 00:36:40 +01:00
Victor Vieux
25879cfa54 Merge pull request #29994 from vdemeester/29974-fix-external-network
[1.13.x] Few stack deploy network fixes
2017-01-09 14:40:54 -08:00
Victor Vieux
6c2fdb64d1 Merge pull request #30004 from dnephin/fix-1.13-stack-deploy-resources
[1.13] Fix parsing resources from compose file for stack deploy
2017-01-09 14:40:30 -08:00
Victor Vieux
3fc150171f Merge pull request #30007 from aaronlehmann/vendor-swarmkit-8ea08a3
[1.13] Update vendored swarmkit to 8ea08a3
2017-01-09 14:39:57 -08:00
Victor Vieux
53ac375422 Merge pull request #29905 from coolljt0725/cherry-pick-29721
1.13.x cherry-pick: Cherry pick 29721
2017-01-09 14:22:23 -08:00
Aaron Lehmann
831eeb38f1 [1.13] Update vendored swarmkit to 8ea08a3
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-01-09 11:45:04 -08:00
Daniel Nephin
f27a297595 Fix parsing resources from compose file for stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-09 14:15:32 -05:00
Sebastiaan van Stijn
46af2edec2 un-fork go-memdb
commit 9322636c89
temporarily switched to a fork of go-memdb, because
a pull request that was needed was not yet merged
upstream.

this pull request was merged, so we can un-fork
this dependency.

this change does not bump the dependency, and
only un-forks. bumping the dependency should
be done in a separate change, if needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5f057f6350)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-09 06:37:40 -08:00
Aaron Lehmann
f2260228a7 vendor: Unfork logrus dependency
Vendor the latest official logrus release instead of a custom fork
(which now happens to be identical to the fork).

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 11df2db538)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-09 06:37:40 -08:00
Victor Vieux
b2219f1bb5 remove -f on secret create and unify usage with other commands
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit db6652ca71)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-09 06:37:40 -08:00
Tonis Tiigi
7c8511236c Fix workdir cache invalidation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit e160860054)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-09 06:37:40 -08:00
Harald Albers
b2e12626c7 Add bash completion for plugin names
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e7243a303a)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-09 06:37:40 -08:00
Yunxiang Huang
57a63f1ed2 Fix "zsh/_docker"
Signed-off-by: Yunxiang Huang <hyxqshk@vip.qq.com>
(cherry picked from commit c6544394b8)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-09 06:37:40 -08:00
Tonis Tiigi
d3bffd978a Set plugins used in tests back to original names
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit f4798b98fc)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-09 06:37:40 -08:00
Harald Albers
40736b1848 Fix wrong command in changelog
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 1fe0270e72)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-09 06:37:40 -08:00
Vincent Demeester
462cd90f74
Create only network that are used
- default network is only created if needed
- it's possible to override default network configuration

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-09 12:56:58 +01:00
Vincent Demeester
19cf2b3d5f
Fix external network name not properly handle by stack deploy
Make sure we use the Network external name if it's not empty.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-09 12:26:02 +01:00
Sebastiaan van Stijn
1dded0dee4 Merge pull request #29895 from cpuguy83/cherry_pick_29893
[1.13.x] Fix race accessing plugin storage map
2017-01-07 13:03:34 +01:00
Brian Goff
9f0e745152 Merge pull request #29926 from aaronlehmann/vendor-swarmkit-7f910df
[1.13] Vendor swarmkit 7f910df
2017-01-06 16:19:39 -05:00
Brian Goff
464b205956 Fix conflicts with newly updated selinux policies
The base selinux policies on centos/rhel/oraclelinux have all been
updated in a way that conflicts with the policies we install with
`docker-engine-selinux`. This patch fixes these conflicts.

In addition, removes special cases for old/unsupported versions of
fedora in our selinux package, and change to use a single minimum
version for the selinux base policy package, as this is the minimum
version required to use our selinux policy package.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit ec9a05e5e2)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-01-06 16:04:59 -05:00
Brian Goff
3b2982a2bb Fix race accessing plugin storage map
`plugins.GetAll()` was not locking the plugin map when checking if a
plugin exists, this can cause a race and potentially a panic if another
goroutine is trying to load a plugin into the map at the same time.

Also fixes a race during activation where a plugin inserts itself into
the plugin map but does not check if something else is already there.
This is already checked before trying to activate the plugin, however
the map lock is not held for this entire period, so other plugins may be
loaded during this time.
To fix, before inserting the plugin into the map, check if one with the
same name already exists and use that instead.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 21fcbb39b7)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-01-06 08:28:43 -05:00
Lei Jitang
d2e99882b9 Follow up #29365, fix fail to remove container after restart
Call daemon.Mount will increase the refcount of mounted path,
for those previous running containers, `Mount` call will make
the refcount to 2. see
https://github.com/docker/docker/blob/v1.13.0-rc4/daemon/graphdriver/counter.go#L38
```
	if !m.check {
		m.check = true
		if c.checker.IsMounted(path) {
			m.count++
		}
	}
	m.count++

```
graphdrive could restore on reboot after #22541, call
daemon.Mount to resore the graphdriver is not necessary.

And call `daemon.Mount` on restorting will mount all the containers
mounted layer even if it was stop.

This fix call Mount and then Unmount to get `BaseFs`

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-01-05 20:27:34 -05:00
Yong Tang
25b967e149 Allow containers to continue even if mount failed after live restore
This fix is a follow up to #29365. In #29365 a bug was fixed for
`docker exec -u user` after live restore by remounting.
However, #29365 will prevent containers from restored if mount failed.

In this fix, containers will be restored even if mount in that step failed.
Some functionalities might be missing (like `docker exec -u user`) but
at least it is possible to do certain operations like stop/restart/delete.

This fix is related to #29365.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3003ae1d8b)
2017-01-05 20:27:19 -05:00
Aaron Lehmann
eb5273edd4 [1.13] Revendor swarmkit to 7f910df
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-01-05 14:53:47 -08:00
Vincent Demeester
46afc8f148 Change the way IPAM configuration is handled on stack deploy
We use the 'default' driver if none is specified.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 20:25:04 +01:00
Tibor Vass
1afd41e4f7 Merge pull request #29866 from vieux/1.13.0-rc5-cherrpicks
1.13.0 rc5 cherrypicks
2017-01-04 11:04:22 -08:00
Victor Vieux
43cc971d76 bump version to rc5
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 04:27:03 -08:00
Victor Vieux
7f20c11c47 Merge pull request #29878 from mavenugo/npfilter2
Cherry-pick #29877 : Use GetAllByCap to get list of network plugins in docker info
2017-01-04 14:54:32 -08:00
Madhu Venugopal
69240476d4 Swarmkit has enabled the plugin filtering logic based on the drivers
returned in "docker info". Currently info endpoint isnt using the
GetAllByCap, but relies on existing networks to get the plugin names.
This causes a basic issue when it comes to global network plugins which
swarm-mode relies on, wherein swarmkit will not be able to schedule the
network on the worker nodes due to the filtering logic.

In order to break this chicken & egg issue, we must start to use the
GetAllManagedPluginsByCap. We are unable to use GetAllByCap due to
various issues with Plugin-V1's lazy loading approach causing issues
especially during daemon restarts (which uses SystemInfo)

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-04 12:46:56 -08:00
Lei Jitang
a46dbbded9 Fix update clear the restart policy of monitor
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 737b5b1781)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Victor Vieux
4e9dd0e51c replace no-remove by sample-volume-plugin in docs
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit bcead9282e)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Brian Goff
84f25c7cb8 Fix race/deadlock in v1 plugin handlers
When a plugin is activated, and then `plugins.Handle` is called to
register a new handler for a given plugin type, a deadlock occurs when
for anything which calls `waitActive`, including `Get`, and `GetAll`.

This happens because `Handle()` is setting `activated` to `false` to
ensure that plugin handlers are run on next activation.
Maybe these handlers should be called immediately for any plugins which
are already registered... but to preserve the existing behavior while
fixing the deadlock, track if handlers have been run on plugins and
reset when a new handler is registered.

The simplest way to reproduce the deadlock with Docker is to add a `-v
/foo` to the test container created for the external graphdriver tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 2938dce794)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Yong Tang
6841887132 Add --file flag for docker secret create command
This fix tries to address the issue raised in 28581 and 28927
where it is not possible to create a secret from a file (only
through STDIN).

This fix add a flag `--file` to `docker secret create` so that
it is possible to create a secret from a file with:
```
docker secret create --file secret.in secret.name
```

or
```
echo TEST | docker secret create --file - secret.name
```

Related docs has been updated.

An integration test has been added to cover the changes.

This fix fixes 28581.
This fix is related to 28927.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit c6f0b7f448)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Yanqiang Miao
aa5ac38f41 Optimization a error description
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 6c021893aa)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:55 +01:00
Yong Tang
d01138c162 Remove docker stack ps -a to match removal of docker service/node ps -a
In #28507 and #28885, `docker service/node ps -a` has been removed so that
information about slots are show up even without `-a` flag.

The output of `docker stack ps` reused the same output as `docker service/node ps`.
However, the `-a` was still there. It might make sense to remove `docker stack ps -a`
as well to bring consistency with `docker service/node ps`.

This fix is related to #28507, #28885, and #25983.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 9155e14e77)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:54 +01:00
Brian Goff
def75b2c2c Fixes a race condition in client events monitoring
In cases where there is high latency (ie, not-local network)
`waitExitOrRemoved` was not receiving events for short-lived containers.
This caused the client to hang while waiting for a notification that the
container has stopped.

This happens because `client.Events()` returns immediately and spins a
goroutine up to process events. The problem here is it returns before
the request to the events endpoint is even made.
Even without high-latency issues, there is no guarantee that the
goroutine is even scheduled by the time the function returns.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 47585996bf)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:44:54 +01:00
Harald Albers
ff7934faf2 Fix usage message of plugin inspect
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 1b58d0bc51)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:44:54 +01:00
Daniel Nephin
045e9834a5 Trim quotes from TLS flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit abe32de6b4)
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-04 12:43:17 +01:00
Daniel Nephin
a2dc349c74 Add quoted string flag Value.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit e4c1f07729)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Sebastiaan van Stijn
7cbc4cb7f2 fix powershell dco check
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 611a633ba4)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Yong Tang
e2b04a7818 Fix image's CMD after WORKDIR in Dockerfile
This fix tries to fix 29667 where image's `CMD` is modified
after `WORKDIR` in Dockerfile.

The value of `b.runConfig.Cmd` was modified in the processing
of `WORKDIR`, in order to fix 28902. However, the same
`b.runConfig.Cmd` is passed to `commit()`.

This fix restored the `b.runConfig.Cmd` before `commit()`
the image for `WORKDIR`.

A test has been added.

This fix fixes 29667.

This fix is related to 28902, 28909, 28514.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 0836023847)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Harald Albers
ea00b14170 Add bash completion for plugin disable --force
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e1403453f0)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Harald Albers
5903ead08e Fix bash completion for plugin enable|disable
`docker plugin enable` and `docker plugin disable` only
accept one plugin.

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 390effdd11)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Alexander Morozov
428ae70759 commit: do not change container labels on commit
Fix #29547

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ca6c6f0765)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:42 +01:00
Brian Goff
eefb2220c0 Fix usage of boltdb in volume restore
bolt k/v pairs are only valid for the life of a transaction.
This means the memory that the k/v pair is referencing may be invalid if
it is accessed outside of the transaction.
This can potentially cause a panic.

For reference: https://godoc.org/github.com/boltdb/bolt#hdr-Caveats

To fix this issue, unmarshal the stored data into volume meta before
closing the transaction.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 4876a9047e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
yuexiao-wang
8b155a9109 Update 'ID' field for 'docker plugin ls'
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 1e6587ff28)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Harald Albers
c809c40647 Add bash completion for plugin install --alias
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 83158f8aff)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Yanqiang Miao
994b3928f6 Add 'volume prune' to the volume commands index
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 3d4ea98971)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Harald Albers
39b3e39c40 Remove bash completion for deprecated docker daemon
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 536a9ec698)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Harald Albers
e7960584f2 Remove --all|-a from docker node ps reference
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 364e900237)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Harald Albers
c25a4762ef Remove bash completion for docker node ps --all|-a
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit a54cc4f88d)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Zhang Wei
2c53989b4b Add missing "--default-runtime" flag in manpage
Add missing flag and more descriptions in manpage.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
(cherry picked from commit 977fd43985)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Akihiro Suda
1c5cb46649 update experimental/README.md
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit eb11a10ddf)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:41 +01:00
Tobias Gesellchen
97b0bb730e fix swagger description for DELETE /plugin/{name}
Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
(cherry picked from commit e6b2829a7f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:40 +01:00
Tonis Tiigi
6d6c11dceb Fix inspect object by invalid reference
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 3cd39aaeab)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-04 12:42:40 +01:00
lixiaobing10051267
cf93b2b1c2 update URL of plugins_graphdriver.md in experimental/README.md
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

(cherry picked from commit 82eeab62df)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-03 23:47:46 -08:00
allencloud
7a89c43a5e update plugins in docs and correct things in index.md
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 6d3e1d2fd2)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-03 23:47:01 -08:00
yuexiao-wang
8afa73d280 Update reference document for secret and stack
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 7bb31f3168)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-03 23:46:29 -08:00
Victor Vieux
d2a4a53f11 small secret doc update
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 91b739b552)
Signed-off-by: Victor Vieux <vieux@docker.com>
2017-01-03 23:45:30 -08:00
Tibor Vass
7d58f5fb88 Merge pull request #29869 from cpuguy83/backport_28263
[cherry-pick] Moves graphdriver plugin docs out of experimental
2017-01-03 21:35:06 -08:00
Tibor Vass
73be1c098a Merge pull request #29858 from mavenugo/1.13-nplugins
Cherry-pick : Fixing a couple of network plugin life-cycle mgmt issues
2017-01-03 19:56:11 -08:00
Brian Goff
c18f592150 Moves graphdriver plugn docs out of experimental
Also updates some of the structures being sent so plugins are getting
all the new options.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-01-03 21:58:43 -05:00
Tibor Vass
f335200410 Merge pull request #29859 from thaJeztah/1.13-fix-anonymous-volumes
[1.13] fix anonymous volumes
2017-01-03 16:20:10 -08:00
Madhu Venugopal
c5b5b4ea45 Properly cleanup plugin states which might impact other tests
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-03 15:37:47 -08:00
Madhu Venugopal
627bc91727 Handle Plugin reference count during network create and delete
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-03 15:37:47 -08:00
Madhu Venugopal
15293063ba Vendoring libnetwork to bring in isbuiltin changes
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-03 15:37:47 -08:00
Madhu Venugopal
b219698e75 Add a GetAll function that returns only managed plugins supported by V2
The current GetAll handles both V2 and legacy plugins. Also due to the
nature of V1 plugins, it also loads them. This causes problems when
loading is not required. Hence adding an independent API that will
return only the plugins that are loaded using v2 mangaed plugins.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-03 15:37:46 -08:00
Sebastiaan van Stijn
1ca25a2e5e
Improve validation for volume specs
The current validation only checked for the
number of elements in the volume-spec, however,
did not validate if the elements were empty.

Because of this, an empty volume-spec (""),
or volume spec only containing separators ("::")
would not be invalidated.

This adds a simple check for empty elements in
the volume-spec, and returns an error if
the spec is invalid.

A unit-test is also added to verify the behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-03 21:49:03 +01:00
Sebastiaan van Stijn
36c0b59149
fix conversion of anonymous volumes in compose-file
the `convertVolumeToMount()` function did not take
anonymous volumes into account when converting
volume specifications to bind-mounts.

this resulted in the conversion to try to
look up an empty "source" volume, which
lead to an error;

    undefined volume:

this patch distinguishes "anonymous"
volumes from bind-mounts and named-volumes,
and skips further processing if no source
is defined (i.e. the volume is "anonymous").

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-03 21:22:07 +01:00
Brian Goff
3e0df05ec4 Merge pull request #29734 from tonistiigi/1.13-plugins
[v1.13] plugins updates
2016-12-28 10:56:21 -05:00
Tonis Tiigi
f02d46f050 Fix validation of plugins without rootfs in config
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 6c7cb52009)
2016-12-27 17:21:08 -08:00
Derek McGowan
25bbf8ab7c Support for docker content trust for plugins
Add integration test for docker content trust

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
(cherry picked from commit 14e8bba4f5)
2016-12-27 14:27:28 -08:00
Tonis Tiigi
38d914cc96 Implement content addressability for plugins
Move plugins to shared distribution stack with images.

Create immutable plugin config that matches schema2 requirements.

Ensure data being pushed is same as pulled/created.

Store distribution artifacts in a blobstore.

Run init layer setup for every plugin start.

Fix breakouts from unsafe file accesses.

Add support for `docker plugin install --alias`

Uses normalized references for default names to avoid collisions when using default hosts/tags.

Some refactoring of the plugin manager to support the change, like removing the singleton manager and adding manager config struct.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
(cherry picked from commit 3d86b0c79b)
2016-12-27 13:31:14 -08:00
Derek McGowan
bb37c67a90 Abstract distribution interfaces from image specific types
Move configurations into a single file.
Abstract download manager in pull config.
Add supports for schema2 only and schema2 type checking.
Add interface for providing push layers.
Abstract image store to generically handle configurations.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
(cherry picked from commit 3c7676a057)
2016-12-27 13:31:06 -08:00
Derek McGowan
a55a9b14d1 Update distribution vendor for manifest builder change
Manifest builder allows setting the configuration type
for the manifest being build. Additionally the default
type has been renamed to reflect it is an image type.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
(cherry picked from commit 61ac7c4bf8)
2016-12-27 13:30:44 -08:00
Anusha Ragunathan
2039ea6adc Enforce zero plugin refcount during disable.
When plugins have a positive refcount, they were not allowed to be
removed. However, plugins could still be disabled when volumes
referenced it and containers using them were running.

This change fixes that by enforcing plugin refcount during disable.
A "force" disable option is also added to ignore reference refcounting.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 8cb2229cd1)
2016-12-27 13:19:25 -08:00
Yong Tang
05426c80d9 Fix docker plugin inspect <unkown object> issue on Windows
This fix is a follow up for comment:
https://github.com/docker/docker/pull/29186/files#r91277345

While #29186 addresses the issue of `docker inspect <unknown object>`
on Windows, it actually makes `docker plugin inspect <unknown object>`
out `object not found` on Windows as well. This is actually misleading
as plugin is not supported on Windows.

This fix reverted the change in #29186 while at the same time,
checks `not supported` in `docker inspect <unknown object>` so that
- `docker plugin inspect <unknown object>` returns `not supported` on Windows
- `docker inspect <unknown object>` returns `not found` on Windows

This fix is related to #29186 and #29185.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 0b3c10ac4d)
2016-12-27 13:19:16 -08:00
Yong Tang
fed1b91bb4 Use GetByName to check for collision before create any context in plugin creation
This fix is a follow up to the comment:
https://github.com/docker/docker/pull/28717#discussion_r90040589

Currently, the collision checking is done at the last step `Add()` of
plugin creation. However, at this stage the context such as plugin
directories have already been creation. In case of name collision,
rollback is needed which could be expensive.

This fix performs the check at the beginning of CreateFromContext using
GetByName. In this way, collision fails fast and no context creation
or rollback is needed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 52405a9b58)
2016-12-27 12:10:11 -08:00
Victor Vieux
88862e707a bump 1.13.0-rc4
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-16 02:10:49 -08:00
Victor Vieux
f3749c5a9c Merge pull request #29465 from docker/1.13.0-rc4-cherrypicks
1.13.0-rc4 cherry-picks: part2
2016-12-16 13:12:57 -08:00
Victor Vieux
7d4318c83c Merge pull request #29433 from aaronlehmann/swarm-plugins-1.13
[1.13] Support v2 plugins in swarm mode
2016-12-16 12:47:52 -08:00
Aaron Lehmann
05fba4af5f Add integration test for volume plugins on swarm
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-16 10:44:26 -08:00
Aaron Lehmann
501083e82a Fix volume Create to check against canonical driver name
Previously, it was comparing against the driver name passed in by the
caller. This could lead to subtle issues when using plugins, like
"plugin" vs. "plugin:latest".

Also, remove "conflict:" prefix to improve the error message.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit a854cf262336e5625ec06e8e12e8ebc1500ce656)
2016-12-16 10:44:26 -08:00
Aaron Lehmann
4e5129c511 Publish installed v2 plugins to manager
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 2a97ea9a6e)
2016-12-16 10:44:25 -08:00
Aaron Lehmann
e460a5f45c Vendor swarmkit from bump_v1.13.0 branch
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-16 10:44:25 -08:00
Victor Vieux
c9a557765e Merge pull request #29469 from aaronlehmann/swarm-content-trust-1.13
[1.13] Backport "Content trust for swarm services"
2016-12-16 01:00:27 -08:00
Brian Goff
1a865dd303 Fix volume plugin refecounting on daemon restart
Ensures all known volumes (known b/c they are persisted to disk) have
their volume drivers refcounted properly.

In testing this, I found an issue with `--live-restore` (required since
currently the provided volume plugin doesn't keep state on restart)
where restorted plugins did not have a plugin client loaded causing a
panic when trying to use the plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 6ef1060cd0)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 23:39:28 -08:00
Akihiro Suda
0c19045523 api: allow creating a network of which name is the prefix of the ID of a swarm network
Previously, it doesn't allow creating such a network:

e.g.

    $ docker network inspect -f '{{.Id}}' ingress
    84xh9knigj6zyt00u31e26nj3
    $ docker network create 84
    Error response from daemon: network with name 84 already exists

Fix #27866

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit edfbc3b876)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 22:59:42 -08:00
Andrew Hsu
ecf7a631a6 remove fedora-23 because eol
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit ef98091a90)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 22:45:20 -08:00
yuexiao-wang
f573d8b621 Fix inconsistency for pause and unpause
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 082f4919ca)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 22:42:43 -08:00
yuexiao-wang
51020f7074 Add the whole related information for node
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit b67b0949ed)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 22:42:02 -08:00
Sebastiaan van Stijn
5391ce8ffa swarm leave is not only for workers
the "docker swarm leave" command description
mentioned that the command can only be used
for workers, however, the command can also
be used for managers (using the `-f` / `--force`
option).

this patch removes the "(workers only)" part
of the command description.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f89eee5d9d)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 22:41:43 -08:00
Victor Vieux
29f42b4036 fix devices in plugins
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 6f00601c9f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 22:19:28 -08:00
Brian Goff
caaee2ebab Make graphdriver plugin use plugin BasePath
Also enables `PropagatedMount` for graphdrivers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 500210475f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 22:19:22 -08:00
Yong Tang
315c34953d Show usage when docker swarm update has no flags
This fix tries to address the issue raised in 24352. Previously,
when `docker swarm update` has no flags, the output is
```
Swarm updated.
```
even though nothing was updated. This could be misleading for
users.

This fix tries to address the issue by adding a `PreRunE` function
in the command so that in case no flag is provided (`cmd.Flags().NFlag() == 0`),
the usage will be outputed instead.

An integration has been added to cover the changes.

This fix fixes 24352.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 5aa5a1cb00)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 21:07:18 -08:00
Trapier Marshall
b5d4f87612 fix typo in reference for service create
Signed-off-by: Trapier Marshall <trapier.marshall@docker.com>
(cherry picked from commit 90c680ad25)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 21:06:23 -08:00
Harald Albers
dc05dfd30e Make bash completion for docker stack deploy --bundle-file experimental
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit a53bdfa3be)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 21:06:23 -08:00
Harald Albers
f68d703a8c Add docs for docker network create --attachable
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 7433d3acf6)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 21:06:23 -08:00
yuexiao-wang
ce5ea47cb0 Add the link for service logs
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 54d38fe115)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 21:06:23 -08:00
Christopher Jones
a260417927 [plugins] return err when failing remove
Fixes a case where removing the plugin from disk would
fail silently. Also moves pluginStore remove after we
remove from disk, so 'docker plugin ls' doesn't isn't
empty in case it errors out.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit fb11164c4f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 21:06:23 -08:00
Yong Tang
a80251e8cd Fix docker exec -u issue after docker daemon restart
This fix tries to address the issue raised in 29342 where
`docker exec -u` after docker daemon restart returns an error:
```
unable to find user test: no matching entries in passwd file
```

The reason was that `container.BaseFS` is not present after restart.

This fix adds the `daemon.Mount` during the restore to bring up the
`container.BaseFS`.

An integration test has been added to cover the changes.

This fix fixes 29342.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 7feb2a17e4)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-15 21:06:23 -08:00
Aaron Lehmann
8f724a277a integration-cli: Add integration tests for swarm services + content trust
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 62cd3b39f9)
2016-12-15 20:44:22 -08:00
Aaron Lehmann
61dc897a30 cli: Pin image to digest using content trust
Implement notary-based digest lookup in the client when
DOCKER_CONTENT_TRUST=1.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit d4d6f8c0d0)
2016-12-15 18:20:13 -08:00
Aaron Lehmann
5e7d2ab3b8 cli: Split out GetNotaryRepository and associated functions
Split these into cli/trust so that other commands can make use of them.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 4b8c79f25e)
2016-12-15 18:20:07 -08:00
Aaron Lehmann
261f9b6243 registry: Remove reference.go
This removes some very old vestigial code that really should have been
removed during the content addressability transition. It implements
something called "reference" but it behaves differently from the actual
reference package. This was only used by client-side content trust code,
and is relatively easy to extricate.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit d91ed88365)
2016-12-15 18:18:47 -08:00
Justin Cormack
45b441f4f9 Merge pull request #29395 from mavenugo/exp13
Cherry-pick : Add the missing experimental ipvlan network driver
2016-12-15 14:56:00 -08:00
Sebastiaan van Stijn
61ce93a6f5 Merge pull request #29429 from vdemeester/publish-long-short-syntax-1_13
[1.13.x] Publish long short syntax 1 13
2016-12-15 21:44:06 +01:00
Vincent Demeester
162ef5d158
Make --publish-rm precedes --publish-add, so that add wins
`--publish-add 8081:81 --publish-add 8082:82 --publish-rm 80
--publish-rm 81/tcp --publish-rm 82/tcp` would thus result in 81 and
82 to be published.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-15 09:15:54 +01:00
Vincent Demeester
37ea8104b0
Remove --port and update --publish for services to support syntaxes
Add support for simple and complex syntax to `--publish` through the
use of `PortOpt`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-15 07:24:26 +01:00
Victor Vieux
1b521547f0 Merge pull request #29229 from vieux/1.13.0-rc4-cherrypicks
1.13.0-rc4 cherry-picks: part1
2016-12-14 17:18:17 -08:00
Victor Vieux
4d2be03b68 Merge pull request #29418 from aboch/p66
[1.13.x] Fix buildIpamResources()
2016-12-14 15:28:58 -08:00
Alessandro Boch
fa9618550a Fix buildIpamResources()
- Can no longer assume IPv6 operational data to be present

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-12-14 10:36:44 -08:00
Madhu Venugopal
29861173e1 Pass daemon experiemental flag to libnetwork
Required to enable ipvlan experimental network driver

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-12-14 00:55:34 -08:00
Madhu Venugopal
b7316e85c0 Vendor libnetwork with experimental daemon flag handling
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-12-14 00:54:57 -08:00
Victor Vieux
efdf7ae8f3 skip empty networks in plugin install
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit 04e35a01fc)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 23:49:27 -08:00
yuexiao-wang
a4af72fc87 Update the manual for docker wait
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 303ff807f2)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 23:48:53 -08:00
Ben Firshman
20dc482b10 Add display name for tags in swagger.yaml
In #29071, we made the tags the correct name for generating types,
at the expense of the menu in the documentation looking good.

ReDoc now has support for tag display names
( https://github.com/Rebilly/ReDoc/pull/152 ), so we can assign
a more human-friendly name to the menu items.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 0caa6c218c)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 23:48:22 -08:00
Brian Goff
8b31f217ff Refcount graphdriver plugins properly
Adds 2 new methods to v2 plugin `Acquire` and `Release` which allow
refcounting directly at the plugin level instead of just the store.
Since a graphdriver is initialized exactly once, and is really managed
by a separate object, it didn't really seem right to call
`getter.Get()` to refcount graphdriver plugins.
On shutdown it was particularly weird where we'd either need to keep a
driver reference in daemon, or keep a reference to the pluggin getter in
the layer store, and even then still store extra details on if the
graphdriver is a plugin or not.

Instead the plugin proxy itself will handle calling the neccessary
refcounting methods directly on the plugin object.

Also adds a new interface in `plugingetter` to account for these new
functions which are not going to be implemented by v1 plugins.

Changes terms `plugingetter.CREATE` and `plugingetter.REMOVE` to
`ACQUIRE` and `RELEASE` respectively, which seems to be better
adjectives for what we're doing.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit f29bbd16f5)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 19:56:51 -08:00
Dong Chen
39c9f1c024 Run overlay attachable test on a single daemon
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit e42d1bb4b2)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 19:56:51 -08:00
Brian Goff
4e08d8ef03 Fix issues with plugin and --live-restore
Fixes an issue when starting the daemon with live-restore
where previously it was not set, plugins are not running.

Fixes an issue when starting the daemon with live-restore, the plugin
client (for interacting with the plugins HTTP interface) is not set,
causing a panic when the plugin is called.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit cb6633175c)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 19:56:44 -08:00
Sebastiaan van Stijn
47b838db40 Update reference docs for service ps
commit bbd2018ee1
changed the output format of `docker service ps`.

this patch updates the reference docs
to match the updated output format.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5902fa3384)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 17:10:24 -08:00
yuexiao-wang
1dd2e2f545 Fix the incorrect option name
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit b101e451f1)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 17:10:05 -08:00
lixiaobing10051267
e65660da3d stack_config.md not exist and delete it
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit afaff51a8b)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 17:09:47 -08:00
John Howard
004ec96608 Windows: Prompt fix
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 30b8f08443)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 17:09:29 -08:00
yuexiao-wang
54e52b97f4 Update the option 'network' for docker build
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit cd317282c9)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 17:09:12 -08:00
allencloud
4aa72cb5a9 add missing status code 403 for services/create in docs
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 19654fd71e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 17:08:53 -08:00
Sebastiaan van Stijn
f59aa96e3d deprecate "top-level" network information in NetworkSettings
When inspecting a container, `NetworkSettings` contains top-level
information about the default ("bridge") network;

`EndpointID`, `Gateway`, `GlobalIPv6Address`, `GlobalIPv6PrefixLen`,
`IPAddress`, `IPPrefixLen`, `IPv6Gateway`, and `MacAddress`.

These properties are deprecated in favor of per-network properties in
`NetworkSettings.Networks`. These properties were already "deprecated" in
docker 1.9, but kept around for backward compatibility.

Refer to [#17538](https://github.com/docker/docker/pull/17538) for further
information.

This officially deprecates these properties, and marks them
for removal in 1.16

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ae6f09b29c)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-13 17:08:28 -08:00
Victor Vieux
89c27499da Merge pull request #29340 from vieux/1.13_changelog
update changelog 1.13.0-rc4
2016-12-13 09:41:03 -08:00
Christopher Jones
4c65bf9a10 [integration-cli] skip plugin tests on non-x86
Due to the test plugins being architecture specific, these
tests fail to start the plugin (even though they don't fail yet)

Temporary fix until we can build architecture specific test
plugins.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit ebff8c79a3)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 20:56:38 -08:00
Victor Vieux
1149997787 update changelog 1.13.0
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 17:08:18 -08:00
Anusha Ragunathan
1a86cbb031 When plugin enable fails, unmount PropagatedMount.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit cef443bddf)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 16:17:19 -08:00
Aleksa Sarai
80c3ed1c0c daemon: switch to 'ensure' workflow for AppArmor profiles
In certain cases (unattended upgrades), system services can disable
loaded AppArmor profiles. However, since /etc being read-only is a
supported setup we cannot just write a copy of the profile to
/etc/apparmor.d.

Instead, dynamically load the docker-default AppArmor profile if a
container is started with that profile set. This code will short-cut if
the profile is already loaded.

Fixes: 2f7596aaef ("apparmor: do not save profile to /etc/apparmor.d")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
(cherry picked from commit 567ef8e785)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 16:16:50 -08:00
Aleksa Sarai
20d6f23b55 apparmor: switch IsLoaded to return bool
Signed-off-by: Aleksa Sarai <asarai@suse.de>
(cherry picked from commit e440a57a79)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:33:10 -08:00
Yong Tang
20a7e39728 Fix missing IPAM options in swarm network mode
This fix tries to fix the issue raised in 29044 where
the IPAM options is missing in swarm network mode
after the service is deployed. Before the service
is deployed, the IPAM options is available.

The reason for the issue is that, before service is
deployed, `network inspect` is querying the swarm and
obtained the correct information.
However, after service is deployed, swarm executor
does not pass the IPAM options to the backend (daemon).
Also after service is deployed, `network inspect` is
actually querying the local daemon for information.
At this time the network information with missing IPAM
options is returned.

This fix fixes the issue by updating the swarm network
allocator and swarm executor.

A separate PR for swarmkit will be opened.

An integration test has been added to cover the change.

This fix fixes 29044.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 4d958e99c1)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:26:30 -08:00
Misty Stanley-Jones
09296e053d Edits to plugin upgrade warning
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 66cbb5a552)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:26:12 -08:00
Lajos Papp
1f4dc1158c Note about potential plugin issue when upgrading
Fixes: #29172
Fixes: https://github.com/docker/for-mac/issues/1000

Signed-off-by: Lajos Papp <lalyos@yahoo.com>
Signed-off-by: lalyos <lalyos@yahoo.com>
(cherry picked from commit acd847cd56)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:26:06 -08:00
Andrea Luzzardi
99eb943186 service ps: Revert output to 1.12 behavior.
- Display the ID column
- Do not append the task ID in the name column
- (NEW): Truncate task IDs, unless --no-trunc is specified

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
(cherry picked from commit bbd2018ee1)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:25:44 -08:00
Victor Vieux
d8e435ab6c remove old media type compat for plugins
Signed-off-by: Victor Vieux <vieux@docker.com>
(cherry picked from commit f644e758bd)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:25:27 -08:00
John Howard
09cd31b128 Windows: Fix crash in docker system prune
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit e5900ee9bf)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:25:01 -08:00
Harald Albers
85ae13f6d0 Add bash completion for docker inspect --type plugin
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 81b4b2b5fa)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:24:42 -08:00
Qinglan Peng
fcb58702bc 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: Victor Vieux <vieux@docker.com>
2016-12-12 13:24:22 -08:00
Kei Ohmura
cc855179cf docs: fix description of docker swarm update --help
Signed-off-by: Kei Ohmura <ohmura.kei@gmail.com>
(cherry picked from commit 2f0e00f587)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:24:03 -08:00
Kei Ohmura
9a6c5e14be docs: fix description of docker swarm join --help
Signed-off-by: Kei Ohmura <ohmura.kei@gmail.com>
(cherry picked from commit 77dd8474a7)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:23:57 -08:00
Martin Honermeyer
0d575d1304 Fix link to volume label support in changelog
Signed-off-by: Martin Honermeyer <maze@strahlungsfrei.de>
(cherry picked from commit bb06e138e4)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:23:37 -08:00
Steve Durrheimer
508d06752d Add zsh completion for 'docker inspect --type=plugin' and other missing ones
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 2bdffc1fb5)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:22:44 -08:00
lixiaobing10051267
159f4f14d7 replace env description with args in extend config
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit abdc031aea)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-12 13:22:24 -08:00
Victor Vieux
de5fba3833 Merge pull request #29333 from sanimej/libn_bump_1.13.x
Update libnetwork to 4df06c4
2016-12-12 13:16:51 -08:00
Santhosh Manohar
4b7bef26c5 Update libnetwork to 4df06c4
This fixes docker #28931, #28172, #28969

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-12-12 11:40:14 -08:00
Brian Goff
cd7fea22f4 Merge pull request #29294 from yongtang/1.13.x
[1.13.x] Update vendored swarmkit to b5f07ce49c66d2f5feee83998b23d4c905b78155
2016-12-12 11:46:50 -05:00
Yong Tang
30b458a28c [1.13.x] Update vendored swarmkit to b5f07ce49c66d2f5feee83998b23d4c905b78155
This fix update swarmkit to b5f07ce49c66d2f5feee83998b23d4c905b78155

The following changes have been included:
- Fix missing IPAM options in swarm network mode (docker/swarmkit#1789)

The above PR is related to docker PR #29074 and docker issue #29044.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-12-10 04:02:22 -08:00
Yong Tang
870beb70fb xFix issue for --hostname when running in "--net=host"
This fix tries to address the issue raised in 29129 where
"--hostname" not working when running in "--net=host" for
`docker run`.

The fix fixes the issue by not resetting the `container.Config.Hostname`
if the `Hostname` has already been assigned through `--hostname`.

An integration test has been added to cover the changes.

This fix fixes 29129.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit b0a7b0120f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:42:16 -08:00
Doug Davis
64aac182d6 Fix processing of unset build-args during build
This reverts 26103.  26103 was trying to make it so that if someone did:
  docker build --build-arg FOO .
and FOO wasn't set as an env var then it would pick-up FOO from the
Dockerfile's ARG cmd.  However, it went too far and removed the ability
to specify a build arg w/o any value. Meaning it required the --build-arg
param to always be in the form "name=value", and not just "name".

This PR does the right fix - it allows just "name" and it'll grab the value
from the env vars if set. If "name" isn't set in the env then it still needs
to send "name" to the server so that a warning can be printed about an
unused --build-arg. And this is why buildArgs in the options is now a
*string instead of just a string - 'nil' == mentioned but no value.

Closes #29084

Signed-off-by: Doug Davis <dug@us.ibm.com>
(cherry picked from commit cdb8ea90b0)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:24:00 -08:00
Jake Sanders
4fba52a2f7 Add registry-specific credential helper support
Signed-off-by: Jake Sanders <jsand@google.com>
(cherry picked from commit 07c4b4124b)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:23:58 -08:00
John Howard
b18516e6ac Windows: make.ps1 fix DCO check
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit e538c1fdca)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:20:25 -08:00
Michael Friis
6e08e2edcf remove bonus whitespace
Signed-off-by: Michael Friis <friism@gmail.com>
(cherry picked from commit 8d47858f96)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:20:00 -08:00
Sebastiaan van Stijn
c027e4a861 remove unsupported distros from install script
The install script currently includes some
distros that we don't actually have packages
for.

For these distros, the script currently
performs step to install Docker from
the distro's repository.

This patch removes those distros from
the install script, because we have no
control over these packages, and cannot
provide support for them.

Installing docker anyway will give the
false impression that they installed
a package from our repository (but they
didn't), and that they need to contact
us for support.

It's better to tell people that we don't
install in that case, and refer them to
the installation documentation, or the
documentation of their distro.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 29b98b6ee6)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:17:25 -08:00
Anusha Ragunathan
1c858abc96 Fix race in setting plugin refcounts.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 4c088d1e2e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:16:26 -08:00
Tibor Vass
3a571b72fd plugins: container-rootfs-relative paths
Legacy plugins expect host-relative paths (such as for Volume.Mount).
However, a containerized plugin cannot respond with a host-relative
path. Therefore, this commit modifies new volume plugins' paths in Mount
and List to prepend the container's rootfs path.

This introduces a new PropagatedMount field in the Plugin Config.
When it is set for volume plugins, RootfsPropagation is set to rshared
and the path specified by PropagatedMount is bind-mounted with rshared
prior to launching the container. This is so that the daemon code can
access the paths returned by the plugin from the host mount namespace.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit c54b717caf)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:16:04 -08:00
Qinglan Peng
aa22b96457 fix some version information
Signed-off-by: Qinglan Peng <qinglanpeng@zju.edu.cn>
(cherry picked from commit aa26364ce1)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:15:08 -08:00
lixiaobing10051267
d842cf6db6 add SCOPE field content for docker network ls
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

(cherry picked from commit 170fcead7e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:14:27 -08:00
Anusha Ragunathan
213ee20706 Make v2/Plugin accesses safe.
v2/Plugin struct had fields that were
- purely used by the manager.
- unsafely exposed without proper locking.
This change fixes this, by moving relevant fields to the manager as well
as making remaining fields as private and providing proper accessors for
them.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit b35490a8ba)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:13:13 -08:00
Evan Hazlett
f081b22a4a add headers when using exec
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

ensure headers are properly sanitized

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
(cherry picked from commit f86db80b5f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:12:09 -08:00
Ian Campbell
c84f43d63f Caution against the use of CONFIG_LEGACY_VSYSCALL_NATIVE
It provides an ASLR-bypassing target with usable ROP gadgets.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
(cherry picked from commit 49dcce7ba0)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:11:46 -08:00
Xianglin Gao
be7d576f5d fix apparmor load profile
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
(cherry picked from commit 2ab8f2e389)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:10:58 -08:00
Derek McGowan
cca0132fcf Add class to repository scope
Expose registry error translation for plugin distribution

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit a12b466183)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:10:29 -08:00
Derek McGowan
9ecbaa77ae Update vendor distribution
Distribution client change for class in resource

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit d1f5e0f7a6)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-09 14:10:23 -08:00
Victor Vieux
edd9c522b7 Merge pull request #29232 from aaronlehmann/vendor-swarmkit-999addf
[1.13] Update vendored swarmkit to 999addf
2016-12-09 13:51:32 -08:00
Aaron Lehmann
aca0bdab13 Update vendored swarmkit to 999addf
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-07 17:59:31 -08:00
unclejack
674cf8233d api/types/container,client: gofmt
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
(cherry picked from commit c1ce63b17b)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:23:00 -08:00
yuexiao-wang
90a24f7bfd Optimize the log info for client test
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 40b8ff6243)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:22:57 -08:00
Antonio Murdaca
6c8bd56007 hack/make.sh: fix BUILDTIME
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 7b1f77dcbc)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:20:38 -08:00
Steve Durrheimer
78f2dc90bf Add zsh completion for 'docker network create --attachable'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit bce11a29f8)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:17:33 -08:00
lixiaobing10051267
52b88ccc23 modify URLs for bind docker in docs/api
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit 9c76fb253e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:17:14 -08:00
Lei Jitang
c9ec321e56 fix #29199, reset container if container start failed
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit e806821b53)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:16:55 -08:00
Yong Tang
bec385cff0 Fix docker inspect <unkown object> issue on Windows
This fix tries to address the issue raised on 29185 where
`docker inspect <unknown object>` on Windows will return:
```
Error response from daemon: plugins are not supported on this platform
```

The reason was that in case `--type` is not specified, `docker inspect`
will iterate through different types `container`, `image`, `network`,
`plugin` etc. The `plugin` object is the last type to check.

However, as `plugin` is not supported on Windows yet, the error message
is not very informative for `plugins are not supported on this platform`.

This fix tries to fix the issue by return a `not found` error on unsupported
platforms as well.

An integration test has been added to cover the changes for Windows/Linux.

This fix fixes 29185.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 88fcdb0a82)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:16:34 -08:00
Harald Albers
0383913b65 Add bash completion for docker network create --attachable
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 8d2e789bbc)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:16:09 -08:00
allencloud
51b83ae8fb add 403 for endpoint network create
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 0d21e24b9f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:15:45 -08:00
John Howard
ad794bba5b Windows: Dockerfile 2GB clarification Hyper-V
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit f7b4d65445)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:15:24 -08:00
John Howard
540758ee99 Windows: make.ps1 Throw exception on failure
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 8c22a00b77)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:15:01 -08:00
Vincent Demeester
0f2364f73c Handle logging in compose to swarm
Logging configuration was completely ignore when deploy a compose file
to swarm. This fixes it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 806cc1e0f8)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:14:20 -08:00
Harald Albers
6ce7fb23f5 Add bash completion for docker version --format
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 3d43c48c1b)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:13:12 -08:00
Harald Albers
fd7aee8fe0 Fix bash completion for `docker service create|update
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit be5685e4bf)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:12:50 -08:00
Harald Albers
e0d8cfaa7d Add bash completion for secret management
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 324dd3cfec)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:12:29 -08:00
Arash Deshmeh
62fdac59bd Print checkpoint id when creating a checkpoint
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
(cherry picked from commit f1df2d5a2e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:11:43 -08:00
erxian
487fad2a2c refine api swagger.yaml towards image create status code
Signed-off-by: erxian <evelynhsu21@gmail.com>
(cherry picked from commit 15be050fb3)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:11:20 -08:00
Akihiro Suda
e26de82e54 improve TestServiceLogs for the goroutine issue #28915
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit f8a93d0c9d)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:10:56 -08:00
Victor Vieux
8bed67c368 update docs
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 30db51c169)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:10:31 -08:00
Victor Vieux
728296b9ea refactor plugin install
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit fa3b61a28f)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:10:24 -08:00
Yong Tang
696130c949 Fix issue where secret ID is masked by name
This fix tries to address the issue in 28884 where
it is possible to mask the secret ID by name.

The reason was that searching a secret is based on name.
However, searching a secret should be done based on:
- Full ID
- Full Name
- Partial ID (prefix)

This fix addresses the issue by changing related implementation
in `getCliRequestedSecretIDs()`

An integration test has been added to cover the changes.

This fix fixes 28884

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3638ca4d14)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:09:46 -08:00
Yong Tang
d1d6357beb Convert DanglingOnly to Filters for docker image prune
This fix convert DanglingOnly in ImagesPruneConfig to Filters,
so that it is possible to maintain API compatibility in the future.

Several integration tests have been added to cover changes.

This fix is related to 28497.

A follow up to this PR will be done once this PR is merged.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit a6be56b54e)
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-12-07 16:08:18 -08:00
Andrew Hsu
4d92237de1 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 10:13:02 -08:00
Victor Vieux
c0522e349a bump version to 1.13.0-rc3
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 02:30:49 -08:00
Victor Vieux
3ac2991ff8 Merge pull request #29094 from vieux/1.13.0-rc3-cherrypicks
1.13.0-rc3 cherry-picks: part3
2016-12-05 02:29:24 -08:00
allencloud
69f3cb179e add missing status code in api docs
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 9a1f7b6b0b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 00:42:55 -08:00
Chris Gavin
1b195847f4 Fix a spelling mistake in the docs.
Signed-off-by: Chris Gavin <chris@chrisgavin.me>
(cherry picked from commit 35c82f422d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 00:41:35 -08:00
Vincent Demeester
877c2b5ac0 Revert "Fix dockerfile parser with empty line after escape"
This reverts commit 3e1b539e8d.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 6e0666e622)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 00:41:03 -08:00
Vincent Demeester
1b310cd47c 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>
(cherry picked from commit ef39256dfb)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 00:40:19 -08:00
Yong Tang
3891c1f376 Support plugins in docker inspect
This fix tries to address the proposal raised in 28946
to support plugins in `docker inspect`.

The command `docker inspect` already supports
"container", "image", "node", "network", "service", "volume", "task".
However, `--type plugin` is not supported yet at the moment.

This fix address this issue by adding the support of `--type plugin`
for `docker inspect`.

An additional integration test has been added to cover the changes.

This fix fixes 28946.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 90bb2cdb9f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 00:39:30 -08:00
Yong Tang
c015a2a1a6 Add ID field for docker plugin ls
This fix tries to address the enhancement proposed in 28708 to display
ID field for the output of `docker plugin ls`.

This fix add `ID` field to the output of `docker plugin ls`

Related docs has been updated.

This fix fixes 28708.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 8a226ed643)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-05 00:38:57 -08:00
Brian Goff
2aed732d3a Fix out-of-band vol delete+create for same driver
Fix issue where out-of-band deletions and then a `docker volume create`
on the same driver caused volume to not be re-created in the driver but
return as created since it was stored in the cache.

Previous fix only worked if the driver names did not match.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit d8ce4a6e10)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 16:54:15 -08:00
John Howard
e509501437 Windows: make.ps1 and Dockerfile for native builds
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 155435b6ce)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 16:54:05 -08:00
Victor Vieux
e81d02e4cd Merge pull request #29002 from vieux/1.13.0-rc3-cherrypicks
1.13.0-rc3 cherry-picks: part2
2016-12-02 16:51:49 -08:00
Daniel Nephin
8f961397f4 Fix swagger-gen validation.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit f247a99c6d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:44:34 -08:00
Misty Stanley-Jones
7ec079dbfd Fix instances of doubled words
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 379e9259cf)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:43:55 -08:00
Brian Goff
c49078c78d Fix issue where TmpfsOptions are not sent to swarm
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit a5b3649bfa)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:43:02 -08:00
Ben Firshman
94f3ccc31e Use singular tag names in swagger.yaml
This is required to make the type generation put things in the
correct directory, but unfortunately makes the names in the
documentation menu look a bit crap.

I think the best solution would be to add a `x-display-name`
extension to tags to determine how the tags show up in the menu,
rather than it depend on the name of the tag. I shall do this in
a follow-up PR - for now, let's fix the breakage.

Fixes #29045

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 30a9249e15)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:42:15 -08:00
Harald Albers
f1ea64fa07 Add bash completion for experimental docker deploy
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 10f567ec6a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:41:43 -08:00
Harald Albers
64b41aa52a Allow selective activation of experimental features in bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit af84b7e441)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:41:36 -08:00
Sebastiaan van Stijn
6df19c209f pin go-swagger 0.7.4
This pins the version of go-swagger used, because
the results generated by different versions
can differ quite a bit (tested between 0.7.2 - 0.7.4),
and can cause CI / validation to fail.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ba20c3e65e)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:41:10 -08:00
Sebastiaan van Stijn
ecf889816c Fix restartpolicy max-retry validation
the restart policy validation was moved from
the client to the daemon in 94e95e4711

As part of that change, retry-counts < 1
were marked as "invalid".

However, the default is 0 (unlimited), causing

    docker run -d --restart=on-failure nginx

To fail.

This changes the validation to only invalidate
retry-counts < 0.

A test was added, and other tests renamed
to allow running just these tests :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9db5d649ae)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:40:40 -08:00
John Howard
018f19f8c9 Windows: Factor out sqlite
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 3f6127b173)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:40:06 -08:00
Yong Tang
3477da0cdb Allow docker plugin inspect to search based on ID or name
This fix tries to address the issue raised in discussion of
PR 28735 where it was not possible to manage plugin based on
plugin ID. Previously it was not possible to invoke
`docker plugin inspect` with a plugin ID (or ID prefix).

This fix updates the implementation of `docker plugin inspect`
so that it is possbile to search based on a plugin name, or a
plugin ID. A short format of plugin ID (prefix) is also possible,
as long as there is no ambiguity.

Previously the check of `docker plugin inspect` was mostly done
on the client side. This could potentially cause inconsistency
between API and CMD. This fix move all the checks to daemon side
so that API and CMD will be consistent.

An integration test has been added to cover the changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 0ce6e070f7)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-02 13:39:37 -08:00
Tõnis Tiigi
90c3c389c4 Merge pull request #28999 from mavenugo/1.13.0-rc3-ln
Cherry-picking #28975 to 1.13.x
2016-12-02 13:25:43 -08:00
Alexander Morozov
6ad8328cb8 Merge pull request #29049 from aaronlehmann/vendor-swarmkit-1.13.0
[1.13] Vendor swarmkit
2016-12-02 13:06:34 -08:00
Aaron Lehmann
df71cee489 Vendor swarmkit
Update swarmkit to 522d951f733c821cdc33cccca6127c15a2b6de38, from the
bump_v1.13.0 branch.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-01 18:42:24 -08:00
lixiaobing10051267
12aa5ea8b1 rectify several wrong URLs in branch of man
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit 576780369f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-01 13:41:17 -08:00
Lei Jitang
32e0ea346b Fix docker restart panic on machine ungracefully shutdown
Machine ungracefully shutdown leaves a lot of container has a
Running=true state.

```
$ cat config.v2.json | jq .

    "Running": true,
    "Paused": false,
    "Restarting": false,

```

And the next docker start will fail with panic.

```

time="2016-12-01T01:54:45.086446715-05:00" level=warning msg="libcontainerd: client is out of sync, restore was called on a fully synced container (49f41ad5ca0be860622d9190673b5816d012022fb2c1794560ec4851e7cfec6a)."
time="2016-12-01T01:54:45.087046004-05:00" level=warning msg="libcontainerd: failed to retrieve container 49f41ad5ca0be860622d9190673b5816d012022fb2c1794560ec4851e7cfec6a state: rpc error: code = 2 desc = containerd: container not found"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5db7f3]

goroutine 57 [running]:
panic(0x16a8e60, 0xc420010130)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/docker/docker/libcontainerd.(*client).Restore(0xc4202e1a40, 0xc420415000, 0x40, 0xc42015a0b0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/docker/docker/libcontainerd/client_linux.go:457 +0x553
github.com/docker/docker/daemon.(*Daemon).restore.func1(0xc4201c46f0, 0xc4202581e0, 0xc4201c46e8, 0xc42047bfb0, 0xc42047bf80, 0xc42047bf50, 0xc42024ba10, 0xc420512c00)
        /go/src/github.com/docker/docker/daemon/daemon.go:205 +0x198
created by github.com/docker/docker/daemon.(*Daemon).restore
        /go/src/github.com/docker/docker/daemon/daemon.go:260 +0x7bb

```

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 267422e4d0)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-01 13:40:44 -08:00
yuexiao-wang
68b88c8749 Fix the use for secret create
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 5cef55ba91)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-01 13:40:14 -08:00
Darren Stahl
c31df2f3de Stop retrying pull on UnkownBlob error
Signed-off-by: Darren Stahl <darst@microsoft.com>
(cherry picked from commit dee2968560)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-01 13:39:35 -08:00
yuexiao-wang
f687616995 Fix the inconsistency for docker secret
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit b4306588e9)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-12-01 13:39:06 -08:00
Ben Firshman
766e6ab07f Make swagger.yaml operationIds consistent
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit bf6a790f00)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:25:52 -08:00
Ben Firshman
fba707ee1f Make docs URLs in swagger.yaml absolute
This makes the swagger.yaml useful outside of the documentation.
For background:
https://github.com/docker/docker.github.io/pull/606#issuecomment-261389645

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 54051b18a1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:25:40 -08:00
Ben Firshman
76f4793290 Improve tags in swagger.yaml
- Consistent naming (plural, etc)
- Add section descriptions
- Add docs in swagger.yaml about how to maintain them

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 2aea9ad56b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:24:09 -08:00
Ben Firshman
0e1721f09f Add intro to swagger.yaml to explain what it's for
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit be52738a2c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:24:04 -08:00
Ben Firshman
2d0a198eb8 Fix headings in old API docs
Jekyll automatically adds titles based on the title of the page,
so this was causing duplicate titles.

Also, made all the headings the correct level.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit d9b109b807)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:23:59 -08:00
Akihiro Suda
783e1a94b5 cli: remove --mount from docker run
This commit reverts 273eeb813c (#26825).
For the discussion so far, please refer to #28527.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit e6d9b7de64)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:22:43 -08:00
Brian Goff
bb55c05ec1 Move plugin shutdown after layerstore shtudown
This ensures that graphdriver plugins can properly cleanup on daemon
exit.
Also prevents errors during shutdown when it tries to send the plugin a
`Cleanup()` request but ultimately times out since it's already been
shutdown.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 4b400ecc4d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:19:24 -08:00
chchliang
6c466eadb7 don't spell error
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
(cherry picked from commit 167f2f3f1b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:19:22 -08:00
lixiaobing10051267
f5c429bea2 modify some urls related to reference path
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
(cherry picked from commit b069690827)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:15:19 -08:00
Aaron Lehmann
1638b8f5c5 distribution: Fix panic on push
When building a manifest during a push operation, all layers must have
an associated descriptor. If a layer is missing a descriptor, that leads
to a panic.

A break inside a switch in layerAlreadyExists meant to break from the
loop surrounding the switch, but instead breaks from the switch. This
causes the loop to continue, and can overwrite the descriptor with an
empty one, leading to the panic.

Also, fix layerAlreadyExists not to abort the push when a speculative
stat on a candidate layer digest fails with an error. This could happen
in situations like a potential cross-repository mount where the user
does not have permission to access the source repository.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit e0702e9f37)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:14:42 -08:00
Harald Albers
7c081219ac Add more types to bash completion of docker inspect
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 1076f0882b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:13:51 -08:00
Christopher Jones
d55b0802cf [ppc64le] allow replacing httpredir in dockerfile
Allows replacing of the default httpredir.debian.org in /etc/apt/sources.list
with a user-specified mirror. This will (hopefully) fix CI apt issues.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit 150a519a0b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:13:18 -08:00
Lei Jitang
d9329742d0 Fix docker save with empty timestamp of layer created time
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit e0b2c0af4d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:12:52 -08:00
erxian
375e970991 correct the http return code of secret remove
Signed-off-by: erxian <evelynhsu21@gmail.com>
(cherry picked from commit 21768933fb)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:12:22 -08:00
Aaron Lehmann
30e5e0a781 Don't resolve or pull images referenced by ID
If a swarm service is created using an image ID, it's useless to try to
pull this reference or resolve it to a manifest digest. Avoid doing this
when a fully qualified image ID is given.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 089842c4b4)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:11:43 -08:00
Vincent Demeester
50bcdc9de2 Revert "Add bash completion for docker service ps --all"
This reverts commit 188d2fac57.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit cee0fff9fe)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:11:08 -08:00
Vincent Demeester
f8b981574c Revert "Add -a option to service/node ps"
This reverts commit 139fff2bf0.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit eb55d03f3c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:11:02 -08:00
Vincent Demeester
4609c728e3 stack deploy: handle external network when deploying
If the network is marked as external, don't use the namespace on
it. Otherwise, it's not found.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 6fff845409)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:10:29 -08:00
Steve Durrheimer
5764fbb878 Add zsh completion for 'docker stack' subcommand
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 1e0c612f84)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:10:02 -08:00
Lei Jitang
ee7d498364 Change Error log to Warning when close stdin fail
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 37db022045)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:09:26 -08:00
Lei Jitang
79f153f49e Ignore "failed to close stdin" if container or process not found
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 9aedaf5b3a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:09:19 -08:00
Yanqiang Miao
bf711ea00e Fix a error of the function 'CopyMessage' in 'daemon/logger/logger.go'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

add a test for 'CopyMessage'

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 3b82eac65f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:08:05 -08:00
Sebastiaan van Stijn
f5df634db7 Add some adjectives to the namesgenerator
Because .. `hardcore_hamilton` and `inspiring_murdock`

https://twitter.com/swiftonsecurity/status/801195049165799424

Also replacing adjectives that could be interpreted as
refering to body size, (mental) health, intoxication.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 169b4d92a1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:07:37 -08:00
Kenfe-Mickael Laventure
5e5d02b9f5 Fix race with containerd events stream on restore
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 9fff9bb761)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:06:59 -08:00
Harald Albers
51f1980e30 Add bash completion for docker stack
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 16494a81f9)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:06:29 -08:00
John Howard
68cfaf216d Windows: Builder case insensitive env
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 49f392ff6b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:05:48 -08:00
Brian Goff
0dd3ae8ed0 Move stack dump dir to exec root
Dump stack dumps to exec root instead of daemon root.
When no path is provided to the stack dumper, such is the case with
SIGQUIT, dump to stderr.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 0bd720b28d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-30 14:02:24 -08:00
Madhu Venugopal
1f289dc411 Vendoring libnetwork to address some concurrency issues
Addresses #28697, #28845, #28712, #26111

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 8f082e418b)
2016-11-30 13:28:21 -08:00
Vincent Demeester
005a5428ee Merge pull request #28774 from vieux/1.13.0-rc3-cherrypicks
1.13.0-rc3 cherry-picks
2016-11-30 07:36:53 +01:00
Yanqiang Miao
b4567db876 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: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:15:02 -08:00
allencloud
1b187660c2 change secret remove logic in cli
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 5b93e77138)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:14:36 -08:00
Aaron Lehmann
0669e372d2 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>
(cherry picked from commit 9dba9e3248)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:14:06 -08:00
John Howard
a40ae77529 WORKDIR set cmd
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 1b97bb416b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:13:40 -08:00
Misty Stanley-Jones
7c030bbd76 Document publishing a UDP port
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 2178c840ba)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:13:15 -08:00
Josh Hawn
98132f7db9 Reject unspecified advertise addr on swarm init
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

(cherry picked from commit eeac871946)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:12:45 -08:00
Daniel Nephin
a8c2248e6f Use namespace label on stack volumes.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 4013a7c6d8)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:12:10 -08:00
Victor Vieux
97b0fd9fe3 update plugin example
Signed-off-by: Victor Vieux <victorvieux@gmail.com>

cleanup whitespace formatting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d73f73b365)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:11:14 -08:00
Vincent Demeester
936499e1ff Fixes ImageList to be retro-compatible with older API
Make sure current client code can talk for ImageList can still talk to
older daemon.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit c6e31454ba)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:10:44 -08:00
Anusha Ragunathan
8c56588d04 Fix issue with plugin exit.
A plugin has an `ExitChan` channel which is used to signal the exit of
the plugin process. In a recent change, the initialization was
incorrectly moved to the daemon Shutdown path.

Fix this by initializing the channel during plugin enable.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 890a98ceed)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:10:10 -08:00
Anusha Ragunathan
e3d03adc25 On plugin pull errors, delete created dirs.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 9e4234261c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:09:33 -08:00
yuexiao-wang
90dab0778c Modify the link for config.json
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 4e970c1e5a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:09:07 -08:00
John Howard
b998f95014 Windows: Note about volumes in run
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit b9e65f40cf)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:08:07 -08:00
John Howard
7c74809fe9 Align output of docker version again
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit dfeaf7a959)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:07:39 -08:00
William Henry
0f5d85371a Added and example of using --format with docker images
Docker-DCO-1.1-Signed-off-by: William Henry <whenry@redhat.com> (github: ipbabble)

Signed-off-by: William Henry <whenry@redhat.com>
(cherry picked from commit 798c00a7ee)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:07:00 -08:00
Dong Chen
bee66467cd Fix network attachable option.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit abcb699ad1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:06:31 -08:00
Yong Tang
d0fb24d853 Fix issue caused by duplicate docker plugin create with same names
This fix tries to fix the issue raised in 28684:
1. Duplicate plugin create with the same name will override the old plugin reference
2. In case an error happens in the middle of the plugin creation, plugin directories
   in `/var/lib/docker/plugins` are not cleaned up.

This fix update the plugin store so that `Add()` will return an error if a plugin
with the same name already exist.

This fix also will clean up the directory in `/var/lib/docker/plugins` in case
an error happens in the middle of the plugin creation.

This fix fixes 28684.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 662d456928)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-29 14:06:04 -08:00
Misty Stanley-Jones
4a0b7b215e Fix copypaste error 'is-automated'
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 2333657e1b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:30:34 -08:00
Misty Stanley-Jones
bdde4d3be5 Fix some redirect loops and problems
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit a1f55dca21)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:30:02 -08:00
Vincent Demeester
568a0a83a9 Remove docker stack config commandline reference doc
`docker stack config` command does not exists anymore, removing it
from the command reference documentation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 3f98871a19)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:29:32 -08:00
Kei Ohmura
a903471bfc fix more according to the actual output of 'docker swarm init --help'
Signed-off-by: Kei Ohmura <ohmura.kei@gmail.com>
(cherry picked from commit 4a3207de5b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:28:57 -08:00
Kei Ohmura
76d2619406 fix description of 'docker swarm init'
Signed-off-by: Kei Ohmura <ohmura.kei@gmail.com>
(cherry picked from commit 3abee1bf8a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:28:52 -08:00
Harald Albers
e0654b40b7 Add bash completion for docker service {create,update} host options
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit f3b7f40aaf)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:28:17 -08:00
Harald Albers
555f65587e Add aliases and options to docker stack ls docs
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 8260366dd2)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:27:39 -08:00
Yanqiang Miao
25cb6a829b Fix a description of 'docker run [-a]'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 08ff4f427e)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:27:07 -08:00
Steve Durrheimer
877207946a Add zsh completion for 'docker service update --hostname'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit b23fbc3fbd)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:26:36 -08:00
Justin Cormack
0e386515c8 Fix grammar on error message
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit cd5c8e9c2d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:26:08 -08:00
Harald Albers
7d7af6ad14 Add bash completion for docker service update --hostname
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 9d98d6d8cb)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:25:39 -08:00
lixiaobing10051267
6622465645 modify invalid url in plugins_network.md
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

(cherry picked from commit fc7c235f84)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:24:33 -08:00
yuexiao-wang
bfbb2fdee9 Modify reponame to PLUGIN and fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit c394034f59)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:23:58 -08:00
Yanqiang Miao
663ca540ea Fix some syntax error
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 18724726c2)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:23:28 -08:00
Daniel Nephin
4b230af83f Add a short flag for docker stack deploy
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit f1dd721b69)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:22:59 -08:00
Ben Firshman
99e1814731 Improve error when connecting service to network
The error didn't hint at how to resolve it. Google auto-suggest
also implies that people have been Googling this error.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 70acb89fa2)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:22:22 -08:00
Ian Campbell
3d27cb3d6f Check for LEGACY_VSYSCALL_* options
Chosing LEGACY_VSYSCALL_NONE (over NATIVE or EMULATE) will mean that binaries
using eglibc <= 2.13 will not run (segfault).

Fixes #28705.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
(cherry picked from commit 163db04452)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:21:53 -08:00
yuexiao-wang
05a75a567a Add options for docker plugin enable and fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit 9e414bfa6b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:21:20 -08:00
Yong Tang
a2c9e625e6 Update docs of docker network ls --filter
Currently the help output of `docker network ls --filter` is:
```
Options:
  -f, --filter value   Provide filter values (i.e. 'dangling=true') (default [])
  ...
```
This caused confusion as only the following filters are supported at the moment:
 - `driver`
 - `type`
 - `name`
 - `id`
 - `label`

This fix update the help output of `docker network ls --filter` and `network_ls.md`.
The `dangling=true` description has been replace to:
```
Options:
  -f, --filter filter   Provide filter values (i.e. 'driver=bridge')
  ...
```

This fix fixes 28786.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 2510f254ee)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:19:34 -08:00
Victor Vieux
edbe73670a support src in --secret
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit f70470b71e)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:19:02 -08:00
Daniel Nephin
234a8b9496 exit with status 1 if help is called on an invalid command.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit bb7601a3ff)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:18:28 -08:00
Yong Tang
86ae5d2895 Restrict checkpoint name to prevent directory traversal
This fix tries to address the issue raised in 28769 where
checkpoint name was not checked before passing to containerd.
As a result, it was possible to use a special checkpoint name
to get outside of the container's directory.

This fix add restriction `[a-zA-Z0-9][a-zA-Z0-9_.-]+` (`RestrictedNamePattern`).
This is the same as container name restriction.

This fix fixes 28769.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit c90ec05175)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:17:55 -08:00
Daniel Nephin
46cfeaf8ef Allow hostname to be updated on service.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 1c65cb6657)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:17:18 -08:00
erxian
d981bbc288 update secret command
Signed-off-by: erxian <evelynhsu21@gmail.com>
(cherry picked from commit d87c91e39f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:16:47 -08:00
Masayuki Morita
bc4219bd0c Fix broken markdown in CHANGELOG.md
Signed-off-by: Masayuki Morita <minamijoyo@gmail.com>
(cherry picked from commit 2ca39d27a6)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:16:13 -08:00
Daniel Nephin
f70e7f840b Better error message on stack deploy against not a swarm.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit c72daf953a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:15:40 -08:00
John Howard
35a87689e4 Windows: Case insensitive env vars
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit b2049a84de)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:15:09 -08:00
erxian
07fa269eee update the secret command docs
Signed-off-by: erxian <evelynhsu21@gmail.com>
(cherry picked from commit c22821014a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:14:36 -08:00
Harald Albers
46b8a5fb57 Add bash completion for plugin API
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit ecb707cb0f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:13:56 -08:00
dattatrayakumbhar04
fcc38c048c 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: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:13:20 -08:00
John Howard
c75eeb4b7c COPY file . after WORKDIR (now always created)
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 286ab6d69b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-28 11:12:45 -08:00
Vincent Demeester
10d2d8aefd Update docker info cli reference documentation
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit d28eaa1171)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-23 12:28:16 -08:00
Vincent Demeester
d4d4edec2e Update plugin enable cli reference documentation
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 43297dd6f8)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-23 12:27:46 -08:00
Vincent Demeester
833f3b3cf0 Fixes some integration-cli on userns
Mainly adding requirements on Network or NotUserNamespace to make it pass.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit eb5fe064cf)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-23 12:27:16 -08:00
Antonio Murdaca
bbfd3a518b daemon: remove not needed unmarshal
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 30b8712e93)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-23 12:27:11 -08:00
Harald Albers
3decd08d7a Move docker stack docs out of experimental
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit bb96e18b19)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-23 12:24:37 -08:00
Victor Vieux
1f9b3ef9e9 bump version to 1.13.0-rc2
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 21:23:23 -08:00
Victor Vieux
dba611d0f1 Merge pull request #28729 from aluzzardi/1.13.x-swarmkit-revendor-1109c363ce9d6400d42908ead944df4f7f788860
1.13.x: revendor swarmkit to 1109c363ce9d6400d42908ead944df4f7f788860
2016-11-22 20:34:10 -08:00
Andrea Luzzardi
2a80a863ca 1.13.x: revendor swarmkit to 1109c363ce9d6400d42908ead944df4f7f788860
Includes:
- https://github.com/docker/swarmkit/pull/1766
- https://github.com/docker/swarmkit/pull/1770

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-11-22 18:50:46 -08:00
Evan Hazlett
01807b785f update secret inspect to support IDs
This updates secret inspect to support inspect by ID in addition to name
as well as inspecting multiple secrets.  This also cleans up the
help text for consistency.

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
(cherry picked from commit 70d2cefd51)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 18:43:53 -08:00
yupeng
b82be871ab context.Context should be the first parameter of a function
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
(cherry picked from commit aff5dacec1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 18:43:29 -08:00
Darren Stahl
00fd466e00 Swap usage of LazyDLL and LoadDLL to LazySystemDLL.
Signed-off-by: Darren Stahl <darst@microsoft.com>
(cherry picked from commit 22c83c567f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 18:40:35 -08:00
John Howard
f9f8a94f42 Windows: Native autogen
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 64cc7677bf)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 18:40:19 -08:00
Sebastiaan van Stijn
f531a8f06b Use official fedora 25 image
Fedora 25 was released today, and the official
image will be available soon.

This removes the temporary override, so that
we can build using the official image.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 545a2f009e)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 18:39:58 -08:00
Victor Vieux
44fe761b35 Merge pull request #28674 from vieux/1.13.0-rc2-cherrypicks
1.13.0-rc2 cherry-picks : part 3
2016-11-22 18:39:06 -08:00
cyli
38b0c93954 Update docs to reflect no longer displaying secret digest or size.
Signed-off-by: cyli <cyli@twistedmatrix.com>
(cherry picked from commit fe127b7eae)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:54:55 -08:00
cyli
aa6211e153 Do not display the digest or size of swarm secrets
Signed-off-by: cyli <cyli@twistedmatrix.com>
(cherry picked from commit 2c0613540a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:54:50 -08:00
Ben Firshman
fad605e8c5 Add documentation for working on Engine API
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 109c54c481)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:52:48 -08:00
Ben Firshman
8738566853 Update swagger.yaml with changes to API
Up to and including 673c5ee559

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 44c50807c6)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:52:40 -08:00
Ben Firshman
f67b380325 Add version information to swagger.yaml
- Tidied up copy
- API version is now mandatory
- Links to previous API versions

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit c97f67dbab)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:51:14 -08:00
Ben Firshman
520e601dc2 Rename Remote API to Engine API
Implementation of https://github.com/docker/docker/issues/28319

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit f0d55cd081)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:49:58 -08:00
Ben Firshman
2ac34851ec Move API reference to new location
See: https://github.com/docker/docker.github.io/pull/606

Also:
- Add missing redirects to API reference pages
- Remove v1.25 and 1.26, because they are being replaced with
  swagger generated docs.
- Remove all other docs which aren't reference material, because
  this can live in docker/docker.github.io

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
(cherry picked from commit 993854f58f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:48:38 -08:00
Jacob Tomlinson
a4aabe7286 Add concurrent uploads/downloads section
Document and link to the concurrent uploads/downloads daemon option.

Signed-off-by: Jacob Tomlinson <jacob@tom.linson.uk>
(cherry picked from commit b303381a4d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:20:19 -08:00
Sebastiaan van Stijn
e8b27e7dc7 add note that windows does not support managed plugins
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f885463b58)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:19:48 -08:00
Antonio Murdaca
54518a214d hack/dockerfile/binaries-commits: use full commit hash for docker info
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit fa15d5ed0f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:19:18 -08:00
yupeng
1053fdf27e error strings should not be capitalized or end with punctuation
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
(cherry picked from commit fc11efa2db)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:18:49 -08:00
Andrea Luzzardi
43e6479fd4 service logs: Support no-follow mode
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
(cherry picked from commit c2d435e4f0)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:18:09 -08:00
Darren Stahl
af08f44640 Revendor go-winio to v0.3.7
Signed-off-by: Darren Stahl <darst@microsoft.com>
(cherry picked from commit 873a26697d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:17:33 -08:00
Tibor Vass
faab09c1aa plugins: misc fixes
Rename variable to reflect manifest -> config renaming
Populate Description fields when computing privileges.
Refactor/reuse code from daemon/oci_linux.go

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 6547609870)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:16:39 -08:00
Tibor Vass
561f2b27cb plugins: support for devices
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 53b9b99e5c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:16:33 -08:00
Tibor Vass
63277b0aff vendor go-connections to error out if unix socket path is too long
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit e2e7ab655f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:16:24 -08:00
Tibor Vass
8f66c5e731 plugins: fix some tests
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit a08ffa0e93)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:16:16 -08:00
Tibor Vass
a275ca2093 plugins: support for host networking
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 99124c055a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:16:10 -08:00
Tibor Vass
c28c63472a plugins: linux capabilities and device creation
In the plugin manifest, Capabilities has been moved to
Linux.Capabilities to avoid confusion with Interface.Types[i].Capability

A DeviceCreation boolean has also been added to the manifest. This could
be changed in the future to be specific to a major number.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 9f239281b1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:16:04 -08:00
Tibor Vass
fb3c3d7eea plugins: do not try to contact disabled plugin
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 84e58e2f89)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:15:58 -08:00
Darren Stahl
40a56f29e2 Ensure vmcompute.dll exists during daemon start
Signed-off-by: Darren Stahl <darst@microsoft.com>
(cherry picked from commit 000366f1a7)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:15:19 -08:00
Brian Goff
9e35dea991 Use container Mounts API for Swarm containers.
Instead of converting nicely typed service mounts into untyped `Binds`
when creating containers, use the new `Mounts` API which is a 1-1
mapping between service mounts and container mounts.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 821aeb6a6f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 16:13:28 -08:00
Victor Vieux
a65a2936ac Merge pull request #28676 from aboch/1.13.x-local
[1.13.x] Vendor libnetwork, netlink and libkv
2016-11-22 12:07:05 -08:00
Harald Albers
24628fd7a0 Fix typo in docs (Copmose)
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 2e12055687)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:27:57 -08:00
Vincent Demeester
9302b0f59c Update aanand/compose-file to a3e58764f50597b6217fec07e9bff7225c4a1719
This fixes services networks list to be ignored when loading.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 01b70a95c9)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:27:28 -08:00
Andrew Hsu
3168635120 skip solaris and allow dry run control points
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit f60541069c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:27:01 -08:00
Steve Durrheimer
f46b2fd604 Add zsh completion for 'docker image ls --filter reference'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 15134b8d36)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:26:33 -08:00
Steve Durrheimer
702b03b6fc Add zsh completion for 'dockerd --userland-proxy-path'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 97e1892922)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:26:03 -08:00
Tonis Tiigi
3f0aa9bceb Fix race on sending stdin close event
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 4e262f6387)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:25:33 -08:00
Kenfe-Mickael Laventure
3ab3f953d7 Add generate.sh for armhf deb Dockerfiles
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 3b3cf87478)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:25:01 -08:00
Kenfe-Mickael Laventure
bab6bf1d5e Add support for armhf ubuntu-yakkety deb
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit b118056241)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:24:55 -08:00
Darren Stahl
8ebbeda5a8 Update hcsshim
Signed-off-by: Darren Stahl <darst@microsoft.com>
(cherry picked from commit baac0ef67f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:24:21 -08:00
Reficul
ca51b2bf2c fix incorrect ErrConnectFailed comparison
Signed-off-by: Reficul <xuzhenglun@gmail.com>
(cherry picked from commit d5dc9b8b1f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:23:49 -08:00
Anusha Ragunathan
0403addc5f Add HTTP client timeout.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 83ca993c15)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:23:20 -08:00
allencloud
abc0eea899 update secret create url for consistency
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 86d7682843)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:22:39 -08:00
Brian Goff
b4c0b07d89 Handle run --rm against older daemons on the cli
For previous versions of Docker, `--rm` was handled client side, as such
there was no support in the daemon for it.
Now it is handled daemon side, but we still need to handle the case of a
newer client talking to an older daemon.

Falls back to client-side removal when the daemon does not support it.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit f4bb8c51de)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:22:08 -08:00
Harald Albers
2d5f5287c3 Add bash completion for docker build --network
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit d48e70843f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:21:36 -08:00
Felix Ruess
41b92e6f36 build debian package for armhf ubuntu-xenial
Signed-off-by: Felix Ruess <felix.ruess@gmail.com>
(cherry picked from commit 015e83a8da)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:21:10 -08:00
Qiang Huang
8079cc8147 Add make deb support for aarch64
Fixes: #27045

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
(cherry picked from commit a532ff8cc3)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-22 11:20:32 -08:00
Sebastiaan van Stijn
309662d03f Merge pull request #28680 from cyli/1.13.0-rc2-swarmkit-reendor
Include swarmkik dek rotation fixes in re-vendor
2016-11-22 10:50:33 +01:00
Andrew Hsu
e285a304db allow replacing httpredir or deb mirror in jessie
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit 060196ee4c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 17:29:22 -08:00
Harald Albers
6f03b32968 Add bash completion for docker images --filter reference
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e84d62f6cb)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 17:28:46 -08:00
Vincent Demeester
2fb6810841 Add documentation about templating support on…
… services creation/update.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 4571ad05db)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 17:28:06 -08:00
Sebastiaan van Stijn
7e2522ec9f Update service ps reference for "--no-trunc"
The "--no-trunc" option toggles between showing/hiding
digests.

This updates the reference to show this difference.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 90993640f0)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 17:26:38 -08:00
Daniel Nephin
95398c33cc Move docker stack out of experimental
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 6df5baf30f)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:47:24 -08:00
Brian Goff
fcb64b6e08 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-11-21 14:46:48 -08:00
allencloud
2ecc8cd4bd judge manager if locked before parsing key
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 89100c162b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:46:22 -08:00
Evan Hazlett
bdc378e781 lint fixes
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
(cherry picked from commit eb036ea4db)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:45:45 -08:00
Evan Hazlett
01aab8baa3 do not force target type for secret references
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

use secret store interface instead of embedded secret data into container

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
(cherry picked from commit bebd472e40)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:45:39 -08:00
Antonio Murdaca
0a5732d1cf api: types: keep info.SecurityOptions a string slice
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 514ca09426)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:45:05 -08:00
Aaron Lehmann
2737519f9a cli: Add valid suffixes for remaining duration options
A recent PR added `(ns|us|ms|s|m|h)` to the descriptions of some
duration options, but not all. Add it to the remaining options for
consistency.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 32b12a28fc)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 14:44:33 -08:00
Alessandro Boch
5c684ba099 Vendoring libkv @1d84310
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-21 14:15:33 -08:00
cyli
ba9726350d Include swarmkik dek rotation fixes in re-vendor
Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-11-21 16:43:55 -05:00
Vincent Demeester
05eb544ae2 Do not panic if network is nil
network is `nil` if the following case:

```
services:
  foo:
    image: nginx
    networks:
      mynetwork:
```

It's a valid compose so we should not panic.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 158388ef8d)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:24 -08:00
Vincent Demeester
040d4ebd58 Update cli reference for docker {,stack} deploy
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 88cdfc512b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:24 -08:00
Zhang Wei
db8991c957 Bugfix: set cli.manualOverride when env var not empty
If env var "DOCKER_API_VERSION" is specified by user, we'll set
`cli.manualOverride`, before this, this field is always true due to
wrong logic.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
(cherry picked from commit 4d54d30477)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:24 -08:00
zhukj
20f3c552e0 close the file
Signed-off-by: zhukj <zhu.kunjia@zte.com.cn>
(cherry picked from commit cf3ef262b1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:23 -08:00
Harald Albers
a20820b05c Add bash completion for dockerd --userland-proxy-path
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 0d573a62f7)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:23 -08:00
Derek McGowan
68e99239d3 Update deprecation notes about v1 registry
Adds section about the hub deprecating the v1 protocol.
Adds note about intent to disable by default and remove support.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit c8f826f407)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:23 -08:00
bbayani
a47957d6f6 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: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:23 -08:00
Nishant Totla
5b81d7e8b5 Suppressing digest for docker service ls/ps
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit e7d83fdb9a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:23 -08:00
Yanqiang Miao
4acf6aa456 The type of 'ExportdPorts' should be 'nat.PortSet'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit c44c542d95)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 13:23:16 -08:00
Tom Denham
c707468415 Update tests to handle bug fix from libnetwork
Signed-off-by: Tom Denham <tom@tomdee.co.uk>
2016-11-21 13:21:02 -08:00
Alessandro Boch
a6e1ed7a51 Vendoring libnetwork @dd0ddde
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-21 13:20:57 -08:00
Tom Denham
2c832d7d66 Update netlink library (required for libnetwork)
Signed-off-by: Tom Denham <tom@tomdee.co.uk>
2016-11-21 11:58:37 -08:00
Vincent Demeester
f44e2dca56 Update compose-file to bc280351b9589b05c6da031d9f93c5c5d22db922
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit b0903c9db0)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 11:48:27 -08:00
Vincent Demeester
c8e2552827 Add support for healthcheck in composefile v3
`docker stack deploy` now supports a composefile v3 format that have a
healthcheck.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 3bd64de7a9)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 11:48:22 -08:00
Daniel Nephin
a0df810219 Default parallelism to 1.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 7c1b399235)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-21 11:48:16 -08:00
Boaz Shuster
c050ee1917 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-11-21 11:45:57 -08:00
Vincent Demeester
cbff9474d2 Merge pull request #28604 from aluzzardi/1.13-swarmkit-revendor
1.13.x: Re-vendor swarmkit to a2080913b9cf2cac309845a28902896d65d3f527
2016-11-21 15:09:35 +01:00
Brian Goff
f7ae8204cb Merge pull request #28489 from vieux/1.13.0-rc2-cherrypicks
1.13.0-rc2 cherry-picks : part 2
2016-11-20 10:43:55 -05:00
Sean McIntyre
2d632c34ce 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: Victor Vieux <victorvieux@gmail.com>
2016-11-19 23:52:14 -08:00
Victor Vieux
4edaaeb671 fix a few golint errors
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 9c559e6d0b)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-19 23:50:06 -08:00
Brian Goff
d63582c131 Allow graphdriver plugins to use v2
Currently the plugin initialization is too late for a loaded v2 plugin
to be usable as a graph driver.

This moves the initialization up before we create the graph driver.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 020b051dfb)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-19 23:49:03 -08:00
Victor Vieux
e773e0e654 error on cli when trying to use experimental feature with non experimental daemon
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 98bb08fe38)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-19 23:48:19 -08:00
yupeng
fe8e347741 Fix the typo
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
(cherry picked from commit 9551dd03cf)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-19 23:47:44 -08:00
Andrea Luzzardi
0d94260458 router: Return explicit error rather than 404 for experimental.
Instead of not adding experimental routes at all, fail with an explicit
message if the daemon is not running in experimental mode.

Added the `router.Experimental` which does this automatically.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
(cherry picked from commit 3976a33c1a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-19 23:47:12 -08:00
Vincent Demeester
cdfde9ecc1 Use Container.Config.Shell instead of hardcoded…
… for healthcheck. It make the code a little cleaner and more
future/usage proof.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 5f81cf11f6)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-19 23:45:58 -08:00
Victor Vieux
8e21480106 skip api/types/container/ (like golint) and fix one pkg
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 79a891efb7)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 18:41:43 -08:00
Victor Vieux
fd75cc462f fix gofmt in master
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 9f348d5625)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 15:22:42 -08:00
Sebastiaan van Stijn
c4fd597ab3 swap position of "host" and "ip"
the service definition uses the format as defined
in  http://man7.org/linux/man-pages/man5/hosts.5.html
(IP_address canonical_hostname [aliases...])

This format is the _reverse_ of the format used in
the container API.

Commit f32869d956
inadvertently used the incorrect order.

This fixes the order, and correctly sets it to;

    IP-Address hostname

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f1b9df9172)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 15:15:51 -08:00
Kenfe-Mickael Laventure
47ccfcc09f Update containerd & runc
containerd: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e
runc: 51371867a01c467f08af739783b8beafc15

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 8b1aeb22fe)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 15:15:19 -08:00
Yong Tang
e3c24caf7a Fix several issues with go vet and go fmt
For some reason, `go vet` and `go fmt` validate does not capture
several issues.

The following was the output of `go vet`:
```
ubuntu@ubuntu:~/docker$ go vet ./... 2>&1 | grep -v ^vendor | grep -v '^exit status 1$'
cli/command/formatter/container_test.go:393: possible formatting directive in Log call
volume/volume_test.go:257: arg mp.RW for printf verb %s of wrong type: bool
```

The following was the output of `go fmt -s`:
```
ubuntu@ubuntu:~/docker$ gofmt -s -l . | grep -v ^vendor
cli/command/stack/list.go
daemon/commit.go
```

Fixed above issues with `go vet` and `go fmt -s`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit ace786e9d5)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 15:14:49 -08:00
Aaron Lehmann
d4392659f7 Return warnings from service create and service update when digest pinning fails
Modify the service update and create APIs to return optional warning
messages as part of the response. Populate these messages with an
informative reason when digest resolution fails.

This is a small API change, but significantly improves the UX. The user
can now get immediate feedback when they've specified a nonexistent
image or unreachable registry.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 948e60691e)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:57:11 -08:00
He Xin
649445a206 fix bugs 'fatal error: concurrent map read and map write' to change VolumeStore.globalLock type from Mutex to RWMutex, and add globalLock.RLock() for the read of names, refs, labels and options in VolumeStore
Signed-off-by: He Xin <he_xinworld@126.com>
(cherry picked from commit 19bd1cee23)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:54:40 -08:00
Yanqiang Miao
df8a5e48de Fix a comment error
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
(cherry picked from commit 19e2c9177a)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:54:23 -08:00
Michael Crosby
c0ea2c8498 Fix cfs period calculation
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit aff99136b4)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:45:58 -08:00
Stephen J Day
ce22bc39dc api/server/httputils: service unavailable for disable swarm
When swarm-mode is disabled, we need to return an error indicating this.
406 was chosen for the "Not Acceptable" verbiage, but this code has
specific semantics in relation to the `Accept` header, which aren't
applicable here.

We now use a 503 for this case. While it is not a perfect match, it does
make it clear that the particular "service" (read: API endpoint) is not
available. The body of the message provides the user with enough
information to take action on it by enabling swarm-mode and ensuring the
service is available.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 1d90d76048)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:44:36 -08:00
Yong Tang
3e9dd55695 Use map[string]bool for preProcessor to ignore unknwon field
This fix is an attempt to address the issue raised in 28339. In
`docker ps`, the formatter needs to expose all fields of `types.Container`
to `preProcessor` so that template could be executed.

This direct exposing is unreliable and could cause issues as user may incorrectly
assume all fields in `types.Container` will be available for templating.

However, the purpose of `preProcessor` is to only find out if `.Size`
is defined (so that opts.size could be set accordingly).

This fix defines `preProcessor` as `map[string]bool` with a func `Size()`.
In this way, any unknown fields will be ignored.

This fix adds several test cases to the existing `TestBuildContainerListOptions`.

This fix fixes 28339.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 312cc7eebd)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:42:21 -08:00
Boaz Shuster
19d2e68fb8 Change the docker-tag usage text to be clearer
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
(cherry picked from commit 039aca05c2)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:41:48 -08:00
John Howard
530b7cb4a0 Windows: Allow user in builder
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit a3c4ab9b65)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:41:13 -08:00
Nishant Totla
902774c871 Refactoring code for pinning image by digest
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit dc1b6341b9)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:40:13 -08:00
Nishant Totla
1af49192e4 Updating docker/distribution vendoring
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit d910781c66)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:40:06 -08:00
Andrea Luzzardi
0be7359265 1.13.x: Re-vendor swarmkit to a2080913b9cf2cac309845a28902896d65d3f527
Includes:
- https://github.com/docker/swarmkit/pull/1749
- https://github.com/docker/swarmkit/pull/1753
- https://github.com/docker/swarmkit/pull/1760
- https://github.com/docker/swarmkit/pull/1762
- https://github.com/docker/swarmkit/pull/1764
- https://github.com/docker/swarmkit/pull/1765

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-11-18 13:39:53 -08:00
Yong Tang
e013d7c543 Fix error messages for --cpus from daemon
This fix fixes error messages for `--cpus` from daemon.

When `docker run` takes `--cpus`, it will translate into NanoCPUs
and pass the value to daemon. The `NanoCPU` is not visible to the user.
The error message generated from daemon used 'NanoCPU' which may cause
some confusion to the user.

This fix fixes this issue by returning the error in CPUs instead.

This fix fixes 28456.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit d22ac2f3a0)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:38:21 -08:00
Tonis Tiigi
5e7e260bac Fix deadlock on cancelling healthcheck
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 89b1234737)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:37:44 -08:00
Vincent Demeester
20dd2d1e4e Update images cli reference with reference filter
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit a0d7b34d9c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:37:07 -08:00
John Howard
3d43caf6f6 Windows: Revert 27884
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 7e03ce3f13)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:36:37 -08:00
Anusha Ragunathan
3f6e6b3f2d Cleanup after plugin install.
During error cases, we dont cleanup correctly. This commit takes care
of removing the plugin, if there are errors after the pull passed. It
also shuts down the plugin, if there are errors after the plugin in the
enable path.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 1144f8f1d4)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:36:09 -08:00
Aaron Lehmann
48c2da3cd5 api: Remove omitempty tag on Parallelism
It doesn't make sense to use omitempty here. 0 is a meaningful value and
it's different from the default. If someone sets Parallelism to 0, we
want to show that Parallelism is 0, not hide the field.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit d8b8b12994)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:35:33 -08:00
Yong Tang
7ef4feaf38 Fix crash caused by docker service inspect --pretty
This fix tries to fix the crash caused by `docker service inspect --pretty`,
by performing necessary nil pointer check.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit b6857e91c1)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:34:35 -08:00
Stephen J Day
8b9b8bd930 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-11-18 13:34:05 -08:00
allencloud
cd587419d0 judge manager before unlocking
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 972a246c67)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:33:07 -08:00
Brian Goff
10ce88227d Reduce spew data dumped
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 4130eb24e9)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:32:26 -08:00
Tom Wilkie
9f3c9209d0 s/bCap/bLen/
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
(cherry picked from commit 3a05545851)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:31:39 -08:00
Tom Wilkie
f02e4e1900 Fix use of cap in MultiReadSeeker
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
(cherry picked from commit 158bb9bbd5)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:31:33 -08:00
Victor Vieux
411e0bdc8e refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit bf95472105)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:30:44 -08:00
Vincent Demeester
51dc584445 Update Tini to fix photon build-rpm compilation errors
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-18 13:29:20 -08:00
Akshay Karle
78fe91c31c fix a typo
Signed-off-by: Akshay Karle <akshay.a.karle@gmail.com>
2016-11-18 13:28:11 -08:00
allencloud
0b8f8876b9 fix typo
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 1f039a66ac)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:27:01 -08:00
Justin Cormack
c125c131d7 Fix check config script on 4.8 kernels
DEVPTS_MULTIPLE_INSTANCES is no longer an option, it is always set, so
do not check for this post 4.8.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 228ee16df3)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:26:03 -08:00
Felipe Oliveira
0a9521d321 fix infinite recursion
Signed-off-by: Felipe Oliveira <felipeweb.programador@gmail.com>
(cherry picked from commit 271b1f2756)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 13:25:29 -08:00
Aaron Lehmann
88a45c4a1b Merge pull request #28525 from aluzzardi/swarmkit-revendor
1.13.x: Re-vendor SwarmKit to 577d6bf89a474d3f459804efc5f160ba9fff2b5d
2016-11-17 11:08:33 -08:00
Sebastiaan van Stijn
22f0055e18 Merge pull request #28433 from thaJeztah/docker-1.13-changelog-updates
Docker 1.13 changelog updates
2016-11-17 10:01:50 +01:00
Andrea Luzzardi
73bf1ec999 1.13.x: Re-vendor SwarmKit to 577d6bf89a474d3f459804efc5f160ba9fff2b5d
Includes https://github.com/docker/swarmkit/pull/1746

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-11-16 18:10:07 -08:00
Tonis Tiigi
0269ac0494 Skip cli initialization for daemon command
Cli initialization pings back to remote API and
creates a deadlock if socket is already being
listened by systemd.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-11-16 17:10:48 -08:00
Victor Vieux
f2eeaed8a3 explicitly show plugins as unsupported on !linux
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-16 17:10:40 -08:00
Noah Treuhaft
43f1682cef Disable v1 protocol for the default registry
All images in the default registry (AKA docker.io, index.docker.io, and
registry-1.docker.io) are available via the v2 protocol, so there's no
reason to use the v1 protocol.  Disabling it prevents useless fallbacks.

Signed-off-by: Noah Treuhaft <noah.treuhaft@docker.com>
2016-11-16 17:10:33 -08:00
Riyaz Faizullabhoy
94c4cfc209 Edits to plugin docs after building authz plugin
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-11-16 17:10:24 -08:00
Sebastiaan van Stijn
dc71b1425e Changelog updates
This adds some missing entries to the changelog,
and some smal fixes / inconsistencies.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-11-17 01:42:56 +01:00
Vincent Demeester
a51fe6b056 Update stats cli reference documentation
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-16 11:11:52 -08:00
Steve Durrheimer
1841986d17 Add zsh completion for 'docker system df'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-11-16 11:11:45 -08:00
Yanqiang Miao
0d815d9bb7 Remove redundant 'if' statement
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-11-16 11:11:39 -08:00
Brian Goff
3b93497fdb Don't validate platform-dep tmpfs opts on client
Daemon still does validation and errors out on incorrect options.

Fixes an issue where non-Linux clients attempting to pass tmpfs options
on `docker run` to a Linux daemon will incorrectly error out.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-16 11:11:32 -08:00
Victor Vieux
44bb0bb7f2 update tini to a87614212b3a51a9cad57ff7989103a841546745
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-16 11:11:22 -08:00
Yong Tang
896e4f2d75 Fix missing versions in example requests of api docs
It is not required to have version prefix for all the remote
APIs. Though there are still quite a few example requests
in api docs that does not have the version prefix.

This fix update the remote api docs to address this issue.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-16 11:07:38 -08:00
Yong Tang
7154093e59 Update docs for docker info for most recent changes.
This fix updates docs for `docker info` for most recent changes.
It also made several chagnes:
1. Replace 0.12.0-dev to 0.13.0 for api docs v1.24.
2. Replace 0.13.0-dev to 0.13.0 for api docs v1.25

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-16 11:06:12 -08:00
John Howard
dbf1900e8c Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-16 11:05:23 -08:00
allencloud
d1b1dea80f allow node update api receive node name and id prefix
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-11-16 10:59:21 -08:00
Victor Vieux
2dfa08bc50 Merge pull request #28408 from vieux/1.13.0-rc2-cherrypicks
1.13.0 rc2 cherrypicks
2016-11-16 10:50:34 -08:00
Tõnis Tiigi
f5afe63eb6 Merge pull request #28463 from aluzzardi/swarmkit-revendor
1.13.x: Revendor swarmkit to 3076318ec0327e22c837c2bfdfacea08124dc755
2016-11-15 21:41:12 -08:00
Andrea Luzzardi
7a457451f6 Revendor swarmkit to 3076318ec0327e22c837c2bfdfacea08124dc755
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-11-15 19:04:09 -08:00
Sebastiaan van Stijn
5c69e4fa94 Revert reference docs for ambient capabilities
This feature was reverted for docker 1.13
in c5251f7116,
so removing the documentation as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-11-15 13:59:39 -08:00
Jonathan Boulle
c102ab8711 man/docker: wrap lines consistently
Quite a few changes, as it seems like previous wrapping was done
manually, so it's all over the place.

As noted in #28424

Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com>
2016-11-15 13:58:43 -08:00
Jonathan Boulle
44b5bcd744 man page: consistent indents for flag descriptions
Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com>
2016-11-15 13:57:57 -08:00
yuexiao-wang
0f254ab8b9 Remove inexistent link and add related links
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-15 13:57:10 -08:00
bbayani
4d850bd49a Updated daemon documentation to clarify that live-restore is not suppoted on windows
Review comment implementation

Signed-off-by: bbayani <bhumikabayani@gmail.com>
2016-11-15 13:55:14 -08:00
John Howard
7346a6aebd Gitignore dockerversion\version_autogen_unix.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-14 17:32:44 -08:00
Anusha Ragunathan
846b198dd7 Perform graceful shutdown during plugin disable.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-14 17:31:00 -08:00
Steve Durrheimer
6c3744f4fc Add zsh completion for 'docker image build --network'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-11-14 17:04:08 -08:00
lixiaobing10051267
6e10c4c8b2 fix the wrong title with docker swarm
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-11-14 17:02:42 -08:00
Brian Goff
a9bbf92b3f Fix issue with missing fields for ps template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-14 14:25:27 -08:00
Muayyad Alsadi
02c7b6ffad remove "starting with /"
Signed-off-by: Muayyad Alsadi <alsadi@gmail.com>
2016-11-14 14:22:24 -08:00
Muayyad Alsadi
d3ae1d7bd6 fixes #17734, clear message for host volumes not starting with /
Signed-off-by: Muayyad Alsadi <alsadi@gmail.com>
2016-11-14 14:22:22 -08:00
Steve Durrheimer
b1c96a73a3 Add zsh completion for 'docker service {create,update} --secret'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-11-14 14:18:12 -08:00
Steve Durrheimer
d114b7dc48 Add zsh completion for the new 'docker secret' command
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-11-14 14:17:36 -08:00
Steve Durrheimer
fd04a2db51 Add zsh completion for 'docker service' DNS settings
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-11-14 14:16:57 -08:00
Yong Tang
2c61e9c3bd Fix a small typo in docs/deprecated.md
A small typo in `docs/deprecated.md`.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-14 14:16:19 -08:00
Yong Tang
9ed0bb2d0a Update bash completion dns-options-add/rm -> dns-option-add/rm
In 28186, `dns-options-add/rm` has been changed to `dns-option-add/rm`
in `docker service create/update`, for the purpose of consistency.

This fix updates bash completion to remove extra `s`.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-14 14:15:31 -08:00
Harald Albers
ba5d2331d5 Add bash completion for DNS settings in services
Signed-off-by: Harald Albers <github@albersweb.de>
2016-11-14 14:14:52 -08:00
Harald Albers
6ec7c7a89c Add bash completion for docker service ps --all
Signed-off-by: Harald Albers <github@albersweb.de>
2016-11-14 14:13:10 -08:00
Steve Durrheimer
a2575eb741 Add zsh completion for 'docker service {create --port, update --port-{add,rm}}'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-11-14 14:12:08 -08:00
Harald Albers
4b003634bc Fix bash completion for docker ps --filter is-task
Signed-off-by: Harald Albers <github@albersweb.de>
2016-11-14 14:11:27 -08:00
Steve Durrheimer
580343247e Add zsh completion for 'docker image build --cache-from'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-11-14 14:10:44 -08:00
Harald Albers
261958bfa8 Add bash completion for managing ports in services
Bash completion for

- `docker service create --port`
- `docker service update --port-{add,rm}`

Signed-off-by: Harald Albers <github@albersweb.de>
2016-11-14 14:10:03 -08:00
Harald Albers
2da971cf06 Add bash completion for docker build --cache-from
Signed-off-by: Harald Albers <github@albersweb.de>
2016-11-14 14:09:02 -08:00
Brian Goff
285915755c 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-11-14 14:03:05 -08:00
allencloud
9798cdd632 fix typo in node update docs
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-11-14 13:30:51 -08:00
yuexiao-wang
5060ff0d8d Remove duplicated document
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-11-14 13:29:51 -08:00
John Howard
4bfd3643da Extra v1.25 in API docs
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-14 12:00:24 -08:00
Alexander Morozov
f3d628129e dockerversion: add other binaries to _lib.go
Otherwise it's impossible to build without autogen tag

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-14 11:59:08 -08:00
Shayne Wang
19c16fd95e Change reading order of tailfile
change reading order from beginning at the end to beginning at a buffer start
added intergration tests for boundary cases
Removed whitespace
Signed-off-by: Shayne Wang <shaynexwang@gmail.com>
2016-11-14 11:58:01 -08:00
allencloud
89c4410799 judge manager before getting secret
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-11-14 11:54:29 -08:00
Kenfe-Mickael Laventure
70e7fcc595 Remove extra binaries commit variables from windows build
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-11-14 11:52:45 -08:00
Kenfe-Mickael Laventure
03c8f0cda1 Fix version detection for docker-init
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-11-14 11:52:39 -08:00
Tonis Tiigi
22c09cf902 Skip plugin tests if not in amd64
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-11-14 11:50:20 -08:00
Evan Hazlett
8ac6b97189 only check secrets for service create if requested
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-11-14 11:48:48 -08:00
Anusha Ragunathan
a7a8fa0e6b Add docs for plugin push
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-14 11:34:28 -08:00
John Stephens
16d4e6395e Show experimental flags and subcommands if enabled
Signed-off-by: John Stephens <johnstep@docker.com>
2016-11-14 11:34:17 -08:00
Victor Vieux
75fd88ba89 bump version to 1.13.0-rc1
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-11 02:27:33 -08:00
841 changed files with 28905 additions and 17648 deletions

1
.gitignore vendored
View file

@ -17,6 +17,7 @@ bundles/
cmd/dockerd/dockerd
cmd/docker/docker
dockerversion/version_autogen.go
dockerversion/version_autogen_unix.go
docs/AWS_S3_BUCKET
docs/GITCOMMIT
docs/GIT_BRANCH

View file

@ -5,9 +5,102 @@ information on the list of deprecated flags and APIs please have a look at
https://docs.docker.com/engine/deprecated/ where target removal dates can also
be found.
## 1.13.0 (2016-12-08)
## 17.03.0-ce (2017-03-01)
### Client
* Fix panic in `docker stats --format`
### Contrib
* Update various `bash` and `zsh` completion scripts [#30823](https://github.com/docker/docker/pull/30823), [#30945](https://github.com/docker/docker/pull/30945) and more...
### Networking
* Discard incoming plain vxlan packets for encrypted overlay network [#31170](https://github.com/docker/docker/pull/31170)
* Release the network attachment on allocation failure [#31073](https://github.com/docker/docker/pull/31073)
### Runtime
* Fix a deadlock in docker logs [#30223](https://github.com/docker/docker/pull/30223)
* Fix cpu spin waiting for log write events [#31070](https://github.com/docker/docker/pull/31070)
## 1.13.1 (2017-02-08)
**IMPORTANT**: On Linux distributions where `devicemapper` was the default storage driver,
the `overlay2`, or `overlay` is now used by default (if the kernel supports it).
To use devicemapper, you can manually configure the storage driver to use through
the `--storage-driver` daemon option, or by setting "storage-driver" in the `daemon.json`
configuration file.
**IMPORTANT**: In Docker 1.13, the managed plugin api changed, as compared to the experimental
version introduced in Docker 1.12. You must **uninstall** plugins which you installed with Docker 1.12
_before_ upgrading to Docker 1.13. You can uninstall plugins using the `docker plugin rm` command.
If you have already upgraded to Docker 1.13 without uninstalling
previously-installed plugins, you may see this message when the Docker daemon
starts:
Error starting daemon: json: cannot unmarshal string into Go value of type types.PluginEnv
To manually remove all plugins and resolve this problem, take the following steps:
1. Remove plugins.json from: `/var/lib/docker/plugins/`.
2. Restart Docker. Verify that the Docker daemon starts with no errors.
3. Reinstall your plugins.
### Contrib
* Do not require a custom build of tini [#28454](https://github.com/docker/docker/pull/28454)
* Upgrade to Go 1.7.5 [#30489](https://github.com/docker/docker/pull/30489)
### Remote API (v1.26) & Client
+ Support secrets in docker stack deploy with compose file [#30144](https://github.com/docker/docker/pull/30144)
### Runtime
* Fix size issue in `docker system df` [#30378](https://github.com/docker/docker/pull/30378)
* Fix error on `docker inspect` when Swarm certificates were expired. [#29246](https://github.com/docker/docker/pull/29246)
* Fix deadlock on v1 plugin with activate error [#30408](https://github.com/docker/docker/pull/30408)
* Fix SELinux regression [#30649](https://github.com/docker/docker/pull/30649)
### Plugins
* Support global scoped network plugins (v2) in swarm mode [#30332](https://github.com/docker/docker/pull/30332)
+ Add `docker plugin upgrade` [#29414](https://github.com/docker/docker/pull/29414)
### Windows
* Fix small regression with old plugins in Windows [#30150](https://github.com/docker/docker/pull/30150)
* Fix warning on Windows [#30730](https://github.com/docker/docker/pull/30730)
## 1.13.0 (2017-01-18)
**IMPORTANT**: On Linux distributions where `devicemapper` was the default storage driver,
the `overlay2`, or `overlay` is now used by default (if the kernel supports it).
To use devicemapper, you can manually configure the storage driver to use through
the `--storage-driver` daemon option, or by setting "storage-driver" in the `daemon.json`
configuration file.
**IMPORTANT**: In Docker 1.13, the managed plugin api changed, as compared to the experimental
version introduced in Docker 1.12. You must **uninstall** plugins which you installed with Docker 1.12
_before_ upgrading to Docker 1.13. You can uninstall plugins using the `docker plugin rm` command.
If you have already upgraded to Docker 1.13 without uninstalling
previously-installed plugins, you may see this message when the Docker daemon
starts:
Error starting daemon: json: cannot unmarshal string into Go value of type types.PluginEnv
To manually remove all plugins and resolve this problem, take the following steps:
1. Remove plugins.json from: `/var/lib/docker/plugins/`.
2. Restart Docker. Verify that the Docker daemon starts with no errors.
3. Reinstall your plugins.
### Builder
+ Add capability to specify images used as a cache source on build. These images do not need to have local parent chain and can be pulled from other registries [#26839](https://github.com/docker/docker/pull/26839)
+ (experimental) Add option to squash image layers to the FROM image after successful builds [#22641](https://github.com/docker/docker/pull/22641)
* Fix dockerfile parser with empty line after escape [#24725](https://github.com/docker/docker/pull/24725)
@ -18,15 +111,20 @@ be found.
- Fix image layer inconsistencies when using the overlay storage driver [#27209](https://github.com/docker/docker/pull/27209)
* Unused build-args are now allowed. A warning is presented instead of an error and failed build [#27412](https://github.com/docker/docker/pull/27412)
- Fix builder cache issue on Windows [#27805](https://github.com/docker/docker/pull/27805)
+ Allow `USER` in builder on Windows [#28415](https://github.com/docker/docker/pull/28415)
+ Handle env case-insensitive on Windows [#28725](https://github.com/docker/docker/pull/28725)
### Contrib
+ Add support for building docker debs for Ubuntu Xenial on PPC64 [#23438](https://github.com/docker/docker/pull/23438)
+ Add support for building docker debs for Ubuntu Xenial on s390x [#26104](https://github.com/docker/docker/pull/26104)
+ Add support for building docker debs for Ubuntu 16.04 Xenial on PPC64LE [#23438](https://github.com/docker/docker/pull/23438)
+ Add support for building docker debs for Ubuntu 16.04 Xenial on s390x [#26104](https://github.com/docker/docker/pull/26104)
+ Add support for building docker debs for Ubuntu 16.10 Yakkety Yak on PPC64LE [#28046](https://github.com/docker/docker/pull/28046)
- Add RPM builder for VMWare Photon OS [#24116](https://github.com/docker/docker/pull/24116)
+ Add shell completions to tgz [#27735](https://github.com/docker/docker/pull/27735)
* Update the install script to allow using the mirror in China [#27005](https://github.com/docker/docker/pull/27005)
+ Add DEB builder for Ubuntu 16.10 Yakkety Yak [#27993](https://github.com/docker/docker/pull/27993)
+ Add RPM builder for Fedora 25 [#28222](https://github.com/docker/docker/pull/28222)
+ Add `make deb` support for aarch64 [#27625](https://github.com/docker/docker/pull/27625)
### Distribution
@ -52,11 +150,14 @@ be found.
+ Unix socket support for fluentd [#26088](https://github.com/docker/docker/pull/26088)
* Enable fluentd logging driver on Windows [#28189](https://github.com/docker/docker/pull/28189)
- Sanitize docker labels when used as journald field names [#23725](https://github.com/docker/docker/pull/23725)
- Fix an issue where `docker logs --tail` returned less lines than expected [#28203](https://github.com/docker/docker/pull/28203)
- Splunk Logging Driver: performance and reliability improvements [#26207](https://github.com/docker/docker/pull/26207)
- Splunk Logging Driver: configurable formats and skip for verifying connection [#25786](https://github.com/docker/docker/pull/25786)
### Networking
+ Add `--attachable` network support to enable `docker run` to work in swarm-mode overlay network [#25962](https://github.com/docker/docker/pull/25962)
+ Add support for host port PublishMode in services using the `--port` option in `docker service create` [#27917](https://github.com/docker/docker/pull/27917)
+ Add support for host port PublishMode in services using the `--publish` option in `docker service create` [#27917](https://github.com/docker/docker/pull/27917) and [#28943](https://github.com/docker/docker/pull/28943)
+ Add support for Windows server 2016 overlay network driver (requires upcoming ws2016 update) [#28182](https://github.com/docker/docker/pull/28182)
* Change the default `FORWARD` policy to `DROP` [#28257](https://github.com/docker/docker/pull/28257)
+ Add support for specifying static IP addresses for predefined network on windows [#22208](https://github.com/docker/docker/pull/22208)
@ -77,6 +178,7 @@ be found.
+ Add `docker plugin create` command [#28164](https://github.com/docker/docker/pull/28164)
* Send request's TLS peer certificates to authorization plugins [#27383](https://github.com/docker/docker/pull/27383)
* Support for global-scoped network and ipam plugins in swarm-mode [#27287](https://github.com/docker/docker/pull/27287)
* Split `docker plugin install` into two API call `/privileges` and `/pull` [#28963](https://github.com/docker/docker/pull/28963)
### Remote API (v1.25) & Client
@ -86,21 +188,21 @@ be found.
* Remove `--name` from `docker volume create` [#23830](https://github.com/docker/docker/pull/23830)
+ Add `docker stack ls` [#23886](https://github.com/docker/docker/pull/23886)
+ Add a new `is-task` ps filter [#24411](https://github.com/docker/docker/pull/24411)
+ Add `--env-file` flag to `docker create service` [#24844](https://github.com/docker/docker/pull/24844)
+ Add `--env-file` flag to `docker service create` [#24844](https://github.com/docker/docker/pull/24844)
+ Add `--format` on `docker stats` [#24987](https://github.com/docker/docker/pull/24987)
+ Make `docker node ps` default to `self` in swarm node [#25214](https://github.com/docker/docker/pull/25214)
+ Add `--group` in `docker service create` [#25317](https://github.com/docker/docker/pull/25317)
+ Add `--no-trunc` to service/node/stack ps output [#25337(https://github.com/docker/docker/pull/25337)
+ Add `--no-trunc` to service/node/stack ps output [#25337](https://github.com/docker/docker/pull/25337)
+ Add Logs to `ContainerAttachOptions` so go clients can request to retrieve container logs as part of the attach process [#26718](https://github.com/docker/docker/pull/26718)
+ Allow client to talk to an older server [#27745](https://github.com/docker/docker/pull/27745)
* Inform user client-side that a container removal is in progress [#26074](https://github.com/docker/docker/pull/26074)
+ Add `Isolation` to the /info endpoint [#26255](https://github.com/docker/docker/pull/26255)
+ Add `userns` to the /info endpoint [#27840](https://github.com/docker/docker/pull/27840)
- Do not allow more than one mode be requested at once in the services endpoint [#26643](https://github.com/docker/docker/pull/26643)
+ Add `--mount` flag to `docker create` and `docker run` [#26825](https://github.com/docker/docker/pull/26825)[#28150](https://github.com/docker/docker/pull/28150)
+ Add capability to /containers/create API to specify mounts in a more granular and safer way [#22373](https://github.com/docker/docker/pull/22373)
+ Add `--format` flag to `network ls` and `volume ls` [#23475](https://github.com/docker/docker/pull/23475)
* Allow the top-level `docker inspect` command to inspect any kind of resource [#23614](https://github.com/docker/docker/pull/23614)
+ Add --cpus flag to control cpu resources for `docker run` and `docker create`, and add `NanoCPUs` to `HostConfig` [#27958](https://github.com/docker/docker/pull/27958)
- Allow unsetting the `--entrypoint` in `docker run` or `docker create` [#23718](https://github.com/docker/docker/pull/23718)
* Restructure CLI commands by adding `docker image` and `docker container` commands for more consistency [#26025](https://github.com/docker/docker/pull/26025)
- Remove `COMMAND` column from `service ls` output [#28029](https://github.com/docker/docker/pull/28029)
@ -132,7 +234,7 @@ be found.
- Fix a race condition between device deferred removal and resume device, when using the devicemapper graphdriver [#23497](https://github.com/docker/docker/pull/23497)
- Add `docker stats` support in Windows [#25737](https://github.com/docker/docker/pull/25737)
- Allow using `--pid=host` and `--net=host` when `--userns=host` [#25771](https://github.com/docker/docker/pull/25771)
+ (experimental) Add metrics output [#25820](https://github.com/docker/docker/pull/25820)
+ (experimental) Add metrics (Prometheus) output for basic `container`, `image`, and `daemon` operations [#25820](https://github.com/docker/docker/pull/25820)
- Fix issue in `docker stats` with `NetworkDisabled=true` [#25905](https://github.com/docker/docker/pull/25905)
+ Add `docker top` support in Windows [#25891](https://github.com/docker/docker/pull/25891)
+ Record pid of exec'd process [#27470](https://github.com/docker/docker/pull/27470)
@ -150,32 +252,38 @@ be found.
### Swarm Mode
+ Add secret management [#27794](https://github.com/docker/docker/pull/27794)
+ Add support for templating service options (hostname, mounts, and environment variables) [#28025](https://github.com/docker/docker/pull/28025)
* Display the endpoint mode in the output of `docker service inspect --pretty` [#26906](https://github.com/docker/docker/pull/26906)
* Make `docker service ps` output more bearable by shortening service IDs in task names [#28088](https://github.com/docker/docker/pull/28088)
* `docker node ps` now defaults to the current node [#25214](https://github.com/docker/docker/pull/25214)
+ Add `-a`/`--all` flags to `docker service ps` and `docker node ps` to show all results [#25983](https://github.com/docker/docker/pull/25983)
* Make `docker node ps` default to the current node [#25214](https://github.com/docker/docker/pull/25214)
+ Add `--dns`, -`-dns-opt`, and `--dns-search` to service create. [#27567](https://github.com/docker/docker/pull/27567)
+ Add `--force` to `docker service update` [#27596](https://github.com/docker/docker/pull/27596)
+ Add `--health-*` and `--no-healthcheck` flags to `docker service create` and `docker service update` [#27369](https://github.com/docker/docker/pull/27369)
+ Add `-q` to `docker service ps` [#27654](https://github.com/docker/docker/pull/27654)
* Display number of global services in `docker service ls` [#27710](https://github.com/docker/docker/pull/27710)
- Remove `--name` flag from `docker service update`. This flag is only functional on `docker service create`, so was removed from the `update` command [#26988](https://github.com/docker/docker/pull/26988)
- Fix worker nodes failing to recover because of transient networking issues [#26646](https://github.com/docker/docker/issues/26646)
* Add support for health aware load balancing and DNS records [#27279](https://github.com/docker/docker/pull/27279)
* Add `--hostname` to `docker service create` [#27857](https://github.com/docker/docker/pull/27857)
- Add `--tty` flag to `docker service create`/`update` [#28076](https://github.com/docker/docker/pull/28076)
+ Add `--hostname` to `docker service create` [#27857](https://github.com/docker/docker/pull/27857)
+ Add `--host` to `docker service create`, and `--host-add`, `--host-rm` to `docker service update` [#28031](https://github.com/docker/docker/pull/28031)
+ Add `--tty` flag to `docker service create`/`update` [#28076](https://github.com/docker/docker/pull/28076)
* Autodetect, store, and expose node IP address as seen by the manager [#27910](https://github.com/docker/docker/pull/27910)
* Encryption at rest of manager keys and raft data [#27967](https://github.com/docker/docker/pull/27967)
+ Add `--update-max-failure-ratio`, `--update-monitor` and `--rollback` flags to `docker service update` [#26421](https://github.com/docker/docker/pull/26421)
- Fix an issue with address autodiscovery on `docker swarm init` running inside a container [#26457](https://github.com/docker/docker/pull/26457)
+ (experimental) Add `docker service logs` command to view logs for a service [#28089](https://github.com/docker/docker/pull/28089)
- Pin images by digest for `docker service create` and `update` [#28173](https://github.com/docker/docker/pull/28173)
- Add short (`-f`) flag for `docker node rm --force` and `docker swarm leave --force` [#28196](https://github.com/docker/docker/pull/28196)
+ Don't repull image if pinned by digest [#28265](https://github.com/docker/docker/pull/28265)
+ swarm-mode support for indows [#27838](https://github.com/docker/docker/pull/27838)
+ Pin images by digest for `docker service create` and `update` [#28173](https://github.com/docker/docker/pull/28173)
* Add short (`-f`) flag for `docker node rm --force` and `docker swarm leave --force` [#28196](https://github.com/docker/docker/pull/28196)
+ Add options to customize Raft snapshots (`--max-snapshots`, `--snapshot-interval`) [#27997](https://github.com/docker/docker/pull/27997)
- Don't repull image if pinned by digest [#28265](https://github.com/docker/docker/pull/28265)
+ Swarm-mode support for Windows [#27838](https://github.com/docker/docker/pull/27838)
+ Allow hostname to be updated on service [#28771](https://github.com/docker/docker/pull/28771)
+ Support v2 plugins [#29433](https://github.com/docker/docker/pull/29433)
+ Add content trust for services [#29469](https://github.com/docker/docker/pull/29469)
### Volume
+ Add support for labels on volumes [#25628](https://github.com/docker/docker/pull/21567)
+ Add support for labels on volumes [#21270](https://github.com/docker/docker/pull/21270)
+ Add support for filtering volumes by label [#25628](https://github.com/docker/docker/pull/25628)
* Add a `--force` flag in `docker volume rm` to forcefully purge the data of the volume that has already been deleted [#23436](https://github.com/docker/docker/pull/23436)
* Enhance `docker volume inspect` to show all options used when creating the volume [#26671](https://github.com/docker/docker/pull/26671)
@ -192,10 +300,236 @@ be found.
- Deprecate unversioned API endpoints [#28208](https://github.com/docker/docker/pull/28208)
- Remove Ubuntu 15.10 (Wily Werewolf) as supported platform. Ubuntu 15.10 is EOL, and no longer receives updates [#27042](https://github.com/docker/docker/pull/27042)
- Remove Fedora 22 as supported platform. Fedora 22 is EOL, and no longer receives updates [#27432](https://github.com/docker/docker/pull/27432)
- Remove Fedora 23 as supported platform. Fedora 23 is EOL, and no longer receives updates [#29455](https://github.com/docker/docker/pull/29455)
- Deprecate the `repo:shortid` syntax on `docker pull` [#27207](https://github.com/docker/docker/pull/27207)
- Deprecate backing filesystem without d_type for overlay/overlay2 storage drivers [#27433](https://github.com/docker/docker/pull/27433)
- Deprecate MAINTAINER in Dockerfile [#25466](https://github.com/docker/docker/pull/25466)
- Deprecated filter param for endpoint `/images/json` [#27872](https://github.com/docker/docker/pull/27872)
- Deprecate backing filesystem without `d_type` for overlay and overlay2 storage drivers [#27433](https://github.com/docker/docker/pull/27433)
- Deprecate `MAINTAINER` in Dockerfile [#25466](https://github.com/docker/docker/pull/25466)
- Deprecate `filter` param for endpoint `/images/json` [#27872](https://github.com/docker/docker/pull/27872)
- Deprecate setting duplicate engine labels [#24533](https://github.com/docker/docker/pull/24533)
- Deprecate "top-level" network information in `NetworkSettings` [#28437](https://github.com/docker/docker/pull/28437)
## 1.12.6 (2017-01-10)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
**NOTE**: Docker 1.12.5 will correctly validate that either an IPv6 subnet is provided or
that the IPAM driver can provide one when you specify the `--ipv6` option.
If you are currently using the `--ipv6` option _without_ specifying the
`--fixed-cidr-v6` option, the Docker daemon will refuse to start with the
following message:
```none
Error starting daemon: Error initializing network controller: Error creating
default "bridge" network: failed to parse pool request
for address space "LocalDefault" pool " subpool ":
could not find an available, non-overlapping IPv6 address
pool among the defaults to assign to the network
```
To resolve this error, either remove the `--ipv6` flag (to preserve the same
behavior as in Docker 1.12.3 and earlier), or provide an IPv6 subnet as the
value of the `--fixed-cidr-v6` flag.
In a similar way, if you specify the `--ipv6` flag when creating a network
with the default IPAM driver, without providing an IPv6 `--subnet`, network
creation will fail with the following message:
```none
Error response from daemon: failed to parse pool request for address space
"LocalDefault" pool "" subpool "": could not find an
available, non-overlapping IPv6 address pool among
the defaults to assign to the network
```
To resolve this, either remove the `--ipv6` flag (to preserve the same behavior
as in Docker 1.12.3 and earlier), or provide an IPv6 subnet as the value of the
`--subnet` flag.
The network network creation will instead succeed if you use an external IPAM driver
which supports automatic allocation of IPv6 subnets.
### Runtime
- Fix runC privilege escalation (CVE-2016-9962)
## 1.12.5 (2016-12-15)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
**NOTE**: Docker 1.12.5 will correctly validate that either an IPv6 subnet is provided or
that the IPAM driver can provide one when you specify the `--ipv6` option.
If you are currently using the `--ipv6` option _without_ specifying the
`--fixed-cidr-v6` option, the Docker daemon will refuse to start with the
following message:
```none
Error starting daemon: Error initializing network controller: Error creating
default "bridge" network: failed to parse pool request
for address space "LocalDefault" pool " subpool ":
could not find an available, non-overlapping IPv6 address
pool among the defaults to assign to the network
```
To resolve this error, either remove the `--ipv6` flag (to preserve the same
behavior as in Docker 1.12.3 and earlier), or provide an IPv6 subnet as the
value of the `--fixed-cidr-v6` flag.
In a similar way, if you specify the `--ipv6` flag when creating a network
with the default IPAM driver, without providing an IPv6 `--subnet`, network
creation will fail with the following message:
```none
Error response from daemon: failed to parse pool request for address space
"LocalDefault" pool "" subpool "": could not find an
available, non-overlapping IPv6 address pool among
the defaults to assign to the network
```
To resolve this, either remove the `--ipv6` flag (to preserve the same behavior
as in Docker 1.12.3 and earlier), or provide an IPv6 subnet as the value of the
`--subnet` flag.
The network network creation will instead succeed if you use an external IPAM driver
which supports automatic allocation of IPv6 subnets.
### Runtime
- Fix race on sending stdin close event [#29424](https://github.com/docker/docker/pull/29424)
### Networking
- Fix panic in docker network ls when a network was created with `--ipv6` and no ipv6 `--subnet` in older docker versions [#29416](https://github.com/docker/docker/pull/29416)
### Contrib
- Fix compilation on Darwin [#29370](https://github.com/docker/docker/pull/29370)
## 1.12.4 (2016-12-12)
**IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
upgrading from an older version of docker, the upgrade process may not
automatically install the updated version of the unit file, or fail to start
the docker service if;
- the systemd unit file (`/usr/lib/systemd/system/docker.service`) contains local changes, or
- a systemd drop-in file is present, and contains `-H fd://` in the `ExecStart` directive
Starting the docker service will produce an error:
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
or
no sockets found via socket activation: make sure the service was started by systemd.
To resolve this:
- Backup the current version of the unit file, and replace the file with the
[version that ships with docker 1.12](https://raw.githubusercontent.com/docker/docker/v1.12.0/contrib/init/systemd/docker.service.rpm)
- Remove the `Requires=docker.socket` directive from the `/usr/lib/systemd/system/docker.service` file if present
- Remove `-H fd://` from the `ExecStart` directive (both in the main unit file, and in any drop-in files present).
After making those changes, run `sudo systemctl daemon-reload`, and `sudo
systemctl restart docker` to reload changes and (re)start the docker daemon.
### Runtime
- Fix issue where volume metadata was not removed [#29083](https://github.com/docker/docker/pull/29083)
- Asynchronously close streams to prevent holding container lock [#29050](https://github.com/docker/docker/pull/29050)
- Fix selinux labels for newly created container volumes [#29050](https://github.com/docker/docker/pull/29050)
- Remove hostname validation [#28990](https://github.com/docker/docker/pull/28990)
- Fix deadlocks caused by IO races [#29095](https://github.com/docker/docker/pull/29095) [#29141](https://github.com/docker/docker/pull/29141)
- Return an empty stats if the container is restarting [#29150](https://github.com/docker/docker/pull/29150)
- Fix volume store locking [#29151](https://github.com/docker/docker/pull/29151)
- Ensure consistent status code in API [#29150](https://github.com/docker/docker/pull/29150)
- Fix incorrect opaque directory permission in overlay2 [#29093](https://github.com/docker/docker/pull/29093)
- Detect plugin content and error out on `docker pull` [#29297](https://github.com/docker/docker/pull/29297)
### Swarm Mode
* Update Swarmkit [#29047](https://github.com/docker/docker/pull/29047)
- orchestrator/global: Fix deadlock on updates [docker/swarmkit#1760](https://github.com/docker/swarmkit/pull/1760)
- on leader switchover preserve the vxlan id for existing networks [docker/swarmkit#1773](https://github.com/docker/swarmkit/pull/1773)
- Refuse swarm spec not named "default" [#29152](https://github.com/docker/docker/pull/29152)
### Networking
* Update libnetwork [#29004](https://github.com/docker/docker/pull/29004) [#29146](https://github.com/docker/docker/pull/29146)
- Fix panic in embedded DNS [docker/libnetwork#1561](https://github.com/docker/libnetwork/pull/1561)
- Fix unmarhalling panic when passing --link-local-ip on global scope network [docker/libnetwork#1564](https://github.com/docker/libnetwork/pull/1564)
- Fix panic when network plugin returns nil StaticRoutes [docker/libnetwork#1563](https://github.com/docker/libnetwork/pull/1563)
- Fix panic in osl.(*networkNamespace).DeleteNeighbor [docker/libnetwork#1555](https://github.com/docker/libnetwork/pull/1555)
- Fix panic in swarm networking concurrent map read/write [docker/libnetwork#1570](https://github.com/docker/libnetwork/pull/1570)
* Allow encrypted networks when running docker inside a container [docker/libnetwork#1502](https://github.com/docker/libnetwork/pull/1502)
- Do not block autoallocation of IPv6 pool [docker/libnetwork#1538](https://github.com/docker/libnetwork/pull/1538)
- Set timeout for netlink calls [docker/libnetwork#1557](https://github.com/docker/libnetwork/pull/1557)
- Increase networking local store timeout to one minute [docker/libkv#140](https://github.com/docker/libkv/pull/140)
- Fix a panic in libnetwork.(*sandbox).execFunc [docker/libnetwork#1556](https://github.com/docker/libnetwork/pull/1556)
- Honor icc=false for internal networks [docker/libnetwork#1525](https://github.com/docker/libnetwork/pull/1525)
### Logging
* Update syslog log driver [#29150](https://github.com/docker/docker/pull/29150)
### Contrib
- Run "dnf upgrade" before installing in fedora [#29150](https://github.com/docker/docker/pull/29150)
- Add build-date back to RPM packages [#29150](https://github.com/docker/docker/pull/29150)
- deb package filename changed to include distro to distinguish between distro code names [#27829](https://github.com/docker/docker/pull/27829)
## 1.12.3 (2016-10-26)

View file

@ -25,16 +25,15 @@
FROM debian:jessie
# allow replacing httpredir or deb mirror
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
# Add zfs ppa
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61 \
|| 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 \
@ -127,7 +126,7 @@ RUN set -x \
# IMPORTANT: If the version of Go is updated, the Windows to Linux CI machines
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
# with a heads-up.
ENV GO_VERSION 1.7.3
ENV GO_VERSION 1.7.5
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -xzC /usr/local
@ -238,7 +237,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
# Please edit hack/dockerfile/install-binaries.sh to update them.
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy bindata
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]

View file

@ -97,7 +97,7 @@ RUN set -x \
# so we use gccgo as bootstrap to build Go from source code.
# We don't use the official ARMv6 released binaries as a GOROOT_BOOTSTRAP, because
# not all ARM64 platforms support 32-bit mode. 32-bit mode is optional for ARMv8.
ENV GO_VERSION 1.7.3
ENV GO_VERSION 1.7.5
RUN mkdir /usr/src/go && curl -fsSL https://golang.org/dl/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

View file

@ -17,6 +17,10 @@
FROM armhf/debian:jessie
# allow replacing httpredir or deb mirror
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \
@ -68,7 +72,7 @@ RUN cd /usr/local/lvm2 \
# See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# Install Go
ENV GO_VERSION 1.7.3
ENV GO_VERSION 1.7.5
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" \
| tar -xzC /usr/local
ENV PATH /go/bin:/usr/local/go/bin:$PATH

View file

@ -15,8 +15,11 @@
# the case. Therefore, you don't have to disable it anymore.
#
# ppc64le/golang is a debian:jessie based image with golang installed
FROM ppc64le/golang:1.6.3
FROM ppc64le/debian:jessie
# allow replacing httpredir or deb mirror
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
# Packaged dependencies
RUN apt-get update && apt-get install -y \
@ -91,25 +94,12 @@ RUN set -x \
# Install Go
# ppc64le doesn't have official go binaries, so use the version of go installed from the image
# to build go from source.
# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6
ENV GO_VERSION 1.7.3
ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz
# NOTE: official ppc64le go binaries weren't available until go 1.6.4 and 1.7.4
ENV GO_VERSION 1.7.5
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" \
| tar -xzC /usr/local
RUN set -x \
&& TEMPDIR="$(mktemp -d)" \
&& mv /usr/local/go $TEMPDIR \
&& GOROOT_BOOTSTRAP=$TEMPDIR/go \
&& cd /usr/local \
&& curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz \
&& cd go/src && ./make.bash 2>&1 \
&& rm -rf $TEMPDIR
ENV GOROOT_BOOTSTRAP /usr/local/go
ENV PATH /usr/local/go/bin/:$PATH
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go
# Dependency for golint

View file

@ -97,7 +97,7 @@ RUN cd /usr/local/lvm2 \
&& make install_device-mapper
# See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
ENV GO_VERSION 1.7.3
ENV GO_VERSION 1.7.5
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-s390x.tar.gz" \
| tar -xzC /usr/local

View file

@ -7,6 +7,10 @@
FROM debian:jessie
# allow replacing httpredir or deb mirror
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
# 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#runtime-dependencies
@ -51,7 +55,7 @@ RUN set -x \
# IMPORTANT: If the version of Go is updated, the Windows to Linux CI machines
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
# with a heads-up.
ENV GO_VERSION 1.7.3
ENV GO_VERSION 1.7.5
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -xzC /usr/local
ENV PATH /go/bin:/usr/local/go/bin:$PATH

View file

@ -2,7 +2,7 @@
# -----------------------------------------------------------------------------------------
# This file describes the standard way to build Docker in a container on Windows
# Server 2016.
# Server 2016 or Windows 10.
#
# Maintainer: @jhowardmsft
# -----------------------------------------------------------------------------------------
@ -11,21 +11,25 @@
# Prerequisites:
# --------------
#
# 1. Windows Server 2016 with all Windows updates applied. Pre-release versions
# of Windows are not supported (eg Windows Server 2016 TP5). The 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 late October 2016:
# 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.321.amd64fre.rs1_release_inmarket.161004-2338
# >> 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.
# -----------------------------------------------------------------------------------------
@ -58,23 +62,24 @@
# >> cd C:\go\src\github.com\docker\docker
#
#
# 3. Build a docker image with the components required to build the docker binaries from source:
# 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 in a container:
# 4. Build the docker executable binaries by running one of the following:
#
# >> docker run --name binaries nativebuildimage sh -c 'cd /c/go/src/github.com/docker/docker; hack/make.sh binary'
# >> docker run --name binaries nativebuildimage hack\make.ps1 -Binary
# >> docker run --name binaries -m 2GB nativebuildimage hack\make.ps1 -Binary (if using Hyper-V containers)
#
#
# 5. Copy the binaries out of the above container, replacing HostPath with an appropriate destination
# 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.
#
# >> $v=$(Get-Content ".\VERSION" -raw).ToString().Replace("`n","").Trim()
# >> docker cp binaries:C:\go\src\github.com\docker\docker\bundles\$v\binary-client\docker-$v.exe C:\HostPath\docker.exe
# >> docker cp binaries:C:\go\src\github.com\docker\docker\bundles\$v\binary-daemon\dockerd.exe C:\HostPath\dockerd.exe
# >> docker cp binaries:C:\go\src\github.com\docker\docker\bundles\$v\binary-daemon\docker-proxy-$v.exe C:\HostPath\docker-proxy.exe
# >> docker cp binaries:C:\go\src\github.com\docker\docker\bundles\docker.exe C:\HostPath\docker.exe
# >> docker cp binaries:C:\go\src\github.com\docker\docker\bundles\dockerd.exe C:\HostPath\dockerd.exe
#
#
# 6. (Optional) Remove the interim container holding the built executable binaries:
@ -88,7 +93,42 @@
# image which has all the components required to build the binaries already installed.
#
# >> docker rmi nativebuildimage
#
# -----------------------------------------------------------------------------------------
# The validation tests can either run in a container, or directly on the host. To run in a
# container, 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 -DCO -PkgImports -GoFormat
# >> docker run --rm -m 2GB nativebuildimage hack\make.ps1 -DCO -PkgImports -GoFormat (if using Hyper-V containers)
# To run the validation tests on the host, from the root of the repository, 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 all 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)
# -----------------------------------------------------------------------------------------
@ -96,28 +136,26 @@
# Important notes:
# ---------------
#
# The posix utilities from git aren't usable interactively as at October 2016. This
# is because they require a console window which isn't present in a container in Windows.
# See the example at the top of this file. Do NOT use -it in that docker run. It will not work.
# Don't attempt to use a bind-mount to pass a local directory as the bundles target
# directory. It does not work (golang attempts for follow a mapped folder incorrectly).
# Instead, use docker cp as per the example.
#
# Don't attempt to use a volume for passing the source through to the container. The posix utilities will
# balk at reparse points.
# go.zip is not removed from the image as it is used by the Windows CI servers
# to ensure the host and image are running consistent versions of go.
#
# The downloaded files are not cleared from the image. go.zip is used by the Windows
# CI servers to ensure the host and image are running consistent versions of go.
# Nanoserver support is a work in progress. Although the image will build if the
# 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 GIT installer isn't very good at unattended install. We use techniques described
# at the links below to force it to set the path and other options accordingly.
# >> http://superuser.com/questions/944576/git-for-windows-silent-install-silent-arguments
# and follow through to installer at
# >> https://github.com/ferventcoder/chocolatey-packages/blob/master/automatic/git.install/tools/chocolateyInstall.ps1
# 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/jhowardmsft/docker-w2wCIScripts/blob/master/runCI/Invoke-DockerCI.ps1.
#
# As of October 2016, this does not work on Windows 10 client, just Windows Server 2016,
# and only with the default isolation mode (process). It does not work with isolation mode
# set to Hyper-V containers (hyperv).
# -----------------------------------------------------------------------------------------
# The number of build steps below are explicitly minimised to improve performance.
FROM microsoft/windowsservercore
@ -127,56 +165,103 @@ SHELL ["powershell", "-command"]
# Environment variable notes:
# - GO_VERSION must be consistent with 'Dockerfile' used by Linux.
# - FROM_DOCKERFILE is used for detection of building within a container.
ENV GO_VERSION=1.7.3 `
GIT_LOCATION=https://github.com/git-for-windows/git/releases/download/v2.10.1.windows.1/Git-2.10.1-64-bit.exe `
ENV GO_VERSION=1.7.5 `
GIT_VERSION=2.11.0 `
GOPATH=C:\go `
FROM_DOCKERFILE=1
WORKDIR C:\
RUN `
setx /M Path $($Env:PATH+';C:\gcc\bin;C:\go\bin'); `
`
$ErrorActionPreference = 'Stop'; `
$ProgressPreference = 'SilentlyContinue'; `
`
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) { `
$wc = New-Object net.webclient; $wc.Downloadfile($source, $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 { `
$webClient = New-Object System.Net.WebClient; `
$webClient.DownloadFile($source, $target); `
} `
} `
`
setx /M PATH $('C:\git\bin;C:\git\usr\bin;'+$Env:PATH+';C:\gcc\bin;C:\go\bin'); `
`
Write-Host INFO: Downloading git...; `
Download-File $Env:GIT_LOCATION gitsetup.exe; `
$location='https://github.com/git-for-windows/git/releases/download/v'+$env:GIT_VERSION+'.windows.1/PortableGit-'+$env:GIT_VERSION+'-64-bit.7z.exe'; `
Download-File $location C:\gitsetup.7z.exe; `
`
Write-Host INFO: Downloading go...; `
Download-File $('https://golang.org/dl/go'+$Env:GO_VERSION+'.windows-amd64.zip') go.zip; `
Download-File $('https://golang.org/dl/go'+$Env:GO_VERSION+'.windows-amd64.zip') C:\go.zip; `
`
Write-Host INFO: Downloading compiler 1 of 3...; `
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/gcc.zip gcc.zip; `
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/gcc.zip C:\gcc.zip; `
`
Write-Host INFO: Downloading compiler 2 of 3...; `
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/runtime.zip runtime.zip; `
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/runtime.zip C:\runtime.zip; `
`
Write-Host INFO: Downloading compiler 3 of 3...; `
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/binutils.zip binutils.zip; `
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/binutils.zip C:\binutils.zip; `
`
Write-Host INFO: Installing git...; `
$installPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'; `
$installItem = 'Git_is1'; `
New-Item -Path $installPath -Name $installItem -Force; `
$installKey = $installPath+'\'+$installItem; `
New-ItemProperty $installKey -Name 'Inno Setup CodeFile: Path Option' -Value 'CmdTools' -PropertyType 'String' -Force; `
New-ItemProperty $installKey -Name 'Inno Setup CodeFile: Bash Terminal Option' -Value 'ConHost' -PropertyType 'String' -Force; `
New-ItemProperty $installKey -Name 'Inno Setup CodeFile: CRLF Option' -Value 'CRLFCommitAsIs' -PropertyType 'String' -Force; `
Start-Process gitsetup.exe -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS /DIR=C:\git\' -Wait; `
Write-Host INFO: Installing PS7Zip package...; `
Install-Package PS7Zip -Force | Out-Null; `
Write-Host INFO: Importing PS7Zip...; `
Import-Module PS7Zip -Force; `
New-Item C:\git -ItemType Directory | Out-Null ; `
cd C:\git; `
Write-Host INFO: Extracting git...; `
Expand-7Zip C:\gitsetup.7z.exe | Out-Null; `
cd C:\; `
`
Write-Host INFO: Expanding go...; `
Expand-Archive C:\go.zip -DestinationPath C:\; `
`
Write-Host INFO: Expanding compiler...; `
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.7z.exe; `
`
Write-Host INFO: Creating source directory...; `
New-Item -ItemType Directory -Path C:\go\src\github.com\docker\docker | Out-Null; `
`
Write-Host INFO: Configuring git core.autocrlf...; `
C:\git\bin\git config --global core.autocrlf true; `
`
Write-Host INFO: Completed
# Prepare for building
COPY . C:\go\src\github.com\docker\docker
# Make PowerShell the default entrypoint
ENTRYPOINT ["powershell.exe"]
# Set the working directory to the location of the sources
WORKDIR C:\go\src\github.com\docker\docker
# Copy the sources into the container
COPY . .

View file

@ -117,6 +117,9 @@ run: build ## run the docker daemon in a container
shell: build ## start a shell inside the build env
$(DOCKER_RUN_DOCKER) bash
yaml-docs-gen: build ## generate documentation YAML files consumed by docs repo
$(DOCKER_RUN_DOCKER) sh -c 'hack/make.sh yaml-docs-generator && ( root=$$(pwd); cd bundles/latest/yaml-docs-generator; mkdir docs; ./yaml-docs-generator --root $${root} --target $$(pwd)/docs )'
test: build ## run the unit, integration and docker-py tests
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary cross test-unit test-integration-cli test-docker-py
@ -144,4 +147,4 @@ swagger-gen:
-w /go/src/github.com/docker/docker \
--entrypoint hack/generate-swagger-api.sh \
-e GOPATH=/go \
quay.io/goswagger/swagger
quay.io/goswagger/swagger:0.7.4

View file

@ -1 +1 @@
1.13.0-dev
17.03.0-ce-rc1

View file

@ -1,5 +1,42 @@
This directory contains code pertaining to the Docker API:
# Working on the Engine API
- Used by the docker client when communicating with the docker daemon
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 third party tools wishing to interface with the docker daemon
It consists of various components in this repository:
- `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. To automatically generate documentation.
2. To 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, you'll need to 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 for when you are 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.
All the documentation generation is done in the documentation repository, [docker/docker.github.io](https://github.com/docker/docker.github.io). The Swagger definition is vendored periodically into this repository, but you can manually copy over the Swagger definition to test changes.
Copy `api/swagger.yaml` in this repository to `engine/api/[VERSION_NUMBER]/swagger.yaml` in the documentation repository, overwriting what is already there. Then, run `docker-compose up` in the documentation repository and browse to [http://localhost:4000/engine/api/](http://localhost:4000/engine/api/) when it finishes rendering.

View file

@ -21,7 +21,7 @@ import (
// Common constants for daemon and client.
const (
// DefaultVersion of Current REST API
DefaultVersion string = "1.25"
DefaultVersion string = "1.26"
// NoBaseImageSpecifier is the symbol used by the FROM
// command to specify that no base image is to be used.

View file

@ -28,7 +28,7 @@ type inputValidationError interface {
IsValidationError() bool
}
// GetHTTPErrorStatusCode retrieve status code from error message
// GetHTTPErrorStatusCode retrieves status code from error message
func GetHTTPErrorStatusCode(err error) int {
if err == nil {
logrus.WithFields(logrus.Fields{"error": err}).Error("unexpected HTTP error handling")
@ -49,20 +49,25 @@ func GetHTTPErrorStatusCode(err error) int {
// If we need to differentiate between different possible error types,
// we should create appropriate error types that implement the httpStatusError interface.
errStr := strings.ToLower(errMsg)
for keyword, status := range map[string]int{
"not found": http.StatusNotFound,
"no such": http.StatusNotFound,
"bad parameter": http.StatusBadRequest,
"no command": http.StatusBadRequest,
"conflict": http.StatusConflict,
"impossible": http.StatusNotAcceptable,
"wrong login/password": http.StatusUnauthorized,
"unauthorized": http.StatusUnauthorized,
"hasn't been activated": http.StatusForbidden,
"this node": http.StatusNotAcceptable,
for _, status := range []struct {
keyword string
code int
}{
{"not found", http.StatusNotFound},
{"no such", http.StatusNotFound},
{"bad parameter", http.StatusBadRequest},
{"no command", http.StatusBadRequest},
{"conflict", http.StatusConflict},
{"impossible", http.StatusNotAcceptable},
{"wrong login/password", http.StatusUnauthorized},
{"unauthorized", http.StatusUnauthorized},
{"hasn't been activated", http.StatusForbidden},
{"this node", http.StatusServiceUnavailable},
{"needs to be unlocked", http.StatusServiceUnavailable},
{"certificates have expired", http.StatusServiceUnavailable},
} {
if strings.Contains(errStr, keyword) {
statusCode = status
if strings.Contains(errStr, status.keyword) {
statusCode = status.code
break
}
}

View file

@ -84,14 +84,28 @@ func newImageBuildOptions(ctx context.Context, r *http.Request) (*types.ImageBui
options.Ulimits = buildUlimits
}
var buildArgs = map[string]string{}
var buildArgs = map[string]*string{}
buildArgsJSON := r.FormValue("buildargs")
// Note that there are two ways a --build-arg might appear in the
// json of the query param:
// "foo":"bar"
// and "foo":nil
// The first is the normal case, ie. --build-arg foo=bar
// or --build-arg foo
// where foo's value was picked up from an env var.
// The second ("foo":nil) is where they put --build-arg foo
// but "foo" isn't set as an env var. In that case we can't just drop
// the fact they mentioned it, we need to pass that along to the builder
// so that it can print a warning about "foo" being unused if there is
// no "ARG foo" in the Dockerfile.
if buildArgsJSON != "" {
if err := json.Unmarshal([]byte(buildArgsJSON), &buildArgs); err != nil {
return nil, err
}
options.BuildArgs = buildArgs
}
var labels = map[string]string{}
labelsJSON := r.FormValue("labels")
if labelsJSON != "" {

View file

@ -29,8 +29,8 @@ func (r *checkpointRouter) Routes() []router.Route {
func (r *checkpointRouter) initRoutes() {
r.routes = []router.Route{
router.NewGetRoute("/containers/{name:.*}/checkpoints", r.getContainerCheckpoints),
router.NewPostRoute("/containers/{name:.*}/checkpoints", r.postContainerCheckpoint),
router.NewDeleteRoute("/containers/{name}/checkpoints/{checkpoint}", r.deleteContainerCheckpoint),
router.Experimental(router.NewGetRoute("/containers/{name:.*}/checkpoints", r.getContainerCheckpoints)),
router.Experimental(router.NewPostRoute("/containers/{name:.*}/checkpoints", r.postContainerCheckpoint)),
router.Experimental(router.NewDeleteRoute("/containers/{name}/checkpoints/{checkpoint}", r.deleteContainerCheckpoint)),
}
}

View file

@ -9,6 +9,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/backend"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/pkg/archive"
)
@ -32,17 +33,17 @@ type copyBackend interface {
// stateBackend includes functions to implement to provide container state lifecycle functionality.
type stateBackend interface {
ContainerCreate(config types.ContainerCreateConfig, validateHostname bool) (container.ContainerCreateCreatedBody, error)
ContainerCreate(config types.ContainerCreateConfig) (container.ContainerCreateCreatedBody, error)
ContainerKill(name string, sig uint64) error
ContainerPause(name string) error
ContainerRename(oldName, newName string) error
ContainerResize(name string, height, width int) error
ContainerRestart(name string, seconds *int) error
ContainerRm(name string, config *types.ContainerRmConfig) error
ContainerStart(name string, hostConfig *container.HostConfig, validateHostname bool, checkpoint string, checkpointDir string) error
ContainerStart(name string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error
ContainerStop(name string, seconds *int) error
ContainerUnpause(name string) error
ContainerUpdate(name string, hostConfig *container.HostConfig, validateHostname bool) (container.ContainerUpdateOKBody, error)
ContainerUpdate(name string, hostConfig *container.HostConfig) (container.ContainerUpdateOKBody, error)
ContainerWait(name string, timeout time.Duration) (int, error)
}
@ -64,7 +65,7 @@ type attachBackend interface {
// systemBackend includes functions to implement to provide system wide containers functionality
type systemBackend interface {
ContainersPrune(config *types.ContainersPruneConfig) (*types.ContainersPruneReport, error)
ContainersPrune(pruneFilters filters.Args) (*types.ContainersPruneReport, error)
}
// Backend is all the methods that need to be implemented to provide container specific functionality.

View file

@ -156,8 +156,7 @@ func (s *containerRouter) postContainersStart(ctx context.Context, w http.Respon
checkpoint := r.Form.Get("checkpoint")
checkpointDir := r.Form.Get("checkpoint-dir")
validateHostname := versions.GreaterThanOrEqualTo(version, "1.24")
if err := s.backend.ContainerStart(vars["name"], hostConfig, validateHostname, checkpoint, checkpointDir); err != nil {
if err := s.backend.ContainerStart(vars["name"], hostConfig, checkpoint, checkpointDir); err != nil {
return err
}
@ -332,7 +331,6 @@ func (s *containerRouter) postContainerUpdate(ctx context.Context, w http.Respon
return err
}
version := httputils.VersionFromContext(ctx)
var updateConfig container.UpdateConfig
decoder := json.NewDecoder(r.Body)
@ -346,8 +344,7 @@ func (s *containerRouter) postContainerUpdate(ctx context.Context, w http.Respon
}
name := vars["name"]
validateHostname := versions.GreaterThanOrEqualTo(version, "1.24")
resp, err := s.backend.ContainerUpdate(name, hostConfig, validateHostname)
resp, err := s.backend.ContainerUpdate(name, hostConfig)
if err != nil {
return err
}
@ -372,14 +369,18 @@ func (s *containerRouter) postContainersCreate(ctx context.Context, w http.Respo
version := httputils.VersionFromContext(ctx)
adjustCPUShares := versions.LessThan(version, "1.19")
validateHostname := versions.GreaterThanOrEqualTo(version, "1.24")
// When using API 1.24 and under, the client is responsible for removing the container
if hostConfig != nil && versions.LessThan(version, "1.25") {
hostConfig.AutoRemove = false
}
ccr, err := s.backend.ContainerCreate(types.ContainerCreateConfig{
Name: name,
Config: config,
HostConfig: hostConfig,
NetworkingConfig: networkingConfig,
AdjustCPUShares: adjustCPUShares,
}, validateHostname)
})
if err != nil {
return err
}
@ -545,16 +546,12 @@ func (s *containerRouter) postContainersPrune(ctx context.Context, w http.Respon
return err
}
if err := httputils.CheckForJSON(r); err != nil {
pruneFilters, err := filters.FromParam(r.Form.Get("filters"))
if err != nil {
return err
}
var cfg types.ContainersPruneConfig
if err := json.NewDecoder(r.Body).Decode(&cfg); err != nil {
return err
}
pruneReport, err := s.backend.ContainersPrune(&cfg)
pruneReport, err := s.backend.ContainersPrune(pruneFilters)
if err != nil {
return err
}

View file

@ -92,11 +92,17 @@ func (s *containerRouter) postContainerExecStart(ctx context.Context, w http.Res
defer httputils.CloseStreams(inStream, outStream)
if _, ok := r.Header["Upgrade"]; ok {
fmt.Fprintf(outStream, "HTTP/1.1 101 UPGRADED\r\nContent-Type: application/vnd.docker.raw-stream\r\nConnection: Upgrade\r\nUpgrade: tcp\r\n\r\n")
fmt.Fprint(outStream, "HTTP/1.1 101 UPGRADED\r\nContent-Type: application/vnd.docker.raw-stream\r\nConnection: Upgrade\r\nUpgrade: tcp\r\n")
} else {
fmt.Fprintf(outStream, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
fmt.Fprint(outStream, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n")
}
// copy headers that were removed as part of hijack
if err := w.Header().WriteSubset(outStream, nil); err != nil {
return err
}
fmt.Fprint(outStream, "\r\n")
stdin = inStream
stdout = outStream
if !execStartCheck.Tty {

View file

@ -0,0 +1,67 @@
package router
import (
"errors"
"net/http"
"golang.org/x/net/context"
apierrors "github.com/docker/docker/api/errors"
"github.com/docker/docker/api/server/httputils"
)
var (
errExperimentalFeature = errors.New("This experimental feature is disabled by default. Start the Docker daemon with --experimental in order to enable it.")
)
// ExperimentalRoute defines an experimental API route that can be enabled or disabled.
type ExperimentalRoute interface {
Route
Enable()
Disable()
}
// experimentalRoute defines an experimental API route that can be enabled or disabled.
// It implements ExperimentalRoute
type experimentalRoute struct {
local Route
handler httputils.APIFunc
}
// Enable enables this experimental route
func (r *experimentalRoute) Enable() {
r.handler = r.local.Handler()
}
// Disable disables the experimental route
func (r *experimentalRoute) Disable() {
r.handler = experimentalHandler
}
func experimentalHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
return apierrors.NewErrorWithStatusCode(errExperimentalFeature, http.StatusNotImplemented)
}
// Handler returns returns the APIFunc to let the server wrap it in middlewares.
func (r *experimentalRoute) Handler() httputils.APIFunc {
return r.handler
}
// Method returns the http method that the route responds to.
func (r *experimentalRoute) Method() string {
return r.local.Method()
}
// Path returns the subpath where the route responds to.
func (r *experimentalRoute) Path() string {
return r.local.Path()
}
// Experimental will mark a route as experimental.
func Experimental(r Route) Route {
return &experimentalRoute{
local: r,
handler: experimentalHandler,
}
}

View file

@ -29,7 +29,7 @@ type imageBackend interface {
Images(imageFilters filters.Args, all bool, withExtraAttrs bool) ([]*types.ImageSummary, error)
LookupImage(name string) (*types.ImageInspect, error)
TagImage(imageName, repository, tag string) error
ImagesPrune(config *types.ImagesPruneConfig) (*types.ImagesPruneReport, error)
ImagesPrune(pruneFilters filters.Args) (*types.ImagesPruneReport, error)
}
type importExportBackend interface {

View file

@ -331,16 +331,12 @@ func (s *imageRouter) postImagesPrune(ctx context.Context, w http.ResponseWriter
return err
}
if err := httputils.CheckForJSON(r); err != nil {
pruneFilters, err := filters.FromParam(r.Form.Get("filters"))
if err != nil {
return err
}
var cfg types.ImagesPruneConfig
if err := json.NewDecoder(r.Body).Decode(&cfg); err != nil {
return err
}
pruneReport, err := s.backend.ImagesPrune(&cfg)
pruneReport, err := s.backend.ImagesPrune(pruneFilters)
if err != nil {
return err
}

View file

@ -2,6 +2,7 @@ package network
import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/network"
"github.com/docker/libnetwork"
)
@ -17,5 +18,5 @@ type Backend interface {
ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error
DisconnectContainerFromNetwork(containerName string, networkName string, force bool) error
DeleteNetwork(name string) error
NetworksPrune(config *types.NetworksPruneConfig) (*types.NetworksPruneReport, error)
NetworksPrune(pruneFilters filters.Args) (*types.NetworksPruneReport, error)
}

View file

@ -80,7 +80,7 @@ func (n *networkRouter) postNetworkCreate(ctx context.Context, w http.ResponseWr
return err
}
if _, err := n.clusterProvider.GetNetwork(create.Name); err == nil {
if nws, err := n.clusterProvider.GetNetworksByName(create.Name); err == nil && len(nws) > 0 {
return libnetwork.NetworkNameError(create.Name)
}
@ -163,7 +163,7 @@ func (n *networkRouter) buildNetworkResource(nw libnetwork.Network) *types.Netwo
r.Created = info.Created()
r.Scope = info.Scope()
if n.clusterProvider.IsManager() {
if _, err := n.clusterProvider.GetNetwork(nw.Name()); err == nil {
if _, err := n.clusterProvider.GetNetwork(nw.ID()); err == nil {
r.Scope = "swarm"
}
} else if info.Dynamic() {
@ -172,10 +172,10 @@ func (n *networkRouter) buildNetworkResource(nw libnetwork.Network) *types.Netwo
r.Driver = nw.Type()
r.EnableIPv6 = info.IPv6Enabled()
r.Internal = info.Internal()
r.Attachable = info.Attachable()
r.Options = info.DriverOptions()
r.Containers = make(map[string]types.EndpointResource)
buildIpamResources(r, info)
r.Internal = info.Internal()
r.Labels = info.Labels()
peers := info.Peers()
@ -259,6 +259,9 @@ func buildIpamResources(r *types.NetworkResource, nwInfo libnetwork.NetworkInfo)
if !hasIpv6Conf {
for _, ip6Info := range ipv6Info {
if ip6Info.IPAMData.Pool == nil {
continue
}
iData := network.IPAMConfig{}
iData.Subnet = ip6Info.IPAMData.Pool.String()
iData.Gateway = ip6Info.IPAMData.Gateway.String()
@ -297,16 +300,7 @@ func (n *networkRouter) postNetworksPrune(ctx context.Context, w http.ResponseWr
return err
}
if err := httputils.CheckForJSON(r); err != nil {
return err
}
var cfg types.NetworksPruneConfig
if err := json.NewDecoder(r.Body).Decode(&cfg); err != nil {
return err
}
pruneReport, err := n.backend.NetworksPrune(&cfg)
pruneReport, err := n.backend.NetworksPrune(filters.Args{})
if err != nil {
return err
}

View file

@ -5,18 +5,21 @@ import (
"net/http"
enginetypes "github.com/docker/docker/api/types"
"github.com/docker/docker/reference"
"golang.org/x/net/context"
)
// Backend for Plugin
type Backend interface {
Disable(name string) error
Enable(name string) error
Disable(name string, config *enginetypes.PluginDisableConfig) error
Enable(name string, config *enginetypes.PluginEnableConfig) error
List() ([]enginetypes.Plugin, error)
Inspect(name string) (enginetypes.Plugin, error)
Inspect(name string) (*enginetypes.Plugin, error)
Remove(name string, config *enginetypes.PluginRmConfig) error
Set(name string, args []string) error
Pull(name string, metaHeaders http.Header, authConfig *enginetypes.AuthConfig) (enginetypes.PluginPrivileges, error)
Push(name string, metaHeaders http.Header, authConfig *enginetypes.AuthConfig) error
CreateFromContext(ctx context.Context, tarCtx io.Reader, options *enginetypes.PluginCreateOptions) error
Privileges(ctx context.Context, ref reference.Named, metaHeaders http.Header, authConfig *enginetypes.AuthConfig) (enginetypes.PluginPrivileges, error)
Pull(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *enginetypes.AuthConfig, privileges enginetypes.PluginPrivileges, outStream io.Writer) error
Push(ctx context.Context, name string, metaHeaders http.Header, authConfig *enginetypes.AuthConfig, outStream io.Writer) error
Upgrade(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *enginetypes.AuthConfig, privileges enginetypes.PluginPrivileges, outStream io.Writer) error
CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *enginetypes.PluginCreateOptions) error
}

View file

@ -25,12 +25,14 @@ func (r *pluginRouter) Routes() []router.Route {
func (r *pluginRouter) initRoutes() {
r.routes = []router.Route{
router.NewGetRoute("/plugins", r.listPlugins),
router.NewGetRoute("/plugins/{name:.*}", r.inspectPlugin),
router.NewGetRoute("/plugins/{name:.*}/json", r.inspectPlugin),
router.NewGetRoute("/plugins/privileges", r.getPrivileges),
router.NewDeleteRoute("/plugins/{name:.*}", r.removePlugin),
router.NewPostRoute("/plugins/{name:.*}/enable", r.enablePlugin), // PATCH?
router.NewPostRoute("/plugins/{name:.*}/disable", r.disablePlugin),
router.NewPostRoute("/plugins/pull", r.pullPlugin),
router.NewPostRoute("/plugins/{name:.*}/push", r.pushPlugin),
router.Cancellable(router.NewPostRoute("/plugins/pull", r.pullPlugin)),
router.Cancellable(router.NewPostRoute("/plugins/{name:.*}/push", r.pushPlugin)),
router.Cancellable(router.NewPostRoute("/plugins/{name:.*}/upgrade", r.upgradePlugin)),
router.NewPostRoute("/plugins/{name:.*}/set", r.setPlugin),
router.NewPostRoute("/plugins/create", r.createPlugin),
}

View file

@ -4,27 +4,30 @@ import (
"encoding/base64"
"encoding/json"
"net/http"
"strconv"
"strings"
distreference "github.com/docker/distribution/reference"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/reference"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
func (pr *pluginRouter) pullPlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
func parseHeaders(headers http.Header) (map[string][]string, *types.AuthConfig) {
metaHeaders := map[string][]string{}
for k, v := range r.Header {
for k, v := range headers {
if strings.HasPrefix(k, "X-Meta-") {
metaHeaders[k] = v
}
}
// Get X-Registry-Auth
authEncoded := r.Header.Get("X-Registry-Auth")
authEncoded := headers.Get("X-Registry-Auth")
authConfig := &types.AuthConfig{}
if authEncoded != "" {
authJSON := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authEncoded))
@ -33,13 +36,180 @@ func (pr *pluginRouter) pullPlugin(ctx context.Context, w http.ResponseWriter, r
}
}
privileges, err := pr.backend.Pull(r.FormValue("name"), metaHeaders, authConfig)
return metaHeaders, authConfig
}
// parseRemoteRef parses the remote reference into a reference.Named
// returning the tag associated with the reference. In the case the
// given reference string includes both digest and tag, the returned
// reference will have the digest without the tag, but the tag will
// be returned.
func parseRemoteRef(remote string) (reference.Named, string, error) {
// Parse remote reference, supporting remotes with name and tag
// NOTE: Using distribution reference to handle references
// containing both a name and digest
remoteRef, err := distreference.ParseNamed(remote)
if err != nil {
return nil, "", err
}
var tag string
if t, ok := remoteRef.(distreference.Tagged); ok {
tag = t.Tag()
}
// Convert distribution reference to docker reference
// TODO: remove when docker reference changes reconciled upstream
ref, err := reference.WithName(remoteRef.Name())
if err != nil {
return nil, "", err
}
if d, ok := remoteRef.(distreference.Digested); ok {
ref, err = reference.WithDigest(ref, d.Digest())
if err != nil {
return nil, "", err
}
} else if tag != "" {
ref, err = reference.WithTag(ref, tag)
if err != nil {
return nil, "", err
}
} else {
ref = reference.WithDefaultTag(ref)
}
return ref, tag, nil
}
func (pr *pluginRouter) getPrivileges(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
metaHeaders, authConfig := parseHeaders(r.Header)
ref, _, err := parseRemoteRef(r.FormValue("remote"))
if err != nil {
return err
}
privileges, err := pr.backend.Privileges(ctx, ref, metaHeaders, authConfig)
if err != nil {
return err
}
return httputils.WriteJSON(w, http.StatusOK, privileges)
}
func (pr *pluginRouter) upgradePlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return errors.Wrap(err, "failed to parse form")
}
var privileges types.PluginPrivileges
dec := json.NewDecoder(r.Body)
if err := dec.Decode(&privileges); err != nil {
return errors.Wrap(err, "failed to parse privileges")
}
if dec.More() {
return errors.New("invalid privileges")
}
metaHeaders, authConfig := parseHeaders(r.Header)
ref, tag, err := parseRemoteRef(r.FormValue("remote"))
if err != nil {
return err
}
name, err := getName(ref, tag, vars["name"])
if err != nil {
return err
}
w.Header().Set("Docker-Plugin-Name", name)
w.Header().Set("Content-Type", "application/json")
output := ioutils.NewWriteFlusher(w)
if err := pr.backend.Upgrade(ctx, ref, name, metaHeaders, authConfig, privileges, output); err != nil {
if !output.Flushed() {
return err
}
output.Write(streamformatter.NewJSONStreamFormatter().FormatError(err))
}
return nil
}
func (pr *pluginRouter) pullPlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return errors.Wrap(err, "failed to parse form")
}
var privileges types.PluginPrivileges
dec := json.NewDecoder(r.Body)
if err := dec.Decode(&privileges); err != nil {
return errors.Wrap(err, "failed to parse privileges")
}
if dec.More() {
return errors.New("invalid privileges")
}
metaHeaders, authConfig := parseHeaders(r.Header)
ref, tag, err := parseRemoteRef(r.FormValue("remote"))
if err != nil {
return err
}
name, err := getName(ref, tag, r.FormValue("name"))
if err != nil {
return err
}
w.Header().Set("Docker-Plugin-Name", name)
w.Header().Set("Content-Type", "application/json")
output := ioutils.NewWriteFlusher(w)
if err := pr.backend.Pull(ctx, ref, name, metaHeaders, authConfig, privileges, output); err != nil {
if !output.Flushed() {
return err
}
output.Write(streamformatter.NewJSONStreamFormatter().FormatError(err))
}
return nil
}
func getName(ref reference.Named, tag, name string) (string, error) {
if name == "" {
if _, ok := ref.(reference.Canonical); ok {
trimmed := reference.TrimNamed(ref)
if tag != "" {
nt, err := reference.WithTag(trimmed, tag)
if err != nil {
return "", err
}
name = nt.String()
} else {
name = reference.WithDefaultTag(trimmed).String()
}
} else {
name = ref.String()
}
} else {
localRef, err := reference.ParseNamed(name)
if err != nil {
return "", err
}
if _, ok := localRef.(reference.Canonical); ok {
return "", errors.New("cannot use digest in plugin tag")
}
if distreference.IsNameOnly(localRef) {
// TODO: log change in name to out stream
name = reference.WithDefaultTag(localRef).String()
}
}
return name, nil
}
func (pr *pluginRouter) createPlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
@ -51,16 +221,37 @@ func (pr *pluginRouter) createPlugin(ctx context.Context, w http.ResponseWriter,
if err := pr.backend.CreateFromContext(ctx, r.Body, options); err != nil {
return err
}
//TODO: send progress bar
w.WriteHeader(http.StatusNoContent)
return nil
}
func (pr *pluginRouter) enablePlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
return pr.backend.Enable(vars["name"])
if err := httputils.ParseForm(r); err != nil {
return err
}
name := vars["name"]
timeout, err := strconv.Atoi(r.Form.Get("timeout"))
if err != nil {
return err
}
config := &types.PluginEnableConfig{Timeout: timeout}
return pr.backend.Enable(name, config)
}
func (pr *pluginRouter) disablePlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
return pr.backend.Disable(vars["name"])
if err := httputils.ParseForm(r); err != nil {
return err
}
name := vars["name"]
config := &types.PluginDisableConfig{
ForceDisable: httputils.BoolValue(r, "force"),
}
return pr.backend.Disable(name, config)
}
func (pr *pluginRouter) removePlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@ -77,26 +268,21 @@ func (pr *pluginRouter) removePlugin(ctx context.Context, w http.ResponseWriter,
func (pr *pluginRouter) pushPlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return errors.Wrap(err, "failed to parse form")
}
metaHeaders, authConfig := parseHeaders(r.Header)
w.Header().Set("Content-Type", "application/json")
output := ioutils.NewWriteFlusher(w)
if err := pr.backend.Push(ctx, vars["name"], metaHeaders, authConfig, output); err != nil {
if !output.Flushed() {
return err
}
metaHeaders := map[string][]string{}
for k, v := range r.Header {
if strings.HasPrefix(k, "X-Meta-") {
metaHeaders[k] = v
output.Write(streamformatter.NewJSONStreamFormatter().FormatError(err))
}
}
// Get X-Registry-Auth
authEncoded := r.Header.Get("X-Registry-Auth")
authConfig := &types.AuthConfig{}
if authEncoded != "" {
authJSON := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authEncoded))
if err := json.NewDecoder(authJSON).Decode(authConfig); err != nil {
authConfig = &types.AuthConfig{}
}
}
return pr.backend.Push(vars["name"], metaHeaders, authConfig)
return nil
}
func (pr *pluginRouter) setPlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

View file

@ -18,8 +18,8 @@ type Backend interface {
UnlockSwarm(req types.UnlockRequest) error
GetServices(basictypes.ServiceListOptions) ([]types.Service, error)
GetService(string) (types.Service, error)
CreateService(types.ServiceSpec, string) (string, error)
UpdateService(string, uint64, types.ServiceSpec, string, string) error
CreateService(types.ServiceSpec, string) (*basictypes.ServiceCreateResponse, error)
UpdateService(string, uint64, types.ServiceSpec, string, string) (*basictypes.ServiceUpdateResponse, error)
RemoveService(string) error
ServiceLogs(context.Context, string, *backend.ContainerLogsConfig, chan struct{}) error
GetNodes(basictypes.NodeListOptions) ([]types.Node, error)

View file

@ -1,9 +1,6 @@
package swarm
import (
"github.com/docker/docker/api/server/router"
"github.com/docker/docker/daemon"
)
import "github.com/docker/docker/api/server/router"
// swarmRouter is a router to talk with the build controller
type swarmRouter struct {
@ -12,14 +9,11 @@ type swarmRouter struct {
}
// NewRouter initializes a new build router
func NewRouter(d *daemon.Daemon, b Backend) router.Router {
func NewRouter(b Backend) router.Router {
r := &swarmRouter{
backend: b,
}
r.initRoutes()
if d.HasExperimental() {
r.addExperimentalRoutes()
}
return r
}
@ -28,12 +22,6 @@ func (sr *swarmRouter) Routes() []router.Route {
return sr.routes
}
func (sr *swarmRouter) addExperimentalRoutes() {
sr.routes = append(sr.routes,
router.Cancellable(router.NewGetRoute("/services/{id}/logs", sr.getServiceLogs)),
)
}
func (sr *swarmRouter) initRoutes() {
sr.routes = []router.Route{
router.NewPostRoute("/swarm/init", sr.initCluster),
@ -48,6 +36,7 @@ func (sr *swarmRouter) initRoutes() {
router.NewPostRoute("/services/create", sr.createService),
router.NewPostRoute("/services/{id}/update", sr.updateService),
router.NewDeleteRoute("/services/{id}", sr.removeService),
router.Experimental(router.Cancellable(router.NewGetRoute("/services/{id}/logs", sr.getServiceLogs))),
router.NewGetRoute("/nodes", sr.getNodes),
router.NewGetRoute("/nodes/{id}", sr.getNode),
router.NewDeleteRoute("/nodes/{id}", sr.removeNode),
@ -55,7 +44,7 @@ func (sr *swarmRouter) initRoutes() {
router.NewGetRoute("/tasks", sr.getTasks),
router.NewGetRoute("/tasks/{id}", sr.getTask),
router.NewGetRoute("/secrets", sr.getSecrets),
router.NewPostRoute("/secrets", sr.createSecret),
router.NewPostRoute("/secrets/create", sr.createSecret),
router.NewDeleteRoute("/secrets/{id}", sr.removeSecret),
router.NewGetRoute("/secrets/{id}", sr.getSecret),
router.NewPostRoute("/secrets/{id}/update", sr.updateSecret),

View file

@ -65,7 +65,8 @@ func (sr *swarmRouter) updateCluster(ctx context.Context, w http.ResponseWriter,
rawVersion := r.URL.Query().Get("version")
version, err := strconv.ParseUint(rawVersion, 10, 64)
if err != nil {
return fmt.Errorf("Invalid swarm version '%s': %s", rawVersion, err.Error())
err := fmt.Errorf("invalid swarm version '%s': %v", rawVersion, err)
return errors.NewBadRequestError(err)
}
var flags types.UpdateFlags
@ -73,7 +74,8 @@ func (sr *swarmRouter) updateCluster(ctx context.Context, w http.ResponseWriter,
if value := r.URL.Query().Get("rotateWorkerToken"); value != "" {
rot, err := strconv.ParseBool(value)
if err != nil {
return fmt.Errorf("invalid value for rotateWorkerToken: %s", value)
err := fmt.Errorf("invalid value for rotateWorkerToken: %s", value)
return errors.NewBadRequestError(err)
}
flags.RotateWorkerToken = rot
@ -82,7 +84,8 @@ func (sr *swarmRouter) updateCluster(ctx context.Context, w http.ResponseWriter,
if value := r.URL.Query().Get("rotateManagerToken"); value != "" {
rot, err := strconv.ParseBool(value)
if err != nil {
return fmt.Errorf("invalid value for rotateManagerToken: %s", value)
err := fmt.Errorf("invalid value for rotateManagerToken: %s", value)
return errors.NewBadRequestError(err)
}
flags.RotateManagerToken = rot
@ -91,7 +94,7 @@ func (sr *swarmRouter) updateCluster(ctx context.Context, w http.ResponseWriter,
if value := r.URL.Query().Get("rotateManagerUnlockKey"); value != "" {
rot, err := strconv.ParseBool(value)
if err != nil {
return fmt.Errorf("invalid value for rotateManagerUnlockKey: %s", value)
return errors.NewBadRequestError(fmt.Errorf("invalid value for rotateManagerUnlockKey: %s", value))
}
flags.RotateManagerUnlockKey = rot
@ -166,15 +169,13 @@ func (sr *swarmRouter) createService(ctx context.Context, w http.ResponseWriter,
// Get returns "" if the header does not exist
encodedAuth := r.Header.Get("X-Registry-Auth")
id, err := sr.backend.CreateService(service, encodedAuth)
resp, err := sr.backend.CreateService(service, encodedAuth)
if err != nil {
logrus.Errorf("Error creating service %s: %v", service.Name, err)
return err
}
return httputils.WriteJSON(w, http.StatusCreated, &basictypes.ServiceCreateResponse{
ID: id,
})
return httputils.WriteJSON(w, http.StatusCreated, resp)
}
func (sr *swarmRouter) updateService(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@ -186,7 +187,8 @@ func (sr *swarmRouter) updateService(ctx context.Context, w http.ResponseWriter,
rawVersion := r.URL.Query().Get("version")
version, err := strconv.ParseUint(rawVersion, 10, 64)
if err != nil {
return fmt.Errorf("Invalid service version '%s': %s", rawVersion, err.Error())
err := fmt.Errorf("invalid service version '%s': %v", rawVersion, err)
return errors.NewBadRequestError(err)
}
// Get returns "" if the header does not exist
@ -194,11 +196,12 @@ func (sr *swarmRouter) updateService(ctx context.Context, w http.ResponseWriter,
registryAuthFrom := r.URL.Query().Get("registryAuthFrom")
if err := sr.backend.UpdateService(vars["id"], version, service, encodedAuth, registryAuthFrom); err != nil {
resp, err := sr.backend.UpdateService(vars["id"], version, service, encodedAuth, registryAuthFrom)
if err != nil {
logrus.Errorf("Error updating service %s: %v", vars["id"], err)
return err
}
return nil
return httputils.WriteJSON(w, http.StatusOK, resp)
}
func (sr *swarmRouter) removeService(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@ -238,10 +241,6 @@ func (sr *swarmRouter) getServiceLogs(ctx context.Context, w http.ResponseWriter
OutStream: w,
}
if !logsConfig.Follow {
return fmt.Errorf("Bad parameters: Only follow mode is currently supported")
}
if logsConfig.Details {
return fmt.Errorf("Bad parameters: details is not currently supported")
}
@ -299,7 +298,8 @@ func (sr *swarmRouter) updateNode(ctx context.Context, w http.ResponseWriter, r
rawVersion := r.URL.Query().Get("version")
version, err := strconv.ParseUint(rawVersion, 10, 64)
if err != nil {
return fmt.Errorf("Invalid node version '%s': %s", rawVersion, err.Error())
err := fmt.Errorf("invalid node version '%s': %v", rawVersion, err)
return errors.NewBadRequestError(err)
}
if err := sr.backend.UpdateNode(vars["id"], version, node); err != nil {
@ -388,6 +388,7 @@ func (sr *swarmRouter) removeSecret(ctx context.Context, w http.ResponseWriter,
if err := sr.backend.RemoveSecret(vars["id"]); err != nil {
return err
}
w.WriteHeader(http.StatusNoContent)
return nil
}

View file

@ -16,7 +16,6 @@ import (
"github.com/docker/docker/api/types/registry"
timetypes "github.com/docker/docker/api/types/time"
"github.com/docker/docker/api/types/versions"
"github.com/docker/docker/api/types/versions/v1p24"
"github.com/docker/docker/pkg/ioutils"
"golang.org/x/net/context"
)
@ -42,16 +41,24 @@ func (s *systemRouter) getInfo(ctx context.Context, w http.ResponseWriter, r *ht
if versions.LessThan(httputils.VersionFromContext(ctx), "1.25") {
// TODO: handle this conversion in engine-api
oldInfo := &v1p24.Info{
InfoBase: info.InfoBase,
type oldInfo struct {
*types.Info
ExecutionDriver string
}
old := &oldInfo{
Info: info,
ExecutionDriver: "<not supported>",
}
for _, s := range info.SecurityOptions {
if s.Key == "Name" {
oldInfo.SecurityOptions = append(oldInfo.SecurityOptions, s.Value)
nameOnlySecurityOptions := []string{}
kvSecOpts, err := types.DecodeSecurityOptions(old.SecurityOptions)
if err != nil {
return err
}
for _, s := range kvSecOpts {
nameOnlySecurityOptions = append(nameOnlySecurityOptions, s.Name)
}
return httputils.WriteJSON(w, http.StatusOK, oldInfo)
old.SecurityOptions = nameOnlySecurityOptions
return httputils.WriteJSON(w, http.StatusOK, old)
}
return httputils.WriteJSON(w, http.StatusOK, info)
}

View file

@ -3,6 +3,7 @@ package volume
import (
// TODO return types need to be refactored into pkg
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
)
// Backend is the methods that need to be implemented to provide
@ -12,5 +13,5 @@ type Backend interface {
VolumeInspect(name string) (*types.Volume, error)
VolumeCreate(name, driverName string, opts, labels map[string]string) (*types.Volume, error)
VolumeRm(name string, force bool) error
VolumesPrune(config *types.VolumesPruneConfig) (*types.VolumesPruneReport, error)
VolumesPrune(pruneFilters filters.Args) (*types.VolumesPruneReport, error)
}

View file

@ -5,7 +5,7 @@ import (
"net/http"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
volumetypes "github.com/docker/docker/api/types/volume"
"golang.org/x/net/context"
)
@ -72,16 +72,7 @@ func (v *volumeRouter) postVolumesPrune(ctx context.Context, w http.ResponseWrit
return err
}
if err := httputils.CheckForJSON(r); err != nil {
return err
}
var cfg types.VolumesPruneConfig
if err := json.NewDecoder(r.Body).Decode(&cfg); err != nil {
return err
}
pruneReport, err := v.backend.VolumesPrune(&cfg)
pruneReport, err := v.backend.VolumesPrune(filters.Args{})
if err != nil {
return err
}

View file

@ -102,7 +102,7 @@ func (s *Server) serveAPI() error {
}
// HTTPServer contains an instance of http server and the listener.
// srv *http.Server, contains configuration to create a http server and a mux router with all api end points.
// srv *http.Server, contains configuration to create an http server and a mux router with all api end points.
// l net.Listener, is a TCP or Socket listener that dispatches incoming request to the router.
type HTTPServer struct {
srv *http.Server
@ -137,7 +137,12 @@ func (s *Server) makeHTTPHandler(handler httputils.APIFunc) http.HandlerFunc {
}
if err := handlerFunc(ctx, w, r, vars); err != nil {
logrus.Errorf("Handler for %s %s returned error: %v", r.Method, r.URL.Path, err)
statusCode := httputils.GetHTTPErrorStatusCode(err)
errFormat := "%v"
if statusCode == http.StatusInternalServerError {
errFormat = "%+v"
}
logrus.Errorf("Handler for %s %s returned error: "+errFormat, r.Method, r.URL.Path, err)
httputils.MakeErrorHandler(err)(w, r)
}
}

File diff suppressed because it is too large Load diff

View file

@ -160,7 +160,10 @@ type ImageBuildOptions struct {
ShmSize int64
Dockerfile string
Ulimits []*units.Ulimit
BuildArgs map[string]string
// See the parsing of buildArgs in api/server/router/build/build_routes.go
// for an explaination of why BuildArgs needs to use *string instead of
// just a string
BuildArgs map[string]*string
AuthConfigs map[string]AuthConfig
Context io.Reader
Labels map[string]string
@ -289,6 +292,8 @@ type ServiceCreateOptions struct {
type ServiceCreateResponse struct {
// ID is the ID of the created service.
ID string
// Warnings is a set of non-fatal warning messages to pass on to the user.
Warnings []string `json:",omitempty"`
}
// Values for RegistryAuthFrom in ServiceUpdateOptions
@ -330,11 +335,22 @@ type PluginRemoveOptions struct {
Force bool
}
// PluginEnableOptions holds parameters to enable plugins.
type PluginEnableOptions struct {
Timeout int
}
// PluginDisableOptions holds parameters to disable plugins.
type PluginDisableOptions struct {
Force bool
}
// PluginInstallOptions holds parameters to install a plugin.
type PluginInstallOptions struct {
Disabled bool
AcceptAllPermissions bool
RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry
RemoteRef string // RemoteRef is the plugin name on the registry
PrivilegeFunc RequestPrivilegeFunc
AcceptPermissionsFunc func(PluginPrivileges) (bool, error)
Args []string
@ -349,7 +365,7 @@ type SecretRequestOption struct {
Mode os.FileMode
}
// SwarmUnlockKeyResponse contains the response for Remote API:
// SwarmUnlockKeyResponse contains the response for Engine API:
// GET /swarm/unlockkey
type SwarmUnlockKeyResponse struct {
// UnlockKey is the unlock key in ASCII-armored format.

View file

@ -53,9 +53,17 @@ type ExecConfig struct {
Cmd []string // Execution commands and args
}
// PluginRmConfig holds arguments for the plugin remove
// operation. This struct is used to tell the backend what operations
// to perform.
// PluginRmConfig holds arguments for plugin remove.
type PluginRmConfig struct {
ForceRemove bool
}
// PluginEnableConfig holds arguments for plugin enable
type PluginEnableConfig struct {
Timeout int
}
// PluginDisableConfig holds arguments for plugin disable.
type PluginDisableConfig struct {
ForceDisable bool
}

View file

@ -40,7 +40,7 @@ type Config struct {
AttachStdin bool // Attach the standard input, makes possible user interaction
AttachStdout bool // Attach the standard output
AttachStderr bool // Attach the standard error
ExposedPorts map[nat.Port]struct{} `json:",omitempty"` // List of exposed ports
ExposedPorts nat.PortSet `json:",omitempty"` // List of exposed ports
Tty bool // Attach standard streams to a tty, including stdin if it is not closed.
OpenStdin bool // Open stdin
StdinOnce bool // If true, close stdin after the 1 attached client disconnects.

View file

@ -1,14 +0,0 @@
package container
import "os"
// ContainerSecret represents a secret in a container. This gets realized
// in the container tmpfs
type ContainerSecret struct {
Name string
Target string
Data []byte
UID string
GID string
Mode os.FileMode
}

View file

@ -144,6 +144,9 @@ func (filters Args) Add(name, value string) {
func (filters Args) Del(name, value string) {
if _, ok := filters.fields[name]; ok {
delete(filters.fields[name], value)
if len(filters.fields[name]) == 0 {
delete(filters.fields, name)
}
}
}

View file

@ -50,6 +50,16 @@ const (
PropagationSlave Propagation = "slave"
)
// Propagations is the list of all valid mount propagations
var Propagations = []Propagation{
PropagationRPrivate,
PropagationPrivate,
PropagationRShared,
PropagationShared,
PropagationRSlave,
PropagationSlave,
}
// BindOptions defines options specific to mounts of type "bind".
type BindOptions struct {
Propagation Propagation `json:",omitempty"`

View file

@ -3,7 +3,7 @@ package types
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// Plugin A plugin for the Remote API
// Plugin A plugin for the Engine API
// swagger:model Plugin
type Plugin struct {
@ -22,13 +22,12 @@ type Plugin struct {
// Required: true
Name string `json:"Name"`
// plugin remote reference used to push/pull the plugin
PluginReference string `json:"PluginReference,omitempty"`
// settings
// Required: true
Settings PluginSettings `json:"Settings"`
// tag
// Required: true
Tag string `json:"Tag"`
}
// PluginConfig The config of a plugin.
@ -39,18 +38,10 @@ type PluginConfig struct {
// Required: true
Args PluginConfigArgs `json:"Args"`
// capabilities
// Required: true
Capabilities []string `json:"Capabilities"`
// description
// Required: true
Description string `json:"Description"`
// devices
// Required: true
Devices []PluginDevice `json:"Devices"`
// documentation
// Required: true
Documentation string `json:"Documentation"`
@ -67,6 +58,10 @@ type PluginConfig struct {
// Required: true
Interface PluginConfigInterface `json:"Interface"`
// linux
// Required: true
Linux PluginConfigLinux `json:"Linux"`
// mounts
// Required: true
Mounts []PluginMount `json:"Mounts"`
@ -75,12 +70,19 @@ type PluginConfig struct {
// Required: true
Network PluginConfigNetwork `json:"Network"`
// propagated mount
// Required: true
PropagatedMount string `json:"PropagatedMount"`
// user
User PluginConfigUser `json:"User,omitempty"`
// workdir
// work dir
// Required: true
Workdir string `json:"Workdir"`
WorkDir string `json:"WorkDir"`
// rootfs
Rootfs *PluginConfigRootfs `json:"rootfs,omitempty"`
}
// PluginConfigArgs plugin config args
@ -117,6 +119,23 @@ type PluginConfigInterface struct {
Types []PluginInterfaceType `json:"Types"`
}
// PluginConfigLinux plugin config linux
// swagger:model PluginConfigLinux
type PluginConfigLinux struct {
// allow all devices
// Required: true
AllowAllDevices bool `json:"AllowAllDevices"`
// capabilities
// Required: true
Capabilities []string `json:"Capabilities"`
// devices
// Required: true
Devices []PluginDevice `json:"Devices"`
}
// PluginConfigNetwork plugin config network
// swagger:model PluginConfigNetwork
type PluginConfigNetwork struct {
@ -126,6 +145,17 @@ type PluginConfigNetwork struct {
Type string `json:"Type"`
}
// PluginConfigRootfs plugin config rootfs
// swagger:model PluginConfigRootfs
type PluginConfigRootfs struct {
// diff ids
DiffIds []string `json:"diff_ids"`
// type
Type string `json:"type,omitempty"`
}
// PluginConfigUser plugin config user
// swagger:model PluginConfigUser
type PluginConfigUser struct {

View file

@ -5,7 +5,7 @@ import (
"fmt"
)
// PluginsListResponse contains the response for the remote API
// PluginsListResponse contains the response for the Engine API
type PluginsListResponse []*Plugin
const (

View file

@ -0,0 +1,12 @@
package types
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// ServiceUpdateResponse service update response
// swagger:model ServiceUpdateResponse
type ServiceUpdateResponse struct {
// Optional warning messages
Warnings []string `json:"Warnings"`
}

View file

@ -19,3 +19,9 @@ type Annotations struct {
Name string `json:",omitempty"`
Labels map[string]string `json:",omitempty"`
}
// Driver represents a driver (network, logging).
type Driver struct {
Name string `json:",omitempty"`
Options map[string]string `json:",omitempty"`
}

View file

@ -109,9 +109,3 @@ type IPAMConfig struct {
Range string `json:",omitempty"`
Gateway string `json:",omitempty"`
}
// Driver represents a network driver.
type Driver struct {
Name string `json:",omitempty"`
Options map[string]string `json:",omitempty"`
}

View file

@ -7,8 +7,6 @@ type Secret struct {
ID string
Meta
Spec SecretSpec
Digest string
SecretSize int64
}
// SecretSpec represents a secret specification from a secret in swarm
@ -27,7 +25,7 @@ type SecretReferenceFileTarget struct {
// SecretReference is a reference to a secret in swarm
type SecretReference struct {
File *SecretReferenceFileTarget
SecretID string
SecretName string
Target *SecretReferenceFileTarget
}

View file

@ -74,7 +74,7 @@ const (
type UpdateConfig struct {
// Maximum number of tasks to be updated in one iteration.
// 0 means unlimited parallelism.
Parallelism uint64 `json:",omitempty"`
Parallelism uint64
// Amount of time between updates.
Delay time.Duration `json:",omitempty"`

View file

@ -1,8 +1,11 @@
package types
import (
"errors"
"fmt"
"io"
"os"
"strings"
"time"
"github.com/docker/docker/api/types/container"
@ -14,14 +17,14 @@ import (
"github.com/docker/go-connections/nat"
)
// ContainerChange contains response of Remote API:
// ContainerChange contains response of Engine API:
// GET "/containers/{name:.*}/changes"
type ContainerChange struct {
Kind int
Path string
}
// ImageHistory contains response of Remote API:
// ImageHistory contains response of Engine API:
// GET "/images/{name:.*}/history"
type ImageHistory struct {
ID string `json:"Id"`
@ -32,7 +35,7 @@ type ImageHistory struct {
Comment string
}
// ImageDelete contains response of Remote API:
// ImageDelete contains response of Engine API:
// DELETE "/images/{name:.*}"
type ImageDelete struct {
Untagged string `json:",omitempty"`
@ -53,7 +56,7 @@ type RootFS struct {
BaseLayer string `json:",omitempty"`
}
// ImageInspect contains response of Remote API:
// ImageInspect contains response of Engine API:
// GET "/images/{name:.*}/json"
type ImageInspect struct {
ID string `json:"Id"`
@ -76,7 +79,7 @@ type ImageInspect struct {
RootFS RootFS
}
// Container contains response of Remote API:
// Container contains response of Engine API:
// GET "/containers/json"
type Container struct {
ID string `json:"Id"`
@ -98,7 +101,7 @@ type Container struct {
Mounts []MountPoint
}
// CopyConfig contains request body of Remote API:
// CopyConfig contains request body of Engine API:
// POST "/containers/"+containerID+"/copy"
type CopyConfig struct {
Resource string
@ -115,28 +118,28 @@ type ContainerPathStat struct {
LinkTarget string `json:"linkTarget"`
}
// ContainerStats contains response of Remote API:
// ContainerStats contains response of Engine API:
// GET "/stats"
type ContainerStats struct {
Body io.ReadCloser `json:"body"`
OSType string `json:"ostype"`
}
// ContainerProcessList contains response of Remote API:
// ContainerProcessList contains response of Engine API:
// GET "/containers/{name:.*}/top"
type ContainerProcessList struct {
Processes [][]string
Titles []string
}
// Ping contains response of Remote API:
// Ping contains response of Engine API:
// GET "/_ping"
type Ping struct {
APIVersion string
Experimental bool
}
// Version contains response of Remote API:
// Version contains response of Engine API:
// GET "/version"
type Version struct {
Version string
@ -158,9 +161,9 @@ type Commit struct {
Expected string
}
// InfoBase contains the base response of Remote API:
// Info contains response of Engine API:
// GET "/info"
type InfoBase struct {
type Info struct {
ID string
Containers int
ContainersRunning int
@ -219,18 +222,49 @@ type InfoBase struct {
ContainerdCommit Commit
RuncCommit Commit
InitCommit Commit
SecurityOptions []string
}
// SecurityOpt holds key/value pair about a security option
type SecurityOpt struct {
// KeyValue holds a key/value pair
type KeyValue struct {
Key, Value string
}
// Info contains response of Remote API:
// GET "/info"
type Info struct {
*InfoBase
SecurityOptions []SecurityOpt
// SecurityOpt contains the name and options of a security option
type SecurityOpt struct {
Name string
Options []KeyValue
}
// DecodeSecurityOptions decodes a security options string slice to a type safe
// SecurityOpt
func DecodeSecurityOptions(opts []string) ([]SecurityOpt, error) {
so := []SecurityOpt{}
for _, opt := range opts {
// support output from a < 1.13 docker daemon
if !strings.Contains(opt, "=") {
so = append(so, SecurityOpt{Name: opt})
continue
}
secopt := SecurityOpt{}
split := strings.Split(opt, ",")
for _, s := range split {
kv := strings.SplitN(s, "=", 2)
if len(kv) != 2 {
return nil, fmt.Errorf("invalid security option %q", s)
}
if kv[0] == "" || kv[1] == "" {
return nil, errors.New("invalid empty security option")
}
if kv[0] == "name" {
secopt.Name = kv[1]
continue
}
secopt.Options = append(secopt.Options, KeyValue{Key: kv[0], Value: kv[1]})
}
so = append(so, secopt)
}
return so, nil
}
// PluginsInfo is a temp struct holding Plugins name
@ -305,7 +339,7 @@ type ContainerNode struct {
Labels map[string]string
}
// ContainerJSONBase contains response of Remote API:
// ContainerJSONBase contains response of Engine API:
// GET "/containers/{name:.*}/json"
type ContainerJSONBase struct {
ID string `json:"Id"`
@ -466,7 +500,7 @@ type Runtime struct {
Args []string `json:"runtimeArgs,omitempty"`
}
// DiskUsage contains response of Remote API:
// DiskUsage contains response of Engine API:
// GET "/system/df"
type DiskUsage struct {
LayersSize int64
@ -475,49 +509,28 @@ type DiskUsage struct {
Volumes []*Volume
}
// ImagesPruneConfig contains the configuration for Remote API:
// POST "/images/prune"
type ImagesPruneConfig struct {
DanglingOnly bool
}
// ContainersPruneConfig contains the configuration for Remote API:
// POST "/images/prune"
type ContainersPruneConfig struct {
}
// VolumesPruneConfig contains the configuration for Remote API:
// POST "/images/prune"
type VolumesPruneConfig struct {
}
// NetworksPruneConfig contains the configuration for Remote API:
// POST "/networks/prune"
type NetworksPruneConfig struct {
}
// ContainersPruneReport contains the response for Remote API:
// ContainersPruneReport contains the response for Engine API:
// POST "/containers/prune"
type ContainersPruneReport struct {
ContainersDeleted []string
SpaceReclaimed uint64
}
// VolumesPruneReport contains the response for Remote API:
// VolumesPruneReport contains the response for Engine API:
// POST "/volumes/prune"
type VolumesPruneReport struct {
VolumesDeleted []string
SpaceReclaimed uint64
}
// ImagesPruneReport contains the response for Remote API:
// ImagesPruneReport contains the response for Engine API:
// POST "/images/prune"
type ImagesPruneReport struct {
ImagesDeleted []ImageDelete
SpaceReclaimed uint64
}
// NetworksPruneReport contains the response for Remote API:
// NetworksPruneReport contains the response for Engine API:
// POST "/networks/prune"
type NetworksPruneReport struct {
NetworksDeleted []string

View file

@ -1,10 +0,0 @@
// Package v1p24 provides specific API types for the API version 1, patch 24.
package v1p24
import "github.com/docker/docker/api/types"
type Info struct {
*types.InfoBase
ExecutionDriver string
SecurityOptions []string
}

View file

@ -11,7 +11,7 @@ type Volume struct {
// Required: true
Driver string `json:"Driver"`
// A mapping of abitrary key/value data set on this volume.
// User-defined key/value metadata.
// Required: true
Labels map[string]string `json:"Labels"`

View file

@ -19,7 +19,7 @@ type VolumesCreateBody struct {
// Required: true
DriverOpts map[string]string `json:"DriverOpts"`
// A mapping of arbitrary key/value data to set on the volume.
// User-defined key/value metadata.
// Required: true
Labels map[string]string `json:"Labels"`

View file

@ -116,7 +116,7 @@ type Backend interface {
// ContainerAttachRaw attaches to container.
ContainerAttachRaw(cID string, stdin io.ReadCloser, stdout, stderr io.Writer, stream bool) error
// ContainerCreate creates a new Docker container and returns potential warnings
ContainerCreate(config types.ContainerCreateConfig, validateHostname bool) (container.ContainerCreateCreatedBody, error)
ContainerCreate(config types.ContainerCreateConfig) (container.ContainerCreateCreatedBody, error)
// ContainerRm removes a container specified by `id`.
ContainerRm(name string, config *types.ContainerRmConfig) error
// Commit creates a new Docker image from an existing Docker container.
@ -124,11 +124,13 @@ type Backend interface {
// ContainerKill stops the container execution abruptly.
ContainerKill(containerID string, sig uint64) error
// ContainerStart starts a new container
ContainerStart(containerID string, hostConfig *container.HostConfig, validateHostname bool, checkpoint string, checkpointDir string) error
ContainerStart(containerID string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error
// ContainerWait stops processing until the given container is stopped.
ContainerWait(containerID string, timeout time.Duration) (int, error)
// ContainerUpdateCmdOnBuild updates container.Path and container.Args
ContainerUpdateCmdOnBuild(containerID string, cmd []string) error
// ContainerCreateWorkdir creates the workdir (currently only used on Windows)
ContainerCreateWorkdir(containerID string) error
// ContainerCopy copies/extracts a source FileInfo to a destination path inside a container
// specified by a container object.

View file

@ -125,7 +125,7 @@ func NewBuilder(clientCtx context.Context, config *types.ImageBuildOptions, back
config = new(types.ImageBuildOptions)
}
if config.BuildArgs == nil {
config.BuildArgs = make(map[string]string)
config.BuildArgs = make(map[string]*string)
}
ctx, cancel := context.WithCancel(clientCtx)
b = &Builder{

View file

@ -18,6 +18,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/strslice"
"github.com/docker/docker/builder"
@ -70,14 +71,20 @@ func env(b *Builder, args []string, attributes map[string]bool, original string)
if len(args[j]) == 0 {
return errBlankCommandNames("ENV")
}
newVar := args[j] + "=" + args[j+1] + ""
commitStr += " " + newVar
gotOne := false
for i, envVar := range b.runConfig.Env {
envParts := strings.SplitN(envVar, "=", 2)
if envParts[0] == args[j] {
compareFrom := envParts[0]
compareTo := args[j]
if runtime.GOOS == "windows" {
// Case insensitive environment variables on Windows
compareFrom = strings.ToUpper(compareFrom)
compareTo = strings.ToUpper(compareTo)
}
if compareFrom == compareTo {
b.runConfig.Env[i] = newVar
gotOne = true
break
@ -279,12 +286,39 @@ func workdir(b *Builder, args []string, attributes map[string]bool, original str
return err
}
// NOTE: You won't find the "mkdir" for the directory in here. Rather we
// just set the value in the image's runConfig.WorkingDir property
// and container.SetupWorkingDirectory() will create it automatically
// for us the next time the image is used to create a container.
// For performance reasons, we explicitly do a create/mkdir now
// This avoids having an unnecessary expensive mount/unmount calls
// (on Windows in particular) during each container create.
// Prior to 1.13, the mkdir was deferred and not executed at this step.
if b.disableCommit {
// Don't call back into the daemon if we're going through docker commit --change "WORKDIR /foo".
// We've already updated the runConfig and that's enough.
return nil
}
b.runConfig.Image = b.image
return b.commit("", b.runConfig.Cmd, fmt.Sprintf("WORKDIR %v", b.runConfig.WorkingDir))
cmd := b.runConfig.Cmd
comment := "WORKDIR " + b.runConfig.WorkingDir
// reset the command for cache detection
b.runConfig.Cmd = strslice.StrSlice(append(getShell(b.runConfig), "#(nop) "+comment))
defer func(cmd strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
if hit, err := b.probeCache(); err != nil {
return err
} else if hit {
return nil
}
container, err := b.docker.ContainerCreate(types.ContainerCreateConfig{Config: b.runConfig})
if err != nil {
return err
}
b.tmpContainers[container.ID] = struct{}{}
if err := b.docker.ContainerCreateWorkdir(container.ID); err != nil {
return err
}
return b.commit(container.ID, cmd, comment)
}
// RUN some command yo
@ -352,8 +386,8 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
// the entire file (see 'leftoverArgs' processing in evaluator.go )
continue
}
if _, ok := configEnv[key]; !ok {
cmdBuildEnv = append(cmdBuildEnv, fmt.Sprintf("%s=%s", key, val))
if _, ok := configEnv[key]; !ok && val != nil {
cmdBuildEnv = append(cmdBuildEnv, fmt.Sprintf("%s=%s", key, *val))
}
}
@ -696,7 +730,7 @@ func arg(b *Builder, args []string, attributes map[string]bool, original string)
var (
name string
value string
newValue string
hasDefault bool
)
@ -713,7 +747,7 @@ func arg(b *Builder, args []string, attributes map[string]bool, original string)
}
name = parts[0]
value = parts[1]
newValue = parts[1]
hasDefault = true
} else {
name = arg
@ -724,9 +758,12 @@ func arg(b *Builder, args []string, attributes map[string]bool, original string)
// If there is a default value associated with this arg then add it to the
// b.buildArgs if one is not already passed to the builder. The args passed
// to builder override the default value of 'arg'.
if _, ok := b.options.BuildArgs[name]; !ok && hasDefault {
b.options.BuildArgs[name] = value
// to builder override the default value of 'arg'. Note that a 'nil' for
// a value means that the user specified "--build-arg FOO" and "FOO" wasn't
// defined as an env var - and in that case we DO want to use the default
// value specified in the ARG cmd.
if baValue, ok := b.options.BuildArgs[name]; (!ok || baValue == nil) && hasDefault {
b.options.BuildArgs[name] = &newValue
}
return b.commit("", b.runConfig.Cmd, fmt.Sprintf("ARG %s", arg))

View file

@ -460,7 +460,7 @@ func TestStopSignal(t *testing.T) {
}
func TestArg(t *testing.T) {
buildOptions := &types.ImageBuildOptions{BuildArgs: make(map[string]string)}
buildOptions := &types.ImageBuildOptions{BuildArgs: make(map[string]*string)}
b := &Builder{flags: &BFlags{}, runConfig: &container.Config{}, disableCommit: true, allowedBuildArgs: make(map[string]bool), options: buildOptions}
@ -488,7 +488,7 @@ func TestArg(t *testing.T) {
t.Fatalf("%s argument should be a build arg", argName)
}
if val != "bar" {
if *val != "bar" {
t.Fatalf("%s argument should have default value 'bar', got %s", argName, val)
}
}

View file

@ -1,112 +1,116 @@
hello | hello
he'll'o | hello
he'llo | hello
he\'llo | he'llo
he\\'llo | he\llo
abc\tdef | abctdef
"abc\tdef" | abc\tdef
'abc\tdef' | abc\tdef
hello\ | hello
hello\\ | hello\
"hello | hello
"hello\" | hello"
"hel'lo" | hel'lo
'hello | hello
'hello\' | hello\
"''" | ''
$. | $.
$1 |
he$1x | hex
he$.x | he$.x
he$pwd. | he.
he$PWD | he/home
he\$PWD | he$PWD
he\\$PWD | he\/home
he\${} | he${}
he\${}xx | he${}xx
he${} | he
he${}xx | hexx
he${hi} | he
he${hi}xx | hexx
he${PWD} | he/home
he${.} | error
he${XXX:-000}xx | he000xx
he${PWD:-000}xx | he/homexx
he${XXX:-$PWD}xx | he/homexx
he${XXX:-${PWD:-yyy}}xx | he/homexx
he${XXX:-${YYY:-yyy}}xx | heyyyxx
he${XXX:YYY} | error
he${XXX:+${PWD}}xx | hexx
he${PWD:+${XXX}}xx | hexx
he${PWD:+${SHELL}}xx | hebashxx
he${XXX:+000}xx | hexx
he${PWD:+000}xx | he000xx
'he${XX}' | he${XX}
"he${PWD}" | he/home
"he'$PWD'" | he'/home'
"$PWD" | /home
'$PWD' | $PWD
'\$PWD' | \$PWD
'"hello"' | "hello"
he\$PWD | he$PWD
"he\$PWD" | he$PWD
'he\$PWD' | he\$PWD
he${PWD | error
he${PWD:=000}xx | error
he${PWD:+${PWD}:}xx | he/home:xx
he${XXX:-\$PWD:}xx | he$PWD:xx
he${XXX:-\${PWD}z}xx | he${PWDz}xx
안녕하세요 | 안녕하세요
안'녕'하세요 | 안녕하세요
안'녕하세요 | 안녕하세요
안녕\'하세요 | 안녕'하세요
안\\'녕하세요 | 안\녕하세요
안녕\t하세요 | 안녕t하세요
"안녕\t하세요" | 안녕\t하세요
'안녕\t하세요 | 안녕\t하세요
안녕하세요\ | 안녕하세요
안녕하세요\\ | 안녕하세요\
"안녕하세요 | 안녕하세요
"안녕하세요\" | 안녕하세요"
"안녕'하세요" | 안녕'하세요
'안녕하세요 | 안녕하세요
'안녕하세요\' | 안녕하세요\
안녕$1x | 안녕x
안녕$.x | 안녕$.x
안녕$pwd. | 안녕.
안녕$PWD | 안녕/home
안녕\$PWD | 안녕$PWD
안녕\\$PWD | 안녕\/home
안녕\${} | 안녕${}
안녕\${}xx | 안녕${}xx
안녕${} | 안녕
안녕${}xx | 안녕xx
안녕${hi} | 안녕
안녕${hi}xx | 안녕xx
안녕${PWD} | 안녕/home
안녕${.} | error
안녕${XXX:-000}xx | 안녕000xx
안녕${PWD:-000}xx | 안녕/homexx
안녕${XXX:-$PWD}xx | 안녕/homexx
안녕${XXX:-${PWD:-yyy}}xx | 안녕/homexx
안녕${XXX:-${YYY:-yyy}}xx | 안녕yyyxx
안녕${XXX:YYY} | error
안녕${XXX:+${PWD}}xx | 안녕xx
안녕${PWD:+${XXX}}xx | 안녕xx
안녕${PWD:+${SHELL}}xx | 안녕bashxx
안녕${XXX:+000}xx | 안녕xx
안녕${PWD:+000}xx | 안녕000xx
'안녕${XX}' | 안녕${XX}
"안녕${PWD}" | 안녕/home
"안녕'$PWD'" | 안녕'/home'
'"안녕"' | "안녕"
안녕\$PWD | 안녕$PWD
"안녕\$PWD" | 안녕$PWD
'안녕\$PWD' | 안녕\$PWD
안녕${PWD | error
안녕${PWD:=000}xx | error
안녕${PWD:+${PWD}:}xx | 안녕/home:xx
안녕${XXX:-\$PWD:}xx | 안녕$PWD:xx
안녕${XXX:-\${PWD}z}xx | 안녕${PWDz}xx
$KOREAN | 한국어
안녕$KOREAN | 안녕한국어
A|hello | hello
A|he'll'o | hello
A|he'llo | hello
A|he\'llo | he'llo
A|he\\'llo | he\llo
A|abc\tdef | abctdef
A|"abc\tdef" | abc\tdef
A|'abc\tdef' | abc\tdef
A|hello\ | hello
A|hello\\ | hello\
A|"hello | hello
A|"hello\" | hello"
A|"hel'lo" | hel'lo
A|'hello | hello
A|'hello\' | hello\
A|"''" | ''
A|$. | $.
A|$1 |
A|he$1x | hex
A|he$.x | he$.x
# Next one is different on Windows as $pwd==$PWD
U|he$pwd. | he.
W|he$pwd. | he/home.
A|he$PWD | he/home
A|he\$PWD | he$PWD
A|he\\$PWD | he\/home
A|he\${} | he${}
A|he\${}xx | he${}xx
A|he${} | he
A|he${}xx | hexx
A|he${hi} | he
A|he${hi}xx | hexx
A|he${PWD} | he/home
A|he${.} | error
A|he${XXX:-000}xx | he000xx
A|he${PWD:-000}xx | he/homexx
A|he${XXX:-$PWD}xx | he/homexx
A|he${XXX:-${PWD:-yyy}}xx | he/homexx
A|he${XXX:-${YYY:-yyy}}xx | heyyyxx
A|he${XXX:YYY} | error
A|he${XXX:+${PWD}}xx | hexx
A|he${PWD:+${XXX}}xx | hexx
A|he${PWD:+${SHELL}}xx | hebashxx
A|he${XXX:+000}xx | hexx
A|he${PWD:+000}xx | he000xx
A|'he${XX}' | he${XX}
A|"he${PWD}" | he/home
A|"he'$PWD'" | he'/home'
A|"$PWD" | /home
A|'$PWD' | $PWD
A|'\$PWD' | \$PWD
A|'"hello"' | "hello"
A|he\$PWD | he$PWD
A|"he\$PWD" | he$PWD
A|'he\$PWD' | he\$PWD
A|he${PWD | error
A|he${PWD:=000}xx | error
A|he${PWD:+${PWD}:}xx | he/home:xx
A|he${XXX:-\$PWD:}xx | he$PWD:xx
A|he${XXX:-\${PWD}z}xx | he${PWDz}xx
A|안녕하세요 | 안녕하세요
A|안'녕'하세요 | 안녕하세요
A|안'녕하세요 | 안녕하세요
A|안녕\'하세요 | 안녕'하세요
A|안\\'녕하세요 | 안\녕하세요
A|안녕\t하세요 | 안녕t하세요
A|"안녕\t하세요" | 안녕\t하세요
A|'안녕\t하세요 | 안녕\t하세요
A|안녕하세요\ | 안녕하세요
A|안녕하세요\\ | 안녕하세요\
A|"안녕하세요 | 안녕하세요
A|"안녕하세요\" | 안녕하세요"
A|"안녕'하세요" | 안녕'하세요
A|'안녕하세요 | 안녕하세요
A|'안녕하세요\' | 안녕하세요\
A|안녕$1x | 안녕x
A|안녕$.x | 안녕$.x
# Next one is different on Windows as $pwd==$PWD
U|안녕$pwd. | 안녕.
W|안녕$pwd. | 안녕/home.
A|안녕$PWD | 안녕/home
A|안녕\$PWD | 안녕$PWD
A|안녕\\$PWD | 안녕\/home
A|안녕\${} | 안녕${}
A|안녕\${}xx | 안녕${}xx
A|안녕${} | 안녕
A|안녕${}xx | 안녕xx
A|안녕${hi} | 안녕
A|안녕${hi}xx | 안녕xx
A|안녕${PWD} | 안녕/home
A|안녕${.} | error
A|안녕${XXX:-000}xx | 안녕000xx
A|안녕${PWD:-000}xx | 안녕/homexx
A|안녕${XXX:-$PWD}xx | 안녕/homexx
A|안녕${XXX:-${PWD:-yyy}}xx | 안녕/homexx
A|안녕${XXX:-${YYY:-yyy}}xx | 안녕yyyxx
A|안녕${XXX:YYY} | error
A|안녕${XXX:+${PWD}}xx | 안녕xx
A|안녕${PWD:+${XXX}}xx | 안녕xx
A|안녕${PWD:+${SHELL}}xx | 안녕bashxx
A|안녕${XXX:+000}xx | 안녕xx
A|안녕${PWD:+000}xx | 안녕000xx
A|'안녕${XX}' | 안녕${XX}
A|"안녕${PWD}" | 안녕/home
A|"안녕'$PWD'" | 안녕'/home'
A|'"안녕"' | "안녕"
A|안녕\$PWD | 안녕$PWD
A|"안녕\$PWD" | 안녕$PWD
A|'안녕\$PWD' | 안녕\$PWD
A|안녕${PWD | error
A|안녕${PWD:=000}xx | error
A|안녕${PWD:+${PWD}:}xx | 안녕/home:xx
A|안녕${XXX:-\$PWD:}xx | 안녕$PWD:xx
A|안녕${XXX:-\${PWD}z}xx | 안녕${PWDz}xx
A|$KOREAN | 한국어
A|안녕$KOREAN | 안녕한국어

View file

@ -158,7 +158,7 @@ func (b *Builder) dispatch(stepN int, stepTotal int, ast *parser.Node) error {
// the entire file (see 'leftoverArgs' processing in evaluator.go )
continue
}
envs = append(envs, fmt.Sprintf("%s=%s", key, val))
envs = append(envs, fmt.Sprintf("%s=%s", key, *val))
}
for ast.Next != nil {
ast = ast.Next

View file

@ -6,7 +6,7 @@ import "fmt"
// a command not supported on the platform.
func platformSupports(command string) error {
switch command {
case "user", "stopsignal":
case "stopsignal":
return fmt.Errorf("The daemon on this platform does not support the command '%s'", command)
}
return nil

View file

@ -180,7 +180,7 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowLocalD
return nil
}
container, err := b.docker.ContainerCreate(types.ContainerCreateConfig{Config: b.runConfig}, true)
container, err := b.docker.ContainerCreate(types.ContainerCreateConfig{Config: b.runConfig})
if err != nil {
return err
}
@ -496,7 +496,7 @@ func (b *Builder) create() (string, error) {
c, err := b.docker.ContainerCreate(types.ContainerCreateConfig{
Config: b.runConfig,
HostConfig: hostConfig,
}, true)
})
if err != nil {
return "", err
}
@ -537,7 +537,7 @@ func (b *Builder) run(cID string) (err error) {
}
}()
if err := b.docker.ContainerStart(cID, nil, true, "", ""); err != nil {
if err := b.docker.ContainerStart(cID, nil, "", ""); err != nil {
close(finished)
if cancelErr := <-cancelErrCh; cancelErr != nil {
logrus.Debugf("Build cancelled (%v) and got an error from ContainerStart: %v",

View file

@ -61,7 +61,7 @@ func SetEscapeToken(s string, d *Directive) error {
return fmt.Errorf("invalid ESCAPE '%s'. Must be ` or \\", s)
}
d.EscapeToken = rune(s[0])
d.LineContinuationRegex = regexp.MustCompile(`\` + s + `$`)
d.LineContinuationRegex = regexp.MustCompile(`\` + s + `[ \t]*$`)
return nil
}
@ -176,17 +176,10 @@ func Parse(rwc io.Reader, d *Directive) (*Node, error) {
newline := scanner.Text()
currentLine++
// If escape followed by a comment line then stop
// Note here that comment line starts with `#` at
// the first pos of the line
if stripComments(newline) == "" {
break
if stripComments(strings.TrimSpace(newline)) == "" {
continue
}
// If escape followed by an empty line then stop
if strings.TrimSpace(newline) == "" {
break
}
line, child, err = ParseLine(line+newline, d, false)
if err != nil {
return nil, err

View file

@ -150,8 +150,8 @@ func TestLineInformation(t *testing.T) {
t.Fatalf("Error parsing dockerfile %s: %v", testFileLineInfo, err)
}
if ast.StartLine != 5 || ast.EndLine != 27 {
fmt.Fprintf(os.Stderr, "Wrong root line information: expected(%d-%d), actual(%d-%d)\n", 5, 27, ast.StartLine, ast.EndLine)
if ast.StartLine != 5 || ast.EndLine != 31 {
fmt.Fprintf(os.Stderr, "Wrong root line information: expected(%d-%d), actual(%d-%d)\n", 5, 31, ast.StartLine, ast.EndLine)
t.Fatalf("Root line information doesn't match result.")
}
if len(ast.Children) != 3 {
@ -161,7 +161,7 @@ func TestLineInformation(t *testing.T) {
expected := [][]int{
{5, 5},
{11, 12},
{17, 27},
{17, 31},
}
for i, child := range ast.Children {
if child.StartLine != expected[i][0] || child.EndLine != expected[i][1] {

View file

@ -16,11 +16,15 @@ ENV GOPATH \
# Install the packages we need, clean up after them and us
RUN apt-get update \
&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean \
&& apt-get install -y --no-install-recommends git golang ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists \
&& go get -v github.com/brimstone/consuldock \
&& mv $GOPATH/bin/consuldock /usr/local/bin/consuldock \
&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \
&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \
&& rm /tmp/dpkg.* \

View file

@ -16,8 +16,10 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends git golang ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists \
&& go get -v github.com/brimstone/consuldock \
&& mv $GOPATH/bin/consuldock /usr/local/bin/consuldock \
&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \
&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \
&& rm /tmp/dpkg.* \

View file

@ -23,12 +23,14 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends unzip wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists \
&& cd /tmp \
&& wget https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip \
-O web_ui.zip \
&& unzip web_ui.zip \
&& mv dist /webui \
&& rm web_ui.zip \
&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \
&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \
&& rm /tmp/dpkg.*
@ -40,8 +42,10 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends git golang ca-certificates build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists \
&& go get -v github.com/hashicorp/consul \
&& mv $GOPATH/bin/consul /usr/bin/consul \
&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \
&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \
&& rm /tmp/dpkg.* \

View file

@ -13,6 +13,8 @@ world
RUN echo hello \
goodbye\
frog
RUN echo hello \
world
RUN echo hi \
\
world \
@ -27,5 +29,8 @@ bye\
frog
RUN echo hello \
# this is a comment that breaks escape continuation
RUN echo this is some more useful stuff
# this is a comment
# this is a comment with a blank line surrounding it
this is some more useful stuff

View file

@ -3,8 +3,8 @@
(run "echo hello world")
(run "echo hello world")
(run "echo hello goodbyefrog")
(run "echo hello world")
(run "echo hi world goodnight")
(run "echo goodbyefrog")
(run "echo goodbyefrog")
(run "echo hello")
(run "echo this is some more useful stuff")
(run "echo hello this is some more useful stuff")

View file

@ -1,15 +0,0 @@
FROM busybox
# The following will create two instructions
# `Run foo`
# `bar`
# because empty line will break the escape.
# The parser will generate the following:
# (from "busybox")
# (run "foo")
# (bar "")
# And `bar` will return an error instruction later
# Note: Parse() will not immediately error out.
RUN foo \
bar

View file

@ -1,3 +0,0 @@
(from "busybox")
(run "foo")
(bar "")

View file

@ -6,7 +6,9 @@ RUN apt-get \update && \
ADD \conf\\" /.znc
RUN foo \
bar \
baz
CMD [ "\/usr\\\"/bin/znc", "-f", "-r" ]

View file

@ -8,6 +8,7 @@ package dockerfile
import (
"fmt"
"runtime"
"strings"
"text/scanner"
"unicode"
@ -298,9 +299,16 @@ func (sw *shellWord) processName() string {
}
func (sw *shellWord) getEnv(name string) string {
if runtime.GOOS == "windows" {
// Case-insensitive environment variables on Windows
name = strings.ToUpper(name)
}
for _, env := range sw.envs {
i := strings.Index(env, "=")
if i < 0 {
if runtime.GOOS == "windows" {
env = strings.ToUpper(env)
}
if name == env {
// Should probably never get here, but just in case treat
// it like "var" and "var=" are the same
@ -308,7 +316,11 @@ func (sw *shellWord) getEnv(name string) string {
}
continue
}
if name != env[:i] {
compareName := env[:i]
if runtime.GOOS == "windows" {
compareName = strings.ToUpper(compareName)
}
if name != compareName {
continue
}
return env[i+1:]

View file

@ -3,12 +3,14 @@ package dockerfile
import (
"bufio"
"os"
"runtime"
"strings"
"testing"
)
func TestShellParser4EnvVars(t *testing.T) {
fn := "envVarTest"
lineCount := 0
file, err := os.Open(fn)
if err != nil {
@ -20,6 +22,7 @@ func TestShellParser4EnvVars(t *testing.T) {
envs := []string{"PWD=/home", "SHELL=bash", "KOREAN=한국어"}
for scanner.Scan() {
line := scanner.Text()
lineCount++
// Trim comments and blank lines
i := strings.Index(line, "#")
@ -33,21 +36,30 @@ func TestShellParser4EnvVars(t *testing.T) {
}
words := strings.Split(line, "|")
if len(words) != 2 {
if len(words) != 3 {
t.Fatalf("Error in '%s' - should be exactly one | in:%q", fn, line)
}
words[0] = strings.TrimSpace(words[0])
words[1] = strings.TrimSpace(words[1])
words[2] = strings.TrimSpace(words[2])
newWord, err := ProcessWord(words[0], envs, '\\')
// Key W=Windows; A=All; U=Unix
if (words[0] != "W") && (words[0] != "A") && (words[0] != "U") {
t.Fatalf("Invalid tag %s at line %d of %s. Must be W, A or U", words[0], lineCount, fn)
}
if ((words[0] == "W" || words[0] == "A") && runtime.GOOS == "windows") ||
((words[0] == "U" || words[0] == "A") && runtime.GOOS != "windows") {
newWord, err := ProcessWord(words[1], envs, '\\')
if err != nil {
newWord = "error"
}
if newWord != words[1] {
t.Fatalf("Error. Src: %s Calc: %s Expected: %s", words[0], newWord, words[1])
if newWord != words[2] {
t.Fatalf("Error. Src: %s Calc: %s Expected: %s at line %d", words[1], newWord, words[2], lineCount)
}
}
}
}

View file

@ -104,7 +104,8 @@ func MakeTarSumContext(tarStream io.Reader) (ModifiableContext, error) {
return nil, err
}
if err := chrootarchive.Untar(sum, root, nil); err != nil {
err = chrootarchive.Untar(sum, root, nil)
if err != nil {
return nil, err
}

View file

@ -2,6 +2,7 @@ package cli
import (
"fmt"
"strings"
"github.com/spf13/cobra"
)
@ -17,6 +18,7 @@ func SetupRootCommand(rootCmd *cobra.Command) {
rootCmd.SetUsageTemplate(usageTemplate)
rootCmd.SetHelpTemplate(helpTemplate)
rootCmd.SetFlagErrorFunc(FlagErrorFunc)
rootCmd.SetHelpCommand(helpCommand)
rootCmd.PersistentFlags().BoolP("help", "h", false, "Print usage")
rootCmd.PersistentFlags().MarkShorthandDeprecated("help", "please use --help")
@ -39,6 +41,23 @@ func FlagErrorFunc(cmd *cobra.Command, err error) error {
}
}
var helpCommand = &cobra.Command{
Use: "help [command]",
Short: "Help about the command",
PersistentPreRun: func(cmd *cobra.Command, args []string) {},
PersistentPostRun: func(cmd *cobra.Command, args []string) {},
RunE: func(c *cobra.Command, args []string) error {
cmd, args, e := c.Root().Find(args)
if cmd == nil || e != nil || len(args) > 0 {
return fmt.Errorf("unknown help topic: %v", strings.Join(args, " "))
}
helpFunc := cmd.HelpFunc()
helpFunc(cmd, args)
return nil
},
}
func hasSubCommands(cmd *cobra.Command) bool {
return len(operationSubCommands(cmd)) > 0
}

View file

@ -12,10 +12,7 @@ func NewCheckpointCommand(dockerCli *command.DockerCli) *cobra.Command {
Use: "checkpoint",
Short: "Manage checkpoints",
Args: cli.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
cmd.SetOutput(dockerCli.Err())
cmd.HelpFunc()(cmd, args)
},
RunE: dockerCli.ShowHelp,
Tags: map[string]string{"experimental": "", "version": "1.25"},
}
cmd.AddCommand(

View file

@ -1,6 +1,8 @@
package checkpoint
import (
"fmt"
"golang.org/x/net/context"
"github.com/docker/docker/api/types"
@ -51,5 +53,6 @@ func runCreate(dockerCli *command.DockerCli, opts createOptions) error {
return err
}
fmt.Fprintf(dockerCli.Out(), "%s\n", opts.checkpoint)
return nil
}

View file

@ -10,6 +10,7 @@ import (
"runtime"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/versions"
cliflags "github.com/docker/docker/cli/flags"
"github.com/docker/docker/cliconfig"
@ -20,6 +21,7 @@ import (
dopts "github.com/docker/docker/opts"
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
@ -73,20 +75,67 @@ func (cli *DockerCli) In() *InStream {
return cli.in
}
// ShowHelp shows the command help.
func (cli *DockerCli) ShowHelp(cmd *cobra.Command, args []string) error {
cmd.SetOutput(cli.err)
cmd.HelpFunc()(cmd, args)
return nil
}
// ConfigFile returns the ConfigFile
func (cli *DockerCli) ConfigFile() *configfile.ConfigFile {
return cli.configFile
}
// GetAllCredentials returns all of the credentials stored in all of the
// configured credential stores.
func (cli *DockerCli) GetAllCredentials() (map[string]types.AuthConfig, error) {
auths := make(map[string]types.AuthConfig)
for registry := range cli.configFile.CredentialHelpers {
helper := cli.CredentialsStore(registry)
newAuths, err := helper.GetAll()
if err != nil {
return nil, err
}
addAll(auths, newAuths)
}
defaultStore := cli.CredentialsStore("")
newAuths, err := defaultStore.GetAll()
if err != nil {
return nil, err
}
addAll(auths, newAuths)
return auths, nil
}
func addAll(to, from map[string]types.AuthConfig) {
for reg, ac := range from {
to[reg] = ac
}
}
// CredentialsStore returns a new credentials store based
// on the settings provided in the configuration file.
func (cli *DockerCli) CredentialsStore() credentials.Store {
if cli.configFile.CredentialsStore != "" {
return credentials.NewNativeStore(cli.configFile)
// on the settings provided in the configuration file. Empty string returns
// the default credential store.
func (cli *DockerCli) CredentialsStore(serverAddress string) credentials.Store {
if helper := getConfiguredCredentialStore(cli.configFile, serverAddress); helper != "" {
return credentials.NewNativeStore(cli.configFile, helper)
}
return credentials.NewFileStore(cli.configFile)
}
// getConfiguredCredentialStore returns the credential helper configured for the
// given registry, the default credsStore, or the empty string if neither are
// configured.
func getConfiguredCredentialStore(c *configfile.ConfigFile, serverAddress string) string {
if c.CredentialHelpers != nil && serverAddress != "" {
if helper, exists := c.CredentialHelpers[serverAddress]; exists {
return helper
}
}
return c.CredentialsStore
}
// Initialize the dockerCli runs initialization that must happen after command
// line flags are parsed.
func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error {

View file

@ -118,7 +118,7 @@ func runAttach(dockerCli *command.DockerCli, opts *attachOptions) error {
return errAttach
}
_, status, err := getExitCode(dockerCli, ctx, opts.container)
_, status, err := getExitCode(ctx, dockerCli, opts.container)
if err != nil {
return err
}

View file

@ -13,10 +13,7 @@ func NewContainerCommand(dockerCli *command.DockerCli) *cobra.Command {
Use: "container",
Short: "Manage containers",
Args: cli.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
cmd.SetOutput(dockerCli.Err())
cmd.HelpFunc()(cmd, args)
},
RunE: dockerCli.ShowHelp,
}
cmd.AddCommand(
NewAttachCommand(dockerCli),

View file

@ -170,7 +170,7 @@ func createContainer(ctx context.Context, dockerCli *command.DockerCli, config *
if ref, ok := ref.(reference.NamedTagged); ok && command.IsTrusted() {
var err error
trustedRef, err = image.TrustedReference(ctx, dockerCli, ref)
trustedRef, err = image.TrustedReference(ctx, dockerCli, ref, nil)
if err != nil {
return nil, err
}

View file

@ -170,7 +170,7 @@ func getExecExitCode(ctx context.Context, client apiclient.ContainerAPIClient, e
resp, err := client.ContainerExecInspect(ctx, execID)
if err != nil {
// If we can't connect, then the daemon probably died.
if err != apiclient.ErrConnectionFailed {
if !apiclient.IsErrConnectionFailed(err) {
return false, -1, err
}
return false, -1, nil

View file

@ -59,22 +59,25 @@ func newListCommand(dockerCli *command.DockerCli) *cobra.Command {
return &cmd
}
type preProcessor struct {
types.Container
opts *types.ContainerListOptions
}
// listOptionsProcessor is used to set any container list options which may only
// be embedded in the format template.
// This is passed directly into tmpl.Execute in order to allow the preprocessor
// to set any list options that were not provided by flags (e.g. `.Size`).
// It is using a `map[string]bool` so that unknown fields passed into the
// template format do not cause errors. These errors will get picked up when
// running through the actual template processor.
type listOptionsProcessor map[string]bool
// Size sets the size option when called by a template execution.
func (p *preProcessor) Size() bool {
p.opts.Size = true
// Size sets the size of the map when called by a template execution.
func (o listOptionsProcessor) Size() bool {
o["size"] = true
return true
}
// Networks does nothing but return true.
// It is needed to avoid the template check to fail as this field
// doesn't exist in `types.Container`
func (p *preProcessor) Networks() bool {
return true
// Label is needed here as it allows the correct pre-processing
// because Label() is a method with arguments
func (o listOptionsProcessor) Label(name string) string {
return ""
}
func buildContainerListOptions(opts *psOptions) (*types.ContainerListOptions, error) {
@ -89,20 +92,20 @@ func buildContainerListOptions(opts *psOptions) (*types.ContainerListOptions, er
options.Limit = 1
}
// Currently only used with Size, so we can determine if the user
// put {{.Size}} in their format.
pre := &preProcessor{opts: options}
tmpl, err := templates.Parse(opts.format)
if err != nil {
return nil, err
}
optionsProcessor := listOptionsProcessor{}
// This shouldn't error out but swallowing the error makes it harder
// to track down if preProcessor issues come up. Ref #24696
if err := tmpl.Execute(ioutil.Discard, pre); err != nil {
if err := tmpl.Execute(ioutil.Discard, optionsProcessor); err != nil {
return nil, err
}
// At the moment all we need is to capture .Size for preprocessor
options.Size = opts.size || optionsProcessor["size"]
return options, nil
}

View file

@ -5,7 +5,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/cli"
"github.com/docker/docker/cli/command"
units "github.com/docker/go-units"
@ -52,7 +52,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed u
return
}
report, err := dockerCli.Client().ContainersPrune(context.Background(), types.ContainersPruneConfig{})
report, err := dockerCli.Client().ContainersPrune(context.Background(), filters.Args{})
if err != nil {
return
}

View file

@ -46,6 +46,57 @@ func TestBuildContainerListOptions(t *testing.T) {
expectedLimit: 1,
expectedFilters: make(map[string]string),
},
{
psOpts: &psOptions{
all: true,
size: false,
last: 5,
filter: filters,
// With .Size, size should be true
format: "{{.Size}}",
},
expectedAll: true,
expectedSize: true,
expectedLimit: 5,
expectedFilters: map[string]string{
"foo": "bar",
"baz": "foo",
},
},
{
psOpts: &psOptions{
all: true,
size: false,
last: 5,
filter: filters,
// With .Size, size should be true
format: "{{.Size}} {{.CreatedAt}} {{.Networks}}",
},
expectedAll: true,
expectedSize: true,
expectedLimit: 5,
expectedFilters: map[string]string{
"foo": "bar",
"baz": "foo",
},
},
{
psOpts: &psOptions{
all: true,
size: false,
last: 5,
filter: filters,
// Without .Size, size should be false
format: "{{.CreatedAt}} {{.Networks}}",
},
expectedAll: true,
expectedSize: false,
expectedLimit: 5,
expectedFilters: map[string]string{
"foo": "bar",
"baz": "foo",
},
},
}
for _, c := range contexts {

View file

@ -76,7 +76,6 @@ func runRun(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *runOptions
var (
flAttach *opttypes.ListOpts
ErrConflictAttachDetach = fmt.Errorf("Conflicting options: -a and -d")
ErrConflictRestartPolicyAndAutoRemove = fmt.Errorf("Conflicting options: --restart and --rm")
)
config, hostConfig, networkingConfig, err := runconfigopts.Parse(flags, copts)
@ -87,9 +86,6 @@ func runRun(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *runOptions
return cli.StatusError{StatusCode: 125}
}
if hostConfig.AutoRemove && !hostConfig.RestartPolicy.IsNone() {
return ErrConflictRestartPolicyAndAutoRemove
}
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")
}
@ -211,7 +207,7 @@ func runRun(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *runOptions
})
}
statusChan := waitExitOrRemoved(dockerCli, ctx, createResponse.ID, hostConfig.AutoRemove)
statusChan := waitExitOrRemoved(ctx, dockerCli, createResponse.ID, hostConfig.AutoRemove)
//start the container
if err := client.ContainerStart(ctx, createResponse.ID, types.ContainerStartOptions{}); err != nil {

View file

@ -111,7 +111,7 @@ func runStart(dockerCli *command.DockerCli, opts *startOptions) error {
// 3. We should open a channel for receiving status code of the container
// no matter it's detached, removed on daemon side(--rm) or exit normally.
statusChan := waitExitOrRemoved(dockerCli, ctx, c.ID, c.HostConfig.AutoRemove)
statusChan := waitExitOrRemoved(ctx, dockerCli, c.ID, c.HostConfig.AutoRemove)
startOptions := types.ContainerStartOptions{
CheckpointID: opts.checkpoint,
CheckpointDir: opts.checkpointDir,

View file

@ -108,7 +108,7 @@ func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
s := formatter.NewContainerStats(container.ID[:12], daemonOSType)
if cStats.add(s) {
waitFirst.Add(1)
go collect(s, ctx, dockerCli.Client(), !opts.noStream, waitFirst)
go collect(ctx, s, dockerCli.Client(), !opts.noStream, waitFirst)
}
}
}
@ -125,7 +125,7 @@ func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
s := formatter.NewContainerStats(e.ID[:12], daemonOSType)
if cStats.add(s) {
waitFirst.Add(1)
go collect(s, ctx, dockerCli.Client(), !opts.noStream, waitFirst)
go collect(ctx, s, dockerCli.Client(), !opts.noStream, waitFirst)
}
}
})
@ -134,7 +134,7 @@ func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
s := formatter.NewContainerStats(e.ID[:12], daemonOSType)
if cStats.add(s) {
waitFirst.Add(1)
go collect(s, ctx, dockerCli.Client(), !opts.noStream, waitFirst)
go collect(ctx, s, dockerCli.Client(), !opts.noStream, waitFirst)
}
})
@ -160,7 +160,7 @@ func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
s := formatter.NewContainerStats(name, daemonOSType)
if cStats.add(s) {
waitFirst.Add(1)
go collect(s, ctx, dockerCli.Client(), !opts.noStream, waitFirst)
go collect(ctx, s, dockerCli.Client(), !opts.noStream, waitFirst)
}
}

View file

@ -53,7 +53,7 @@ func (s *stats) isKnownContainer(cid string) (int, bool) {
return -1, false
}
func collect(s *formatter.ContainerStats, ctx context.Context, cli client.APIClient, streamStats bool, waitFirst *sync.WaitGroup) {
func collect(ctx context.Context, s *formatter.ContainerStats, cli client.APIClient, streamStats bool, waitFirst *sync.WaitGroup) {
logrus.Debugf("collecting stats for %s", s.Container)
var (
getFirst bool

View file

@ -9,21 +9,32 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/versions"
"github.com/docker/docker/cli/command"
clientapi "github.com/docker/docker/client"
)
func waitExitOrRemoved(dockerCli *command.DockerCli, ctx context.Context, containerID string, waitRemove bool) chan int {
func waitExitOrRemoved(ctx context.Context, dockerCli *command.DockerCli, containerID string, waitRemove bool) chan int {
if len(containerID) == 0 {
// containerID can never be empty
panic("Internal Error: waitExitOrRemoved needs a containerID as parameter")
}
var removeErr error
statusChan := make(chan int)
exitCode := 125
eventProcessor := func(e events.Message) bool {
// Get events via Events API
f := filters.NewArgs()
f.Add("type", "container")
f.Add("container", containerID)
options := types.EventsOptions{
Filters: f,
}
eventCtx, cancel := context.WithCancel(ctx)
eventq, errq := dockerCli.Client().Events(eventCtx, options)
eventProcessor := func(e events.Message) bool {
stopProcessing := false
switch e.Status {
case "die":
@ -37,6 +48,18 @@ func waitExitOrRemoved(dockerCli *command.DockerCli, ctx context.Context, contai
}
if !waitRemove {
stopProcessing = true
} else {
// If we are talking to an older daemon, `AutoRemove` is not supported.
// We need to fall back to the old behavior, which is client-side removal
if versions.LessThan(dockerCli.Client().ClientVersion(), "1.25") {
go func() {
removeErr = dockerCli.Client().ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{RemoveVolumes: true})
if removeErr != nil {
logrus.Errorf("error removing container: %v", removeErr)
cancel() // cancel the event Q
}
}()
}
}
case "detach":
exitCode = 0
@ -44,39 +67,27 @@ func waitExitOrRemoved(dockerCli *command.DockerCli, ctx context.Context, contai
case "destroy":
stopProcessing = true
}
if stopProcessing {
statusChan <- exitCode
return true
return stopProcessing
}
return false
}
// Get events via Events API
f := filters.NewArgs()
f.Add("type", "container")
f.Add("container", containerID)
options := types.EventsOptions{
Filters: f,
}
eventCtx, cancel := context.WithCancel(ctx)
eventq, errq := dockerCli.Client().Events(eventCtx, options)
go func() {
defer cancel()
defer func() {
statusChan <- exitCode // must always send an exit code or the caller will block
cancel()
}()
for {
select {
case <-eventCtx.Done():
if removeErr != nil {
return
}
case evt := <-eventq:
if eventProcessor(evt) {
return
}
case err := <-errq:
logrus.Errorf("error getting events from daemon: %v", err)
statusChan <- exitCode
return
}
}
@ -87,11 +98,11 @@ func waitExitOrRemoved(dockerCli *command.DockerCli, ctx context.Context, contai
// getExitCode performs an inspect on the container. It returns
// the running state and the exit code.
func getExitCode(dockerCli *command.DockerCli, ctx context.Context, containerID string) (bool, int, error) {
func getExitCode(ctx context.Context, dockerCli *command.DockerCli, 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 {
if !clientapi.IsErrConnectionFailed(err) {
return false, -1, err
}
return false, -1, nil

View file

@ -370,3 +370,29 @@ func TestContainerContextWriteJSONField(t *testing.T) {
assert.Equal(t, s, containers[i].ID)
}
}
func TestContainerBackCompat(t *testing.T) {
containers := []types.Container{{ID: "brewhaha"}}
cases := []string{
"ID",
"Names",
"Image",
"Command",
"CreatedAt",
"RunningFor",
"Ports",
"Status",
"Size",
"Labels",
"Mounts",
}
buf := bytes.NewBuffer(nil)
for _, c := range cases {
ctx := Context{Format: Format(fmt.Sprintf("{{ .%s }}", c)), Output: buf}
if err := ContainerWrite(ctx, containers); err != nil {
t.Logf("could not render template for field '%s': %v", c, err)
t.Fail()
}
buf.Reset()
}
}

View file

@ -192,7 +192,10 @@ func (c *diskUsageImagesContext) Reclaimable() string {
c.AddHeader(reclaimableHeader)
for _, i := range c.images {
if i.Containers != 0 {
used += i.Size
if i.VirtualSize == -1 || i.SharedSize == -1 {
continue
}
used += i.VirtualSize - i.SharedSize
}
}

View file

@ -226,8 +226,7 @@ func (c *imageContext) CreatedAt() string {
func (c *imageContext) Size() string {
c.AddHeader(sizeHeader)
//NOTE: For backward compatibility we need to return VirtualSize
return units.HumanSizeWithPrecision(float64(c.i.VirtualSize), 3)
return units.HumanSizeWithPrecision(float64(c.i.Size), 3)
}
func (c *imageContext) Containers() string {
@ -253,8 +252,8 @@ func (c *imageContext) SharedSize() string {
func (c *imageContext) UniqueSize() string {
c.AddHeader(uniqueSizeHeader)
if c.i.Size == -1 {
if c.i.VirtualSize == -1 || c.i.SharedSize == -1 {
return "N/A"
}
return units.HumanSize(float64(c.i.Size))
return units.HumanSize(float64(c.i.VirtualSize - c.i.SharedSize))
}

View file

@ -263,6 +263,9 @@ func (ctx *serviceInspectContext) HasResources() bool {
}
func (ctx *serviceInspectContext) HasResourceReservations() bool {
if ctx.Service.Spec.TaskTemplate.Resources == nil || ctx.Service.Spec.TaskTemplate.Resources.Reservations == nil {
return false
}
return ctx.Service.Spec.TaskTemplate.Resources.Reservations.NanoCPUs > 0 || ctx.Service.Spec.TaskTemplate.Resources.Reservations.MemoryBytes > 0
}
@ -281,6 +284,9 @@ func (ctx *serviceInspectContext) ResourceReservationMemory() string {
}
func (ctx *serviceInspectContext) HasResourceLimits() bool {
if ctx.Service.Spec.TaskTemplate.Resources == nil || ctx.Service.Spec.TaskTemplate.Resources.Limits == nil {
return false
}
return ctx.Service.Spec.TaskTemplate.Resources.Limits.NanoCPUs > 0 || ctx.Service.Spec.TaskTemplate.Resources.Limits.MemoryBytes > 0
}

View file

@ -145,8 +145,10 @@ func (c *containerStatsContext) Container() string {
func (c *containerStatsContext) Name() string {
c.AddHeader(nameHeader)
name := c.s.Name[1:]
return name
if len(c.s.Name) > 1 {
return c.s.Name[1:]
}
return "--"
}
func (c *containerStatsContext) ID() string {

View file

@ -69,6 +69,12 @@ func TestContainerStatsContextWrite(t *testing.T) {
`MEM USAGE / LIMIT
20 B / 20 B
-- / --
`,
},
{
Context{Format: "{{.Container}} {{.ID}} {{.Name}}"},
`container1 abcdef foo
container2 --
`,
},
{
@ -83,6 +89,8 @@ container2 --
stats := []StatsEntry{
{
Container: "container1",
ID: "abcdef",
Name: "/foo",
CPUPercentage: 20,
Memory: 20,
MemoryLimit: 20,

View file

@ -67,7 +67,7 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command {
ulimits := make(map[string]*units.Ulimit)
options := buildOptions{
tags: opts.NewListOpts(validateTag),
buildArgs: opts.NewListOpts(runconfigopts.ValidateArg),
buildArgs: opts.NewListOpts(runconfigopts.ValidateEnv),
ulimits: runconfigopts.NewUlimitOpt(&ulimits),
labels: opts.NewListOpts(runconfigopts.ValidateEnv),
}
@ -107,7 +107,7 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command {
flags.StringSliceVar(&options.cacheFrom, "cache-from", []string{}, "Images to consider as cache sources")
flags.BoolVar(&options.compress, "compress", false, "Compress the build context using gzip")
flags.StringSliceVar(&options.securityOpt, "security-opt", []string{}, "Security options")
flags.StringVar(&options.networkMode, "network", "default", "Connect a container to a network")
flags.StringVar(&options.networkMode, "network", "default", "Set the networking mode for the RUN instructions during build")
command.AddTrustedFlags(flags, true)
@ -235,7 +235,7 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error {
var resolvedTags []*resolvedTag
if command.IsTrusted() {
translator := func(ctx context.Context, ref reference.NamedTagged) (reference.Canonical, error) {
return TrustedReference(ctx, dockerCli, ref)
return TrustedReference(ctx, dockerCli, ref, nil)
}
// Wrap the tar archive to replace the Dockerfile entry with the rewritten
// Dockerfile which uses trusted pulls.
@ -280,7 +280,7 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error {
}
}
authConfig, _ := dockerCli.CredentialsStore().GetAll()
authConfigs, _ := dockerCli.GetAllCredentials()
buildOptions := types.ImageBuildOptions{
Memory: memory,
MemorySwap: memorySwap,
@ -300,8 +300,8 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error {
Dockerfile: relDockerfile,
ShmSize: shmSize,
Ulimits: options.ulimits.GetList(),
BuildArgs: runconfigopts.ConvertKVStringsToMap(options.buildArgs.GetAll()),
AuthConfigs: authConfig,
BuildArgs: runconfigopts.ConvertKVStringsToMapWithNil(options.buildArgs.GetAll()),
AuthConfigs: authConfigs,
Labels: runconfigopts.ConvertKVStringsToMap(options.labels.GetAll()),
CacheFrom: options.cacheFrom,
SecurityOpt: options.securityOpt,

View file

@ -13,10 +13,7 @@ func NewImageCommand(dockerCli *command.DockerCli) *cobra.Command {
Use: "image",
Short: "Manage images",
Args: cli.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
cmd.SetOutput(dockerCli.Err())
cmd.HelpFunc()(cmd, args)
},
RunE: dockerCli.ShowHelp,
}
cmd.AddCommand(
NewBuildCommand(dockerCli),

View file

@ -3,13 +3,13 @@ package image
import (
"fmt"
"io"
"os"
"golang.org/x/net/context"
"github.com/docker/docker/cli"
"github.com/docker/docker/cli/command"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/system"
"github.com/spf13/cobra"
)
@ -43,7 +43,9 @@ func runLoad(dockerCli *command.DockerCli, opts loadOptions) error {
var input io.Reader = dockerCli.In()
if opts.input != "" {
file, err := os.Open(opts.input)
// We use system.OpenSequential to use sequential file access on Windows, avoiding
// depleting the standby list un-necessarily. On Linux, this equates to a regular os.Open.
file, err := system.OpenSequential(opts.input)
if err != nil {
return err
}

View file

@ -5,7 +5,7 @@ import (
"golang.org/x/net/context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/cli"
"github.com/docker/docker/cli/command"
units "github.com/docker/go-units"
@ -54,6 +54,9 @@ Are you sure you want to continue?`
)
func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed uint64, output string, err error) {
pruneFilters := filters.NewArgs()
pruneFilters.Add("dangling", fmt.Sprintf("%v", !opts.all))
warning := danglingWarning
if opts.all {
warning = allImageWarning
@ -62,9 +65,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed u
return
}
report, err := dockerCli.Client().ImagesPrune(context.Background(), types.ImagesPruneConfig{
DanglingOnly: !opts.all,
})
report, err := dockerCli.Client().ImagesPrune(context.Background(), pruneFilters)
if err != nil {
return
}

View file

@ -55,16 +55,6 @@ func runPull(dockerCli *command.DockerCli, opts pullOptions) error {
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 {
@ -76,14 +66,15 @@ func runPull(dockerCli *command.DockerCli, opts pullOptions) error {
authConfig := command.ResolveAuthConfig(ctx, dockerCli, repoInfo.Index)
requestPrivilege := command.RegistryAuthenticationPrivilegedFunc(dockerCli, repoInfo.Index, "pull")
if command.IsTrusted() && !registryRef.HasDigest() {
// Check if tag is digest
err = trustedPull(ctx, dockerCli, repoInfo, registryRef, authConfig, requestPrivilege)
// Check if reference has a digest
_, isCanonical := distributionRef.(reference.Canonical)
if command.IsTrusted() && !isCanonical {
err = trustedPull(ctx, dockerCli, repoInfo, distributionRef, authConfig, requestPrivilege)
} else {
err = imagePullPrivileged(ctx, dockerCli, authConfig, distributionRef.String(), requestPrivilege, opts.all)
}
if err != nil {
if strings.Contains(err.Error(), "target is a plugin") {
if strings.Contains(err.Error(), "target is plugin") {
return errors.New(err.Error() + " - Use `docker plugin install`")
}
return err

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