Commit Graph

3344 Commits

Author SHA1 Message Date
5578aba972 Merge pull request #23193 from allencloud/fix-typos
use grep to find all a/an typos
Upstream-commit: 98c245c9e63793cf8ca03c5500e0820447c1861c
Component: engine
2016-06-02 18:45:08 -07:00
4524589dc5 Add support for user-defined healthchecks
This PR adds support for user-defined health-check probes for Docker
containers. It adds a `HEALTHCHECK` instruction to the Dockerfile syntax plus
some corresponding "docker run" options. It can be used with a restart policy
to automatically restart a container if the check fails.

The `HEALTHCHECK` instruction has two forms:

* `HEALTHCHECK [OPTIONS] CMD command` (check container health by running a command inside the container)
* `HEALTHCHECK NONE` (disable any healthcheck inherited from the base image)

The `HEALTHCHECK` instruction tells Docker how to test a container to check that
it is still working. This can detect cases such as a web server that is stuck in
an infinite loop and unable to handle new connections, even though the server
process is still running.

When a container has a healthcheck specified, it has a _health status_ in
addition to its normal status. This status is initially `starting`. Whenever a
health check passes, it becomes `healthy` (whatever state it was previously in).
After a certain number of consecutive failures, it becomes `unhealthy`.

The options that can appear before `CMD` are:

* `--interval=DURATION` (default: `30s`)
* `--timeout=DURATION` (default: `30s`)
* `--retries=N` (default: `1`)

The health check will first run **interval** seconds after the container is
started, and then again **interval** seconds after each previous check completes.

If a single run of the check takes longer than **timeout** seconds then the check
is considered to have failed.

It takes **retries** consecutive failures of the health check for the container
to be considered `unhealthy`.

There can only be one `HEALTHCHECK` instruction in a Dockerfile. If you list
more than one then only the last `HEALTHCHECK` will take effect.

The command after the `CMD` keyword can be either a shell command (e.g. `HEALTHCHECK
CMD /bin/check-running`) or an _exec_ array (as with other Dockerfile commands;
see e.g. `ENTRYPOINT` for details).

The command's exit status indicates the health status of the container.
The possible values are:

- 0: success - the container is healthy and ready for use
- 1: unhealthy - the container is not working correctly
- 2: starting - the container is not ready for use yet, but is working correctly

If the probe returns 2 ("starting") when the container has already moved out of the
"starting" state then it is treated as "unhealthy" instead.

For example, to check every five minutes or so that a web-server is able to
serve the site's main page within three seconds:

    HEALTHCHECK --interval=5m --timeout=3s \
      CMD curl -f http://localhost/ || exit 1

To help debug failing probes, any output text (UTF-8 encoded) that the command writes
on stdout or stderr will be stored in the health status and can be queried with
`docker inspect`. Such output should be kept short (only the first 4096 bytes
are stored currently).

When the health status of a container changes, a `health_status` event is
generated with the new status. The health status is also displayed in the
`docker ps` output.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b6c7becbfe1d76b1250f6d8e991e645e13808a9c
Component: engine
2016-06-02 23:58:34 +02:00
44649a5cdf Merge pull request #23140 from Microsoft/HcsshimRevendor
Revendor hcsshim
Upstream-commit: eb9274844efd5e08226a98de79f0f5237a6e2458
Component: engine
2016-06-02 22:09:19 +02:00
35c5774373 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: c1be45fa38e82054dcad606d71446a662524f2d5
Component: engine
2016-06-02 17:17:22 +08:00
e0398fafd2 Merge pull request #22769 from dnephin/integrate_cobra
Use spf13/cobra for the cli
Upstream-commit: 28676fc04b9a307718b66bd28e8d9281d05f38ac
Component: engine
2016-06-01 14:18:23 -07:00
5dcdbc4a5a Remove deprecated -f flag on docker tag
The -f flag on docker tag has been deprecated in docker 1.10 and
is expected to be removed in docker 1.12.

This fix removed the -f flag on docker tag and also updated
deprecated.md.

NOTE: A separate pull request for engine-api has been opened to
cover the related changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4455ec14b87d5ad474c5e11d60907bceb35e9e09
Component: engine
2016-06-01 09:44:25 -07:00
67d0b2dc23 remove deprecated feature of passing HostConfig at API container start
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: 0a8386c8be3fa87b7523bef7fd31c81a7f84709c
Component: engine
2016-06-01 22:25:17 +08:00
93473dcef1 Use Args in cobra.Command to validate args.
Also re-use context.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: fc5a4514fbe1b402d2a0bff170486ac3de4bf8cc
Component: engine
2016-05-31 15:43:16 -07:00
e8454769c2 Revendor hcsshim
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: d96e36cbbfb076f4adb967644e7d6e2da73eb0ec
Component: engine
2016-05-31 14:42:01 -07:00
041d2192d1 Update usage and help to (almost) match the existing docker behaviour
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 667dcb0e8e550d1a80ee67c6d71979e8cfabea1f
Component: engine
2016-05-31 14:41:37 -07:00
df33adb751 Merge pull request #22103 from coolljt0725/fix_22093
Fix docker create with duplicate volume failed to remove
Upstream-commit: edcc9577bf95c2eeaa15955e7b1c00a18cec7cb6
Component: engine
2016-05-30 15:57:13 +02:00
6240c16449 make the error message in TestRunSeccompDefaultProfile more precise
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: f80bfdf85ca3463f59c93bf73c484f42c308fa8b
Component: engine
2016-05-28 09:06:25 +08:00
084d431873 Split the Seccomp tests into two
The Seccomp tests ran 11 tests in parallel and this appears to be
hitting some sort of bug on CI. Splitting into two tests means that
I can no longer repeoduce the failure on the slow laptop where I could
reproduce the failures before.

Obviously this does not fix the underlying issue, which I will
continue to investigate, but not having the tests failing a lot
before the freeze for 1.12 would be rather helpful.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: cfca3255a83c7cbaeaa623617bf71688723b21aa
Component: engine
2016-05-27 15:38:29 -07:00
c18e25c7fa Merge pull request #22716 from jmzwcn/issue22466-patches
Embedded DNS problem after renaming container. Step2:change in docker…
Upstream-commit: 4441a6c4c68f6ec7acb0e2d92d72274fbf403425
Component: engine
2016-05-27 23:27:42 +02:00
b822217717 Merge pull request #22912 from duglin/FixImportTest
Fix docker import test
Upstream-commit: fd7ec4b9e58fe5ba4abab4f60b63552e11246f3c
Component: engine
2016-05-27 14:03:44 -07:00
561b16903d Merge pull request #22438 from yongtang/22420-inconsistent-tmpfs-behavior
Inconsistent --tmpfs behavior
Upstream-commit: ec3ccde18bb2b46f9d2e74fad61e7286aa292123
Component: engine
2016-05-27 15:54:37 -04:00
148efb277e Merge pull request #22376 from vdemeester/use-dockerd-in-integration-cli
Use dockerd instead of docker daemon in integration-cli
Upstream-commit: 01409bf069a4fbf8ebcbd27e2333a9d61d462138
Component: engine
2016-05-27 10:09:43 -07:00
d2f37ef500 Merge pull request #22984 from Microsoft/jjh/ttymessage
Better error on attach no tty
Upstream-commit: 24d2ee8c485dc2a580ee57e3afc076dda307e3c8
Component: engine
2016-05-27 16:57:36 +02:00
0e099055bb Inconsistent --tmpfs behavior
This fix tries to address the issue raised in #22420. When
`--tmpfs` is specified with `/tmp`, the default value is
`rw,nosuid,nodev,noexec,relatime,size=65536k`. When `--tmpfs`
is specified with `/tmp:rw`, then the value changed to
`rw,nosuid,nodev,noexec,relatime`.

The reason for such an inconsistency is because docker tries
to add `size=65536k` option only when user provides no option.

This fix tries to address this issue by always pre-progating
`size=65536k` along with `rw,nosuid,nodev,noexec,relatime`.
If user provides a different value (e.g., `size=8192k`), it
will override the `size=65536k` anyway since the combined
options will be parsed and merged to remove any duplicates.

Additional test cases have been added to cover the changes
in this fix.

This fix fixes #22420.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 397a6fefadf9ac91a5c9de2447f4dea607296470
Component: engine
2016-05-26 19:28:18 -07:00
5bcb28804b Merge pull request #22268 from Microsoft/jjh/continuationescape
Support platform semantic file paths through ESCAPE
Upstream-commit: 8e924153e219d040e3aa672df4e0c7baff9f8d8b
Component: engine
2016-05-26 10:00:56 -07:00
f408291a41 Use dockerd instead of docker daemon in integration-cli
Updating `integration-cli/daemon.go` to use `dockerd` instead of `docker
daemon` to start up the daemon.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f87053b9c387a5a577383c758dc901cb8bf539e2
Component: engine
2016-05-26 13:14:35 +02:00
898abb33e0 Embedded DNS problem after renaming container. Step2:change in docker/daemon side and add integration test
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
Upstream-commit: be072a89544300a484970fd95207bdb93c5c7d9e
Component: engine
2016-05-26 12:59:44 +08:00
611bbe573a Update port info on network connect/disconnect
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: f198dfd856ca6125ef50b11d9d698550d66c9d4e
Component: engine
2016-05-25 17:02:50 -07:00
c1a0ccd035 Better error on attach no tty
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f7541b00b0f68a52195ed9bac967f8f08d96aa51
Component: engine
2016-05-25 13:32:48 -07:00
0635a7e10b Merge pull request #22908 from vdemeester/7967-since-before-image-filters
Add before and since filter to images
Upstream-commit: 0fe4417a3b2c18714303f319224b74ec08674115
Component: engine
2016-05-25 20:15:23 +02:00
e94aa3f2ac Merge pull request #22943 from vdemeester/21769-fix-detach-keys
Fix escape-keys by preserving input if invalid
Upstream-commit: 60abc96acfeae1985f4f0e9e9b44376b75a235f0
Component: engine
2016-05-25 09:53:53 -07:00
ac5e68234e Merge pull request #22916 from duglin/FixNetTest
Fix flaky TestApiStatsNetworkStats test
Upstream-commit: 004ce6b57124c1a99348e1447ac9e00a970d1b34
Component: engine
2016-05-25 18:51:47 +02:00
504a2ff9e3 Merge pull request #22953 from Microsoft/jjh/TestRunWorkingDirectory
Windows: Fix TestRunWorkingDirectory
Upstream-commit: 8c70ab803c49816de8124703db6635e9c5c7ce25
Component: engine
2016-05-25 17:54:39 +02:00
6eea85e6f1 Merge pull request #22960 from justincormack/seccompdefnotarm
Do not run the seccomp tests that use default.json on non x86 architectures
Upstream-commit: 4d376e9cc265c098c7faf03d0e75c1164cbf24e0
Component: engine
2016-05-25 17:20:16 +02:00
9fc37c22c9 Add before and since filter to images
Add support for two now filter on the `images` command : `before` and
`since`. They work the same as the one on the `ps` command but for
images.

        $ docker images --filter before=myimage
        # display all images older than myimage
        $ docker images --filter since=myimage
        # display all images younger than myimage

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 750e16f57c0121aa8cdad1763f0bb6e54b8c6d75
Component: engine
2016-05-25 13:49:10 +02:00
3e8a3ed291 Merge pull request #22962 from normalfaults/b
fixed spelling error in windows.go
Upstream-commit: 2a4b4a813342294a6191425caba471a94c8a39f6
Component: engine
2016-05-25 12:21:08 +02:00
5912cc64b5 Merge pull request #22952 from tophj-ibm/multiarch_daemon_test_fix
Multi-arch: fix TestBuildOnDisabledBridgeNetworkDaemon
Upstream-commit: cd159fba8529efe70ea634842a024560dbfd3aec
Component: engine
2016-05-25 10:19:41 +02:00
b520646fdd The option --add-host and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--add-host` and `--net=host` to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 90bd41a74d57080711678bffa2bc4371020ee3a5
Component: engine
2016-05-24 18:49:11 -07:00
b39fa693a7 Merge branch 'master' into b
Upstream-commit: 59bb86a964c38d0f2cc724c686803472bb48968b
Component: engine
2016-05-24 21:43:45 -04:00
3d16c1ca14 fixed spelling error in docker cli run test
Signed-off-by: Nirmal Mehta <nirmalkmehta@gmail.com>
Upstream-commit: f91acbaee452191f406d31e3f3fd44210aa17fbf
Component: engine
2016-05-24 21:43:22 -04:00
4d6727d7fe Do not run the seccomp tests that use default.json on non x86 architectures
The generated profile that we check in is for amd64 and i386 architectures
and does not work correctly on arm as it is missing required syscalls,
and also specifies the architectures that are supported. It works on
ppc64le at the moment but better to skip the test as it is likely to
break in future.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 75385dc216e784d24535326376352de03eaeb059
Component: engine
2016-05-24 17:47:30 -07:00
e230ff1485 The option --dns, --dns-search, --dns-opt and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--dns`, `--dns-search`, `--dns-opt` and `--net=host`
to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 23821fe5867427fa36c265bc994b1a2c3cf9b21f
Component: engine
2016-05-24 16:03:26 -07:00
f99c99aaac Windows: Fix TestRunWorkingDirectory
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 257494bd0a017cad264609f1a77b9af3ab7f991c
Component: engine
2016-05-24 15:13:06 -07:00
2e5b933fb0 Multi-arch: fix TestBuildOnDisabledBridgeNetworkDaemon
Fixes the test by loading in the architecture specific busybox
image when the test daemon starts.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 7832e2ae82ae56e9719c6930b054f643285a79b3
Component: engine
2016-05-24 16:33:49 -04:00
0ec1e0058a Merge pull request #22932 from chenchun/fix_build
Fix building image  error if bridge network is disabled
Upstream-commit: 38217d43531c721da952a9de2a89b08397f7c029
Component: engine
2016-05-24 10:33:34 -07:00
8813b32a1c Fix escape-keys by preserving input if invalid
Currently, using a custom detach key with an invalid sequence, eats a
part of the sequence, making it weird and difficult to enter some key
sequence.

This fixes by keeping the input read when trying to see if it's the key
sequence or not, and "writing" then is the key sequence is not the right
one, preserving the initial input.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0fb6190243d6101f96283e487cd4911142a05483
Component: engine
2016-05-24 17:14:48 +02:00
850246a4c4 Merge pull request #22590 from yongtang/22463-docker-daemon-events
Emit events for docker daemon
Upstream-commit: d76d38c7d028754c48f842e4631c2d897e63198d
Component: engine
2016-05-24 11:05:39 +02:00
6717a252a9 Fix building image error if bridge network is disabled
Signed-off-by: Chun Chen <ramichen@tencent.com>
Upstream-commit: a8d013495c479cdc18fa7751413ef67334f37ee6
Component: engine
2016-05-24 16:20:26 +08:00
d6f4430048 Merge pull request #22541 from crosbymichael/graph-restore
Implement graph driver restore on reboot
Upstream-commit: d7dfe9103bfc275494d936a5d89f3067b0aedbc9
Component: engine
2016-05-23 22:57:23 -07:00
fe4d79b993 Add filter for events emitted by docker daemon
This fix tries to cover the issue raised in #22463 by adding
filter for events emitted by docker daemon so that user could
utilize filter to receive events of interest.

Documentations have been updated for this fix.

Additional tests have been added to cover the changes in this fix.

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 62014aaf9abeb4256cb66e7ae06bfdf5a77d1140
Component: engine
2016-05-23 19:00:47 -07:00
e954a0d7e9 Emit events for docker daemon
This fix tries to cover the issue raised in #22463 by emitting
events for docker daemon so that user could be notified by
scenarios like config reload, etc.

This fix adds the `daemon reload`, and events for docker daemon.

Additional tests have been added to cover the changes in this fix.

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 382c152a73dfa1d771334ffbe79759c5c3596144
Component: engine
2016-05-23 19:00:47 -07:00
c78b55f0c1 Fix flaky TestApiStatsNetworkStats test
It appears that on some systems apparmor gets in the way of libc.so.6
shared library being loaded - which means the ping fails.

To get around this if we run ping under `/lib64/ld-linux-x86-64.so.2`
then it works.  So we only do this for linux and only if the first attempt
fails. If this 2nd attempt fails then we'll show the original error to
the user for debugging.

Also s/Output/CombinedOutput/ to help debugging in the future. It didn't
show the real error msg.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 94d057130461b3b56957b2755da9dae00a937e81
Component: engine
2016-05-23 19:00:19 -07:00
f066a59cec Fix error channel size in seccomp test
This was not changed when the additional tests were added.
It may be the reason for occasional test failures.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 3598f2e33198686f0afa08aca640dbda8697fcb2
Component: engine
2016-05-23 18:14:55 -07:00
e6822e5504 Remove restart test
This test is not applicable anymore now that containers are not stopped
when the daemon is restored.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 31e903b0e17d01a4240f7890218a80088d32658c
Component: engine
2016-05-23 15:57:23 -07:00
978bdd6270 Fix docker import tests
For me when I run the test I see:
```
Downloading from http://nourl/bad
Importing    283 B
Untar re-exec error: exit status 1: output: unexpected EOF
```
and nothing about "dial tcp" so it appears that the output is
system dependent and therefore we can't really check it. I think
checking for non-zero exit code is sufficient so I'm removing this
string check.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: ac043c7db67f268e96c7c7d0236d5316f3a2d9ac
Component: engine
2016-05-23 15:34:40 -07:00