Commit Graph

123 Commits

Author SHA1 Message Date
a1b703934e Fix missing mount ID on volume unmount
Fixes #25331

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 63983f3ffe7895fce3a75115a5bcfe8258e5654c
Component: engine
2016-08-02 11:24:54 -04:00
a43b617d89 Treat HEALTHCHECK NONE the same as not setting a healthcheck
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
Upstream-commit: 4016038bd323a4ef4ee8d0af8da5dafd88ab1721
Component: engine
2016-07-25 11:11:14 -04:00
9921891219 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: edc307cb9213d11d9c5911b08ebd921a097939c0
Component: engine
2016-07-05 20:42:17 +08:00
a0153fe543 Merge pull request #23542 from mavenugo/aliases
Use service alias and configure service VIP or dns-rr
Upstream-commit: 011774e6f0eb5db13fb084b2b8d4d499a9f0548b
Component: engine
2016-06-15 16:18:50 -04:00
52c1999aed Merge pull request #23301 from runcom/tmpfs-trump
daemon: allow tmpfs to trump over VOLUME(s)
Upstream-commit: 480d7b310b2b063621eb260aff34e34171694ae3
Component: engine
2016-06-15 17:11:00 +00:00
eb2bdeb9cf daemon: allow tmpfs to trump over VOLUME(s)
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 756f6cef4a1379e59d6511ee000e435d23659153
Component: engine
2016-06-15 16:01:51 +02:00
e306e601d2 Use service alias and configure container's --net-alias
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 07e39e9e7283a159efa18bc8f72cb2dc0e4f700f
Component: engine
2016-06-14 19:50:34 -07:00
b0143169a4 Merge pull request #23531 from tonistiigi/rm-race
Fix race on force deleting container created by task
Upstream-commit: bd92dd29b9436f4e6a16904e92ce2d965e994d2c
Component: engine
2016-06-15 02:33:56 +00:00
08261c5b09 Fix race on force deleting container created by task
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: dcfe99278db113e79dc037a6f854f4cea9eebe22
Component: engine
2016-06-14 16:49:04 -07:00
6c19b5ff61 Allow user to specify container's link-local addresses
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 1c4efb6aa05026efce99a7a5bb7e710c0f1b3002
Component: engine
2016-06-14 14:28:33 -07:00
be63983b3a Add Swarm management backend
As described in our ROADMAP.md, introduce new Swarm management API
endpoints relying on swarmkit to deploy services. It currently vendors
docker/engine-api changes.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 534a90a99367af6f6bba1ddcc7eb07506e41f774
Component: engine
2016-06-13 22:16:18 -07:00
04ae4edf2f Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

This fix fixes #23459.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a72b45dbec3caeb3237d1af5aedd04adeb083571
Component: engine
2016-06-11 13:16:55 -07:00
763e6c326e *: fix logrus.Warn[f]
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 44ccbb317c2ca67fd8a88147b1ff80ce83d453cc
Component: engine
2016-06-11 19:42:38 +02:00
0b0f7c4ee5 attach: replace interface with simple type
Also add docs to detach events

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 3accde6dee079fbde42f1928002bce43cb15833d
Component: engine
2016-06-03 16:40:43 -07:00
57f1cfe3b1 Add detach event
If we attach to a running container and stream is closed afterwards, we
can never be sure if the container is stopped or detached. Adding a new
type of `detach` event can explicitly notify client that container is
detached, so client will know that there's no need to wait for its exit
code and it can move forward to next step now.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 83ad006d4724929ccbde4bdf768374fad0eeab44
Component: engine
2016-06-03 11:59:11 +08: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
801ed1028f Merge pull request #22384 from yongtang/22358-log-tag-prefix
Remove `docker/` prefix from log messages tag.
Upstream-commit: f3a7abee8107eb13e13dfff959998286b87a34ed
Component: engine
2016-05-30 14:48:31 +02:00
0c9b356dc5 Merge pull request #23030 from Microsoft/jjh/xenonworkdir
Windows: Default isolation and workdir
Upstream-commit: 1d87f788b1d544d388d599316f9999867c4c3c80
Component: engine
2016-05-27 11:31:36 -04:00
6d3d3f4514 Merge pull request #22993 from rhatdan/relabel
Multiple fixes for SELinux labels.
Upstream-commit: 3f6fa8af4522ba9b5ce2e4a52f959970ae4ccb8a
Component: engine
2016-05-26 22:51:17 -04:00
593ac9fc18 Merge pull request #22918 from tonistiigi/image-delete-deadlock
Release memoryStore locks before filter/apply
Upstream-commit: 67767dba6c815764dd7a0cb81b75ba096bf0dd0a
Component: engine
2016-05-26 16:00:39 -05:00
a658ae4b8f Windows: Default isolation and workdir
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6952135fc8004f669c962c5989fd2e5a05bb2510
Component: engine
2016-05-26 13:24:22 -07: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
aa760bc9d4 Multiple fixes for SELinux labels.
SELinux labeling should be disabled when using --privileged mode

/etc/hosts, /etc/resolv.conf, /etc/hostname should not be relabeled if they
are volume mounted into the container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: c3dd6074b0f07cd7e57d677cc06b4c57a302a02f
Component: engine
2016-05-25 16:11:02 -04: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
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
3a35464d9d Get the Docker Engine to build clean on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
Upstream-commit: 86d8758e2bb5e9d21d454ceda90b33feb8e74771
Component: engine
2016-05-23 16:37:12 -07:00
d270b1ba45 Release memoryStore locks before filter/apply
Rework memoryStore so that filters and apply run
on a cloned list of containers after the lock has
been released. This avoids possible deadlocks when
these filter/apply callbacks take locks for a
container.

Fixes #22732

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: bd2b3d363ff7c46e01cce4e6a41d41f24a0047da
Component: engine
2016-05-23 11:45:04 -07:00
f36200bd07 Remove docker/ prefix from log messages tag.
This fix tries to address the issue raised in #22358 where syslog's
message tag always starts with `docker/` and can not be removed
by changing the log tag templates.

The issue is that syslog driver hardcodes `path.Base(os.Args[0])`
as the prefix, which is the binary file name of the daemon (`dockerd`).
This could be an issue for certain situations (e.g., #22358) where
user may prefer not to have a dedicated prefix in syslog messages.
There is no way to override this behavior in the current verison of
the docker.

This fix tries to address this issue without making changes in the
default behavior of the syslog driver. An additional
`{{.DaemonName}}` has been introduced in the syslog tag. This is
assigned as the `docker` when daemon starts. The default log tag
template has also been changed from
`path.Base(os.Args[0]) + "/{{.ID}}"` to `{{.DaemonName}}/{{.ID}}`.
Therefore, there is no behavior changes when log-tag is not provided.

In order to be consistent, the default log tag for fluentd has been
changed from `docker.{{.ID}}` to `{{DaemonName}}.{{.ID}}` as well.

The documentation for log-tag has been updated to reflect this change.

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

This fix fixes #22358.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 38c49d99870c762a0ea23dadda414f9cc59071b6
Component: engine
2016-05-12 22:29:30 -07:00
6a16ddef16 Merge pull request #22279 from WeiZhang555/wait-channel
Remove WaitRunning
Upstream-commit: cf783266ff314a236d3635e86a43d89677ac99ad
Component: engine
2016-05-12 14:56:55 -07:00
13d28f3181 Merge pull request #22353 from Microsoft/jjh/dockercp
Windows: docker cp platform semantically consistent paths
Upstream-commit: b3a1ae02a91d93efdface95ce7ed131dc397dedd
Component: engine
2016-05-11 13:08:24 -10:00
439fdb4635 Windows: docker cp consistent paths
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7f66598583fef21717016610a5708a2ce4bd57fb
Component: engine
2016-05-06 16:08:53 -07:00
24d602b546 Merge pull request #22433 from rhatdan/labels
We should always return the MountLabel
Upstream-commit: 926725b4704e7d050b19d1548322938ae7ad5a10
Component: engine
2016-05-07 00:24:27 +02:00
83644199c7 Merge pull request #21015 from cpuguy83/add_opaque_mount_id
When calling volume driver Mount, send opaque ID
Upstream-commit: bb125650c9fbff03d57c20fd8e4ecde90b3ec326
Component: engine
2016-05-05 18:00:15 +02:00
b06eb99229 Windows: Support ARG in builder
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6b5c83bf18fe406e397c001acb0a1d9d7e147fd9
Component: engine
2016-05-04 14:32:23 -07:00
e351be03d1 We should always return the MountLabel
We need to have labels applied even if a container is running in privileged
mode.  On an tightly locked down SELinux system, this will cause running
without labels will cause SELinux to block privileged mode containers.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 3894773d6edf8127ddf5f811492a9b49673196e7
Component: engine
2016-04-30 05:46:56 -04:00
de046a0cf3 When calling volume driver Mount, send opaque ID
This generates an ID string for calls to Mount/Unmount, allowing drivers
to differentiate between two callers of `Mount` and `Unmount`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 2b6bc294fc7f9e08a9091833b021b7d2a01ad2a6
Component: engine
2016-04-29 09:37:02 -04:00
0ef4e7a04a Remove WaitRunning
Remove function `WaitRunning` because it's actually not necessary, also
remove wait channel for state "running" to avoid mixed use of the state
wait channel.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: a0191a23419121544a2bae941970ff09a0d272bb
Component: engine
2016-04-27 11:36:47 +08:00
7cba2b7aed Merge pull request #22181 from Microsoft/jjh/workdir
Windows: Consistent build workdir handling
Upstream-commit: 2b97201e0cd8301484fde379d2bf7f0ad3f36f10
Component: engine
2016-04-26 16:51:09 -07:00
51ef85c587 Windows: Consistent build workdir handling
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0433801093f1988db0e210e28352f4af71a0ac81
Component: engine
2016-04-26 15:32:52 -07:00
e49ce8b3dd Merge pull request #22125 from crosbymichael/restart-timeout
Reset restart timeout if execution longer than 10s
Upstream-commit: 17d5c97c900d90bee7a1ba4182bf9ea51e5c386d
Component: engine
2016-04-25 19:15:32 +02:00
c197f20a8a Reset restart timeout if execution longer than 10s
Restore the 1.10 logic that will reset the restart manager's timeout or
backoff delay if a container executes longer than 10s reguardless of
exit status or policy.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: b6db56b5eba00c4e8ad7a6f6c5b018e15dc883eb
Component: engine
2016-04-22 10:37:34 -07:00
e3c27e0ed4 Safer file io for configuration files
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ea3cbd3274664f5b16fce78d7df036f6b5c94e30
Component: engine
2016-04-21 11:31:15 -07:00
c47b0699eb Clean up unused code
Signed-off-by: Akihiro Suda <suda.kyoto@gmail.com>
Upstream-commit: d231260868507174d60ff58b18b14fa5bc2d5b66
Component: engine
2016-04-14 07:04:10 +00:00
c018129666 Fix ShouldRestart for on-failure handle
Currently if you restart docker daemon, all the containers with restart
policy `on-failure` regardless of its `RestartCount` will be started,
this will make daemon cost more extra time for restart.

This commit will stop these containers to do unnecessary start on
daemon's restart.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 51e42e6ee01eb4b5c8c7678e2fc7be0f13ef6a68
Component: engine
2016-04-10 15:44:47 +08:00
c71898566b fix typo
Signed-off-by: Ling FaKe <lingfake@huawei.com>
Upstream-commit: d0344731ef11a5951c86f444ac40e27f2472db01
Component: engine
2016-04-08 22:08:58 +08:00
3b340912c5 Fix restart monitor stopping on manual restart
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 20390f65c487cfbe18e1f21650086a00e41eadff
Component: engine
2016-04-07 16:12:05 -07:00
0894026fe2 Don't throw error on clenaup ipc mounts if it does not exists
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 5bd1786387bdb0af2e665fecde3ac08f8db61008
Component: engine
2016-04-06 07:34:31 -04:00
b5af51fa11 daemon: remove some unused code
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: b9966f3a81e89640d0de8fa5ae8d38213df0b8fe
Component: engine
2016-03-31 11:24:12 -07:00
35980664e6 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6983f05b42527dec87de9b2ecaf1d948038860fc
Component: engine
2016-03-26 22:06:45 +08:00
308c81e7d4 Add explicit flags for volume cp/no-cp
This allows a user to specify explicitly to enable
automatic copying of data from the container path to the volume path.
This does not change the default behavior of automatically copying, but
does allow a user to disable it at runtime.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b0ac69b67ef79c6c937f84bee3df20a1924ad334
Component: engine
2016-03-21 20:38:44 -04:00