Commit graph

18578 commits

Author SHA1 Message Date
Alexandre Beslic
40edb5f97c Merge pull request #15029 from azurezk/add-version-info
Add docker version info in /info request
2015-09-21 11:44:11 -07:00
David Calavera
0fea04d27e Organize server pre-func logic in middlewares.
It defines global middlewares for every request.
This makes the server slightly more composable.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-21 14:27:06 -04:00
Tom Denham
499ade0116 Vendoring libnetwork
Pull in version e5fea92a6c8a5968bdb8005bf959c6e23113b689

Fixes libnetwork regressions that stopped drivers that set routes from working.
Pulls in libnetwork PRs #546 #543

Signed-off-by: Tom Denham <tom@tomdee.co.uk>
2015-09-21 11:13:14 -07:00
moxiegirl
f018c0430b Merge pull request #16449 from runcom/add-container-label-userguide
docs: userguide: add container labels section
2015-09-21 10:26:20 -07:00
David Calavera
72bb56618b Move volume ref counting store to a package.
- Add unit tests to make sure the functionality is correct.
- Add FilterByDriver to allow filtering volumes by driver, for future
  `volume ls` filtering and whatnot.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-21 12:46:49 -04:00
Alexandre Beslic
587558f617 Merge pull request #16440 from runcom/tempdir-check-errs
integration-cli: check err on tmp dir creation
2015-09-21 08:06:08 -07:00
Yuan Sun
ab39a4c981 Add the TestRunSwapLessThanMemoryLimit case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-09-21 22:12:19 +08:00
Zhang Kun
7cf343d106 add docker server version to /info
Signed-off-by: Zhang Kun <zkazure@gmail.com>
2015-09-21 21:15:32 +08:00
Brian Goff
743dc1c791 Merge pull request #16443 from coolljt0725/simplify_volume_code
Cleanup: remove unnecessary return at the end of block in volume.go
2015-09-21 09:05:16 -04:00
Antonio Murdaca
124540c086 docs: userguide: add container labels section
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-21 14:41:22 +02:00
Lei Jitang
5746eb9501 Cleanup: remove unnecessary return at the end of block in volumes.go
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-09-21 04:32:37 -04:00
Hu Keping
f05bacbe50 Events for OOM needs to be shift to an earlier time
It's worth to warn user as soon as possilbe when OOM happend.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-21 10:18:08 +08:00
David Calavera
4a6e8c8f3c Merge pull request #16174 from sallyom/man-restart-fix
docker restarts running OR stopped containers
2015-09-20 18:10:06 -07:00
Antonio Murdaca
76b3b54314 api: server: container: fix wrong comment
This comment was wrongly referring to the old job mechanism and it
wasn't clear what it was trying to document.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-21 00:46:16 +02:00
Antonio Murdaca
b616b8a17a integration-cli: check err on tmp dir creation
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-21 00:00:55 +02:00
moxiegirl
4133401bf9 Merge pull request #16425 from charleswhchan/fix-version-doc
Add missing '[OPTIONS]' arg to documentation for 'docker version'.
2015-09-20 14:33:47 -07:00
Antonio Murdaca
e3c472426f daemon: logger: error out on daemon start if invalid logger address
If an invalid logger address is provided on daemon start it will
silently fail. As syslog driver is doing, this check should be done on
daemon start and prevent it from starting even in other drivers.
This patch also adds integration tests for this behavior.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-20 16:20:25 +02:00
Sally O'Malley
e41753678d docker restarts running OR stopped containers, docs edit rm "running"
Signed-off-by: Sally O'Malley <somalley@redhat.com>
2015-09-20 09:16:27 -04:00
Doug Davis
148be8bd7e Merge pull request #16430 from runcom/pkg-integration-fix-format
pkg: integration: utils_test: fix int format
2015-09-20 06:48:58 -05:00
Lei Jitang
ee6b81faf2 Docs: correct the description of docker cp
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-09-20 18:02:28 +08:00
Antonio Murdaca
c219311fd8 pkg: integration: utils_test: fix int format
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-20 02:42:08 +02:00
Sebastiaan van Stijn
acdc0f82c0 Merge pull request #16414 from sunyuan3/dockertest
Add timeout description.
2015-09-19 22:20:10 +02:00
Charles Chan
8d6796f8c6 Add missing '[OPTIONS]' arg to documentation for 'docker version'.
Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
2015-09-19 08:53:11 -07:00
Brian Goff
7d5603e7cb Merge pull request #16363 from coolljt0725/fix_net_none_test
Fix --net none test closes #16356
2015-09-19 09:25:12 -04:00
Steve Durrheimer
07f1d68887 Catchup missing changes for the zsh completion
- felixr/docker-zsh-completion@6ae6279: Add --privileged flag to docker exec command in zsh completion
 - felixr/docker-zsh-completion@259ea00: Remove -h help flag from subcommands in zsh completion
 - felixr/docker-zsh-completion@5f77b29: Add docker ps --format flag to zsh completion
 - felixr/docker-zsh-completion@a1f39f8: Add --config flag to zsh completion
 - felixr/docker-zsh-completion@6a503b4: Filter zsh completions of inspect command by --type
 - felixr/docker-zsh-completion@d286ccd: Add --ulimit flag to build command to zsh completion
 - felixr/docker-zsh-completion@bdc1261: Add support for kernel memory limit in zsh completion
 - felixr/docker-zsh-completion@c8ce164: Add docker volume command and subcommands in zsh completion
 - felixr/docker-zsh-completion@7f996bf: Add docker daemon command to zsh completion
 - felixr/docker-zsh-completion@4ccd292: Be more generic when parsing "docker ps" output.
 - felixr/docker-zsh-completion@cd0f1b9: Fix container completion by name
 - felixr/docker-zsh-completion@8bf9041: Use "docker ps --no-trunc" to build completion.
 - felixr/docker-zsh-completion@b721bbb: Only keep the last name for a running/stopped container
 - felixr/docker-zsh-completion@6791b3e: Fix "docker run --stop-signal" completion
 - felixr/docker-zsh-completion@961f628: Try some heuristics to determine the canonical container name

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2015-09-19 12:03:55 +02:00
Yuan Sun
76c96da487 Add timeout description.
It is almost impossible to take serveral minutes to complete all the
test.

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-09-19 10:24:16 +08:00
Lei Jitang
0b2091132a Fix --net none test closes #16356
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-09-18 20:49:36 -04:00
Doug Davis
536353e87f Merge pull request #16409 from runcom/fix-tests
integration-cli: fix tests with memory limit
2015-09-18 19:47:16 -04:00
Jess Frazelle
bf892efe36 Merge pull request #16405 from michaelhuettermann/master
Adding another scientist to the hall of fame.
2015-09-18 16:09:01 -07:00
Jess Frazelle
16f60347bc Merge pull request #16407 from Microsoft/10662-fixinfoprocerror
Windows: Fix error in daemon log on info
2015-09-18 16:08:45 -07:00
Antonio Murdaca
0b8b8ed9e9 integration-cli: fix tests with memory limit
If you don't have cgroup swap memory support, `dockerCmd`'s output in
these tests will be polluted by a warning from the daemon and will fail
the tests.
No need to have memory swap support for these tests to run as it will
be reset to -1 and everything will continue correctly.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-19 00:07:40 +02:00
John Howard
8d56108ffb Windows: Fix warning on info
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-18 13:39:12 -07:00
David Calavera
e61abac5fa Merge pull request #16349 from cpuguy83/16302_deprecate_autocreate_binds
deprecate bind path auto-create
2015-09-18 12:53:06 -07:00
michaelhuettermann
3e212eec5e Adding another scientist to the hall of fame.
Signed-off-by: Michael Hüttermann <michael@huettermann.net>
2015-09-18 21:31:12 +02:00
Alexandre Beslic
96f9efc063 Merge pull request #16403 from runcom/fix-containers-json-emtpy-response
Fix GET /containers/json emtpy response regression
2015-09-18 11:47:42 -07:00
Brian Goff
45d7acf237 Merge pull request #16317 from vbatts/vbatts-event-timenano
jsonmessage: add and use TimeNano for events
2015-09-18 14:41:45 -04:00
Doug Davis
848792c42e Fix 'rename' error msg and error checking
`docker rename foo ''` would result in:
```
usage: docker rename OLD_NAME NEW_NAME
```
which is the old engine's way of return errors - yes that's in the
daemon code.  So I fixed that error msg to just be normal.

While doing that I noticed that using an empty string for the
source container name failed but didn't print any error message at all.
This is because we would generate a URL like: ../containers//rename/..
which would cause a 301 redirect to ../containers/rename/..
however the CLI code doesn't actually deal with 301's - it just ignores
them and returns back to the CLI code/caller.

Rather than changing the CLI to deal with 3xx error codes, which would
probably be a good thing to do in a follow-on PR, for this immediate
issue I just added a cli-side check for empty strings for both old and
new names. This way we catch it even before we hit the daemon.

API callers will get a 404, assuming they follow the 301, for the
case of the src being empty, and the new error msg when the destination
is empty - so we should be good now.

Add tests for both cases too.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-18 11:12:22 -07:00
Brian Goff
3dbfb3d38c Ensure stdin does not block after container stop
Fixes #11957
Fixes #12319

Also removes check for Darwin when the stdin reader is closed as it
doesn't appear to block any more.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-09-18 13:48:07 -04:00
Vincent Batts
4026512a2c events/jsonmessage: add and prefer TimeNano for events
This way provide both Time and TimeNano in the event. For the display of
the JSONMessage, use either, but prefer TimeNano Proving only TimeNano
would break Subscribers that are using the `Time` field, so both are set
for backwards compatibility.

The events logging uses nano formatting, but only provides a Unix()
time, therefor ordering may get lost in the output. Example:
```
2015-09-15T14:18:51.000000000-04:00 ee46febd64ac629f7de9cd8bf58582e6f263d97ff46896adc5b508db804682da: (from busybox) resize
2015-09-15T14:18:51.000000000-04:00 a78c9149b1c0474502a117efaa814541926c2ae6ec3c76607e1c931b84c3a44b: (from busybox) resize
```

By having a field just for Nano time, when set, the marshalling back to
`time.Unix(sec int64, nsec int64)` has zeros exactly where it needs to.
This does not break any existing use of jsonmessage.JSONMessage, but now
allows for use of `UnixNano()` and get event formatting that has
distinguishable order. Example:
```
2015-09-15T15:37:23.810295632-04:00 6adcf8ed9f5f5ec059a915466cd1cde86a18b4a085fc3af405e9cc9fecbbbbaf: (from busybox) resize
2015-09-15T15:37:23.810412202-04:00 6b7c5bfdc3f902096f5a91e628f21bd4b56e32590c5b4b97044aafc005ddcb0d: (from busybox) resize
```

Including tests for TimeNano and updated event API reference doc.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-09-18 13:15:26 -04:00
Antonio Murdaca
41646cb4e3 Merge pull request #16389 from HuKeping/stats-zero
Reset data of stats in docker cli when container stopped
2015-09-18 18:59:51 +02:00
Antonio Murdaca
26bd5e3a2d Fix GET /containers/json emtpy response regression
GET /containers/json route used to reply with and empty array `[]` when no
containers where available. Daemon containers list refactor introduced
this bug by declaring an empty slice istead of initializing it as well
and it was now replying with `null`.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-18 18:44:46 +02:00
David Calavera
72eb75a06c Merge pull request #16260 from sunyuan3/comment
Correct wrong comment for TestRunWithoutMemoryswapLimit case.
2015-09-18 09:22:49 -07:00
Phil Estes
c4d4318b82 Merge pull request #16378 from duglin/MoveErrors
Move api/errors/ to errors/
2015-09-18 10:42:12 -04:00
Brian Goff
249f45bcfe deprecate bind path auto-create
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-09-18 10:28:38 -04:00
Harald Albers
5d6ca225d1 bash completion: use generic tag log driver option
Signed-off-by: Harald Albers <github@albersweb.de>
2015-09-18 16:20:05 +02:00
Chris Swan
d09da26f06 Clarify when keys are created and fix missing of
Signed-off-by: Chris Swan <chris.swan@iee.org>

Conflicts:
	docs/security/trust/content_trust.md
2015-09-18 10:10:10 +01:00
Hu Keping
da67833e63 Reset data of stats in docker cli when container stopped
When use `docker stats` to minitor a running container and then stop it,
there are some fields need to be reset to zero. Otherwise it will keep
displaying the data it received last time.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-18 15:24:13 +08:00
Lei Jitang
2bb6b13685 Docs: update the CONTRIBUTING.md
Tell user not to add random `+1`
Remove unecessary `-D` in `docker info`

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-09-17 21:58:34 -04:00
Yuan Sun
cf6a53642a Correct wrong comment for TestRunWithoutMemoryswapLimit case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-09-18 08:28:36 +08:00
moxiegirl
d2e7ba42b1 Merge pull request #15327 from flavio/update-suse-docs
Update SUSE docs
2015-09-17 16:46:26 -07:00