Commit Graph

135 Commits

Author SHA1 Message Date
7bef93723c Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
Upstream-commit: d8fef66b03c1ea8715470690efbd950033f7f628
Component: engine
2016-09-08 21:31:52 -04:00
f0d30a4b26 Add support for docker run in swarm mode overlay
This PR adds support for running regular containers to be connected to
swarm mode multi-host network so that:
    - containers connected to the same network across the cluster can
      discover and connect to each other.
    - Get access to services(and their associated loadbalancers)
      connected to the same network

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: 99a98ccc14a9427be47c8006e130750710db0a16
Component: engine
2016-09-07 21:20:41 -07:00
45ddc4bfcb Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 91e197d614547f0202e6ae9b8a24d88ee131d950
Component: engine
2016-09-07 11:05:58 -07:00
ba213d0956 Re-export container state's ExitCode and Error fields
Those are needed in order to reload their value upon docker daemon
restart.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 2998945a54577e24a6414d576bc861e58fa87359
Component: engine
2016-08-30 14:17:09 -07:00
6b76ab7e83 We need to relabel newly created container volumes
This will add a label to any volume that is shared into a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 5a277c8a4a9107f18211aabd6e332dbafb1a8469
Component: engine
2016-08-24 08:27:01 -04:00
165357a3a8 Persist pause state to disk to support container live restore
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: f4bbfc34ce1785863dcdea44c981f6532c5e2860
Component: engine
2016-08-19 05:32:33 -04:00
c8732c07e1 expose RemovalInProgress in StateString #25652
Signed-off-by: timfeirg <kkcocogogo@gmail.com>
Upstream-commit: 37466cc8c85ccbdade57463ae2aacac638002f8a
Component: engine
2016-08-18 11:25:27 +08:00
a0933c7d27 Merge pull request #25721 from cpuguy83/revendor_engine-api
revendor engine-api
Upstream-commit: 37302bbb3f4889e9de2a95d5ea018acdab9e4447
Component: engine
2016-08-16 17:18:43 -04:00
3dcc0abf19 revendor engine-api
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 6d98e344c7702a8a713cb9e02a19d83a79d3f930
Component: engine
2016-08-16 14:16:12 -04:00
d1bde01a82 Forbid update restart policy of container with AutoRemove flag
"--restart" and "--rm" are conflict options, if a container is started
with AutoRemove flag, we should forbid the update action for its Restart
Policy.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 4754c64ab5b5bf5ae6f8a3040606296910e6cb19
Component: engine
2016-08-16 15:36:13 +08:00
7c36224e9c test container state timeout with 200 milliseconds
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 51f927d4e5007d11d71a9cd68a6b1e93828becc5
Component: engine
2016-08-10 17:19:25 +08:00
2dac8a0018 Fix update memory without memoryswap
The memory should always be smaller than memoryswap,
we should error out with message that user know how
to do rather than just an invalid argument error if
user update the memory limit bigger than already set
memory swap.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 92394785fa3e55b19402fc762c030d28b36b6cfc
Component: engine
2016-08-08 18:36:03 +08:00
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