Commit graph

4055 commits

Author SHA1 Message Date
Brian Goff
4edb83f4fd Merge pull request #26079 from allencloud/unpause-container-no-running
remove running judgement when unpause container
2016-08-29 10:30:40 -04:00
Brian Goff
d09c04a667 Merge pull request #25317 from yongtang/25304-docker-service-create-group
Support `--group` in `docker service create`
2016-08-29 10:27:31 -04:00
allencloud
52637848a7 correct some nits in comment and test files
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-29 18:37:14 +08:00
allencloud
0bac72e4bd remove running judgement when unpause container
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-29 10:16:18 +08:00
Arnaud Porterie
9ea28ea894 Merge pull request #26055 from mavenugo/ndn
Support container disconnect for non-existing network
2016-08-28 01:48:02 +00:00
Yong Tang
b31969ee36 Support --group-add and --group-rm in docker service create/update
This fix tries to address the issue raised in 25304 to support
`--group-add` and `--group-rm` in `docker service create`.

This fix adds `--group-add` to `docker service create` and `docker service update`,
adds `--group-rm` to `docker service update`.

This fix updates docs for `docker service create` and `docker service update`:
1. Add `--group-add` to `docker service create` and `docker service update`
2. Add `--group-rm` to `docker service update`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-27 11:54:05 -07:00
allencloud
5d6023cf8e add warning in containerCreate response
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-27 10:49:26 +08:00
Madhu Venugopal
05a3f2666e Support container disconnect for non-existing network
There are cases such as migrating from classic overlay network to the
swarm-mode networking (without kv-store), such a mechanism to allow
disconnecting a container even when a network isnt available will be
useful.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-08-26 16:48:52 -07:00
Michael Crosby
07328cf3f6 Merge pull request #26005 from q384566678/branch-test
Optimize the restart function code
2016-08-26 15:14:49 -07:00
Michael Crosby
a020ec4c8b Check for non-nil container after match
There can be a race between getting the container ids for matches and
getting the actual container.  This makes sure that we check that the
container returned by `Get` is non-nil before adding it to the list of
matches.

Fixes #25991

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-26 10:02:10 -07:00
Michael Crosby
1dc87122cc Merge pull request #26045 from runcom/systemd-cgroup-fix
daemon: ensure systemd cgroup is passed down to runtimes
2016-08-26 09:59:22 -07:00
Aaron Lehmann
cbd4e4d48a Merge pull request #24514 from cpuguy83/fix_log_follow_rotate
Fix issues with tailing rotated jsonlog file
2016-08-26 09:47:40 -07:00
Antonio Murdaca
7f88fca48e
daemon: ensure systemd cgroup is passed down to runtimes
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-08-26 15:33:26 +02:00
zhouhao
870cf1096f Optimize the restart function code
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2016-08-26 14:22:39 +08:00
Yong Tang
c7045eb935 Validate --ip and --ip6 for docker create
This fix tries to fix the issue raised in 25863 where `--ip` value
is not validated for `docker create`. As a result, the IP address
passed by `--ip` is not used for `docker create` (ignored silently).

This fix adds validation in the daemon so that `--ip` and  `--ip6`
are properly validated for `docker create`.

An integration test has been added to cover the changes.

This fix fixes 25863.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-25 22:11:23 -07:00
Daniel Nephin
25587906d1 Merge pull request #25354 from dnephin/remove-mflag-from-dockerd
Convert docker and dockerd commands to spf13/cobra
2016-08-25 17:19:19 -04:00
Vincent Demeester
29232a5d8e Merge pull request #25888 from vdemeester/listcontainerfornode-refactoring
Move ListContainersForNode into cluster package
2016-08-25 19:10:18 +02:00
Daniel Nephin
6e7405ebd4 Fix tests and windows service.
Support args to RunCommand
Fix docker help text test.
Fix for ipv6 tests.
Fix TLSverify option.
Fix TestDaemonDiscoveryBackendConfigReload
Use tempfile for another test.
Restore missing flag.
Fix tests for removal of shlex.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:36 -04:00
Daniel Nephin
14712f9ff0 Remove old cli framework.
Also consolidate the leftover packages under cli.
Remove pkg/mflag.
Make manpage generation work with new cobra layout.
Remove remaining mflag and fix tests after rebase with master.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:04 -04:00
Daniel Nephin
31bf9ca0c8 Update unit tests for new cobra root command.
Cleanup cobra integration
Update windows files for cobra and pflags
Cleanup SetupRootcmd, and remove unnecessary SetFlagErrorFunc.
Use cobra command traversal

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:04 -04:00
Daniel Nephin
fb83394714 Convert dockerd to use cobra and pflag
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-25 13:09:03 -04:00
Brian Goff
15f3d060ac Merge pull request #24153 from frodenas/syslog-fix
Syslog Driver: RFC 5425 Message Framing should be used only when protocol is TCP+TLS
2016-08-25 12:15:06 -04:00
Alexander Morozov
78771b6225 Merge pull request #25786 from splunk/splunk-logging-driver-raw-format-using-json
Splunk Logging Driver: formats and verifyconnection
2016-08-25 09:12:31 -07:00
Vincent Demeester
d13ad3ef76 Merge pull request #24073 from johnharris85/move-restart-policy-check-to-daemon
Move restart-policy validation from client to daemon.
2016-08-25 17:02:30 +02:00
Vincent Demeester
8ebb7dba8b Merge pull request #25920 from coolljt0725/fix_inspect_dead
Fix inspect Dead container
2016-08-25 17:00:59 +02:00
Brian Goff
4844d13bd7 Merge pull request #25933 from dtrott/25932-container-name
Added the word "container" to clarify the error message.
2016-08-24 16:15:10 -04:00
Vincent Demeester
4a1b048c15 Merge pull request #25959 from estesp/fail-on-graphdir-perms
Don't start daemon in userns mode if graphdir inaccessible
2016-08-24 20:15:58 +02:00
Phil Estes
43a1df6be2
Don't start daemon in userns mode if graphdir inaccessible
Warn the user and fail daemon start if the graphdir path has any
elements which will deny access to the remapped root uid/gid.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-08-24 11:25:30 -04:00
Antonio Murdaca
7ca635a1ec
daemon: no map[string]bool from GetNetworkDriverList
No user of GetNetworkDriverList needs to access the map by key.
The only user of GetNetworkDriverList is in docker info and with a map
the network list is always flipping because loop is not deterministic.
Fix this by returning a string slice which instead is.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-08-24 16:02:15 +02:00
Yong Tang
7bb9c5397e Fix issue in docker stats with NetworkDisabled=true
This fix tries to address the issue in 25000 where `docker stats`
will not show network stats with `NetworkDisabled=true`.

The `NetworkDisabled=true` could be either invoked through
remote API, or through `docker daemon -b none`.

The issue was that when `NetworkDisabled=true` either by API or
by daemon config, there is no SandboxKey for container so an error
will be returned.

This fix fixes this issue by skipping obtaining SandboxKey if
`NetworkDisabled=true`.

Additional test has bee added to cover the changes.

This fix fixes 25000.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-23 16:04:06 -07:00
Alexander Morozov
251bc2bcd7 Merge pull request #25833 from tonistiigi/update-swarmkit
vendor: update swarmkit to 8a761950f
2016-08-22 19:36:44 -07:00
Lei Jitang
c35186b0b9 Fix inspect Dead container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-08-22 22:09:25 -04:00
David Trott
c9d0a77657 Added the word "container" to clarify the error message.
Signed-off-by: David Trott <github@davidtrott.com>
2016-08-22 13:41:17 -07:00
Alexander Morozov
2e1a594237 Merge pull request #25824 from dmcgowan/overlay2-make-faster
Avoid fork on mount for overlay2 in common case
2016-08-22 13:02:22 -07:00
Derek McGowan
c13a985fa1 Avoid fork on mount for overlay2 in common case
In the common case where the user is using /var/lib/docker and
an image with less than 60 layers, forking is not needed. Calculate
whether absolute paths can be used and avoid forking to mount in
those cases.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-08-22 11:43:10 -07:00
Tonis Tiigi
96a27cf093 Update executor changes from swarmkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-22 11:36:20 -07:00
Brian Goff
374caa98d8 Merge pull request #25872 from coolljt0725/fix_25870
Persist pause state to disk to support container live restore
2016-08-22 12:18:01 -04:00
Brian Goff
43640a890f Merge pull request #25889 from vdemeester/refactoring-reachable-lisibility
Make reachable/unreachable condition more readable
2016-08-22 11:10:03 -04:00
Vincent Demeester
4833b3c961
Move ListContainersForNode into cluster package
It makes little sense to have swarm related code into the daemon
package. This refactor the `daemon` and `cluster` package to remove
`ListContainersForNode` from the daemon.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-20 14:14:26 +02:00
Vincent Demeester
82a451bc94
Make reachable/unreachable condition more readable
Introducing methods to make the intent of the condition clearer to the
eyes of the reader 👼.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-19 22:49:58 +02:00
Brian Goff
4d95ea319c Use daemon exec root for swarm control socket
Right now docker puts swarm's control socket into the docker root dir
(e.g. /var/lib/docker).
This can cause some nasty issues with path length being > 108
characters, especially in our CI environment.

Since we already have some other state going in the daemon's exec root
(libcontainerd and libnetwork), I think it makes sense to move the
control socket to this location, especially since there are other unix
sockets being created here by docker so it must always be at a path that
works.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-19 16:43:57 -04:00
Lei Jitang
f4bbfc34ce Persist pause state to disk to support container live restore
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-08-19 05:32:33 -04:00
Yong Tang
6c5c34d50d Add --force in docker volume rm to fix out-of-band volume driver deletion
This fix tries to address the issue in raised #23367 where an out-of-band
volume driver deletion leaves some data in docker. This prevent the
reuse of deleted volume names (by out-of-band volume driver like flocker).

This fix adds a `--force` field in `docker volume rm` to forcefully purge
the data of the volume that has already been deleted.

Related documentations have been updated.

This fix is tested manually with flocker, as is specified in #23367.
An integration test has also been added for the scenario described.

This fix fixes #23367.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-18 18:01:25 -07:00
Denis Gladkikh
9407322972 Splunk Logging Driver: PR feedback
Signed-off-by: Denis Gladkikh <denis@gladkikh.email>
2016-08-18 09:17:06 -07:00
Vincent Demeester
3cebff8b86 Merge pull request #25785 from WeiZhang555/fix-flaky-external-volume-driver
bugfix: report "destroy" after all volumes of container destroy
2016-08-18 09:58:54 +02:00
Michal Wieczorek
eac70703e3 Enable syslog driver for windows
Signed-off-by: Michal Wieczorek <wieczorek-michal@wp.pl>
2016-08-17 22:26:24 +02:00
Michael Crosby
041e5a21dc Replace old oci specs import with runtime-specs
Fixes #25804

The upstream repo changed the import paths.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-17 09:38:34 -07:00
Phil Estes
3473980a29 Merge pull request #25771 from mrunalp/allow_host_ns_with_user
Allow using --pid=host and --net=host when --userns=host
2016-08-17 09:57:30 -04:00
Denis Gladkikh
603fd08315 Splunk Logging Driver: formats and verifyconnection
`--log-opt splunk-format=inline|json|raw` allows to change how logging
driver sends data to Splunk, where

`inline` - default value, format used before, message is injected as a
line in JSON payload
`json` - driver will try to parse each line as a JSON object and embed it
inside of the JSON payload
`raw` - driver will send Raw payload instead of JSON, tag and attributes
will be prefixed before the message

`--log-opt splunk-verify-connection=true|false` - allows to skip
verification for Splunk Url

Signed-off-by: Denis Gladkikh <denis@gladkikh.email>
2016-08-16 21:45:16 -07:00
Zhang Wei
4df77c11e0 bugfix: report "destroy" after all volumes of container destroy
fixes #25766

If a container's AutoRemove is enabled, client will wait until it's
removed after container exits, this is implemented based on "destroy"
event.

Currently an "AutoRemove" container will report "destroy" event to
notify a hanging client to exit before all volumes are removed, this is
wrong, we should wait container until everything is cleaned up.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-17 11:02:16 +08:00
Brian Goff
37302bbb3f Merge pull request #25721 from cpuguy83/revendor_engine-api
revendor engine-api
2016-08-16 17:18:43 -04:00
Mrunal Patel
3c3d2bf852 Allow using --pid=host and --net=host when --userns=host
It is safe to set other namespaces to host when user ns is set to host

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-08-16 14:16:14 -07:00
Brian Goff
6d98e344c7 revendor engine-api
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-16 14:16:12 -04:00
Brian Goff
d7753dceb8 Merge pull request #25746 from lixiaobing10051267/masterName
wrong id when testing exists in daemon aufs
2016-08-16 13:00:03 -04:00
lixiaobing10051267
cdb6c59eda wrong id when testing exists in daemon aufs
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-08-16 16:42:45 +08:00
Brian Goff
84e60a7e10 Fix issues with tailing rotated jsonlog file
Fixes a race where the log reader would get events for both an actual
rotation as we from fsnotify (`fsnotify.Rename`).
This issue becomes extremely apparent when rotations are fast, for
example:

```
$ docker run -d --name test --log-opt max-size=1 --log-opt max-file=2
busybox sh -c 'while true; do echo hello; usleep 100000; done'
```

With this change the log reader for jsonlogs can handle rotations that
happen as above.

Instead of listening for both fs events AND rotation events
simultaneously, potentially meaning we see 2 rotations for only a single
rotation due to channel buffering, only listen for fs events (like
`Rename`) and then wait to be notified about rotation by the logger.
This makes sure that we don't see 2 rotations for 1, and that we don't
start trying to read until the logger is actually ready for us to.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-15 13:57:28 -04:00
Serge Hallyn
617c352e92 Don't create devices if in a user namespace
If we are running in a user namespace, don't try to mknod as
it won't be allowed.  libcontainer will bind-mount the host's
devices over files in the container anyway, so it's not needed.

The chrootarchive package does a chroot (without mounting /proc) before
its work, so we cannot check /proc/self/uid_map when we need to.  So
compute it in advance and pass it along with the tar options.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-08-12 16:26:58 -04:00
Brian Goff
c6e3818dd1 Merge pull request #24814 from samuelkarp/awslogs
awslogs: Record log line insert order for sorting
2016-08-12 15:51:06 -04:00
Michael Crosby
5632768a0f Merge pull request #22208 from msabansal/staticip
Enabling specifying static ip for predefined network on windows
2016-08-12 11:39:25 -07:00
Brian Goff
b0431d63dc Merge pull request #25635 from dperny/rate-limit-swarm-pull-log
Rate limit logspam during docker service pulls
2016-08-12 13:06:39 -04:00
Michael Crosby
be045ee2da Merge pull request #25628 from cpuguy83/carry_21567_filter_vol_by_label
Carry 21567 filter vol by label
2016-08-12 09:43:45 -07:00
Michael Crosby
34cc19f670 Merge pull request #25509 from Microsoft/jjh/23079
Windows: Block ReFS file systems
2016-08-12 09:32:22 -07:00
Drew Erny
fa0054a3eb Rate limit logspam during docker service pulls
During image pulls on docker service create, logs will only show status
updates and updates every 1 second on long-running actions like
downloading and extracting. Adds golang.org/x/time/rate as dependency.

Ports docker/swarmkit#1352 to docker/docker.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2016-08-11 14:56:38 -07:00
Brian Goff
6d787dae1a Carry #21567
Use `LabeledVolume` interface type instead of manual interface.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-11 13:47:01 -04:00
Kai Qiang Wu(Kennan)
1a72934cd5 Add label filter support for volume
Since we added labels for volume, it is desired to have
filter support label for volume

Closes: #21416
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-08-11 13:08:04 -04:00
Dan Walsh
b71cd179fa Linux upstream kernel Overlay file systems support SELinux
Remove checks that prevent overlay and SELinux from working together.
Fixes are arriving in the 4.9 kernel.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-08-11 11:40:19 -04:00
Tonis Tiigi
5673c53417 Update executor fixes from swarmkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-10 13:27:38 -07:00
Tibor Vass
92b10b497c Merge pull request #25550 from mrjana/net
Retry creating dynamic networks if not found
2016-08-10 11:52:56 -07:00
Alexander Morozov
64605d709f Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
2016-08-10 11:07:15 -07:00
allencloud
0ead624473 add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-10 08:36:09 +08:00
Jana Radhakrishnan
117cef5e97 Retry creating dynamic networks if not found
In cases there are failures in task start, swarmkit might be trying to
restart the task again in the same node which might keep failing. This
creates a race where when a failed task is getting removed it might
remove the associated network while another task for the same service
or a different service but connected to the same network is proceeding
with starting the container knowing that the network is still
present. Fix this by reacting to `ErrNoSuchNetwork` error during
container start by trying to recreate the managed networks. If they
have been removed it will be recreated. If they are already present
nothing bad will happen.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-09 13:37:11 -07:00
Sebastiaan van Stijn
04e021d751 Merge pull request #23391 from Microsoft/WindowsSandboxSize
Windows: Added support for storage-opt size
2016-08-09 15:34:39 +02:00
John Howard
1cb9e9b44e Windows: Block ReFS file systems
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-08 14:30:37 -07:00
Vincent Demeester
31e3970394 Merge pull request #20848 from WeiZhang555/move-rm-to-daemon
Move --rm to daemon side
2016-08-08 22:11:06 +02:00
Sebastiaan van Stijn
84d5ab96ef
fix validation of non-existing bind-mount source
Unlike `docker run -v..`, `docker service create --mount`
does not allow bind-mounting non-existing host paths.

This adds validation for the specified `source`, and
produces an error if the path is not found on the
host.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-08 17:24:00 +02:00
Zhang Wei
1537dbe2d6 Not use goroutine for container's auto-removal
Before this, container's auto-removal after exit is done in a goroutine,
this commit will get ContainerRm out of the goroutine.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-08 22:46:53 +08:00
Zhang Wei
6dd8e10d6e Wait container's removal via Events API
If AutoRemove is set, wait until client get `destroy` events, or get
`detach` events that implies container is detached but not stopped.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-08 22:46:53 +08:00
Zhang Wei
3c2886d8a4 Move --rm to daemon side
`--rm` is a client side flag which caused lots of problems:
1. if client lost connection to daemon, including client crash or be
killed, there's no way to clean garbage container.
2. if docker stop a `--rm` container, this container won't be
autoremoved.
3. if docker daemon restart, container is also left over.
4. bug: `docker run --rm busybox fakecmd` will exit without cleanup.

In a word, client side `--rm` flag isn't sufficient for garbage
collection. Move the `--rm` flag to daemon will be more reasonable.

What this commit do is:
1. implement a `--rm` on daemon side, adding one flag `AutoRemove` into
HostConfig.
2. Allow `run --rm -d`, no conflicting `--rm` and `-d` any more,
auto-remove can work on detach mode.
3. `docker restart` a `--rm` container will succeed, the container won't
be autoremoved.

This commit will help a lot for daemon to do garbage collection for
temporary containers.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-08-08 22:46:53 +08:00
Sebastiaan van Stijn
2684459ed4 Merge pull request #23718 from yongtang/23498-entrypoint-unset
Allow unset `--entrypoint` in `docker run` or `docker create`
2016-08-08 14:38:01 +02:00
johnharris85
94e95e4711 Move restart-policy validation from client to daemon.
Signed-off-by: John Harris <john@johnharris.io>
2016-08-06 20:09:47 -07:00
Yong Tang
c8d3ee8093 Allow unset --entrypoint in docker run or docker create
This fix tries to address the issue raised in #23498 to allow unset
`--entrypoint` in `docker run` or `docker create`.

This fix checks the flag `--entrypoint` and, in case `--entrypoint=` (`""`)
is passed, unset the Entrypoint during the container run.

Additional integration tests have been created to cover changes in this fix.

This fix fixes #23498.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-05 16:35:20 -07:00
Yong Tang
9528ea930c Sanitize docker labels when used as journald field names
This fix tries to address the issue raised in #23528 where
docker labels caused journald log error because journald
has special requirements on field names.

This fix addresses this issue by sanitize the labels per
requirements of journald.

Additional unit tests have been added to cover the changes.

This fix fixes #23528.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-05 15:20:47 -07:00
Alexander Morozov
6c07fbd455 Merge pull request #25090 from swernli/rootfs-cleanup
Removing old custom RootFS behavior on Windows.
2016-08-05 10:55:44 -07:00
Vincent Demeester
29fef34139 Merge pull request #25387 from yongtang/25374-ps-filter-order
Sort output of `docker ps --filter` with order by creation time
2016-08-05 14:47:10 +02:00
Sebastiaan van Stijn
acbac04c4b Merge pull request #25279 from aboch/auto
Only consider netlink "device" interfaces in address autodetection on Linux
2016-08-05 14:13:53 +02:00
Yong Tang
3f97133546 Sort output of docker ps --filter with order by creation time
This fix tries to address the issue raised in 25374 where the
output of `docker ps --filter` is in random order and
not deterministic.

This fix sorts the list of containers by creation time so that the
output is deterministic.

An integration test has been added.

This fix fixes 25374.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-04 19:27:50 -07:00
Tõnis Tiigi
e10f6a2e54 Merge pull request #25309 from cpuguy83/25253_fix_accidental_bind_create
Validate mount paths on task create
2016-08-03 15:54:03 -07:00
Sebastiaan van Stijn
87e48ecd04 Merge pull request #23497 from shishir-a412ed/dm_task_run_failed
Fixes Issue # 23418: Race condition between device deferred removal and resume device.
2016-08-03 21:54:33 +02:00
Samuel Karp
443f251cf5 awslogs: Record log line insert order for sorting
Fixes https://github.com/docker/docker/issues/24775

Signed-off-by: Samuel Karp <skarp@amazon.com>
2016-08-03 10:04:20 -07:00
Samuel Karp
5ba6cab0a9 awslogs: Add unit test to ensure log line order
Signed-off-by: Samuel Karp <skarp@amazon.com>
2016-08-03 10:01:12 -07:00
Sebastiaan van Stijn
10ae908bfa Merge pull request #25159 from diogomonica/adding-force-to-node-remove
Adding force to node rm
2016-08-02 22:49:15 +02:00
Alessandro Boch
8f7d3a4380 Only consider "device" interfaces in address autodetection on Linux
- This automatically rules out bridges and other non system
  created interfaces

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-08-02 10:54:43 -07:00
Shishir Mahajan
0e633ee14a Fixes Issue # 23418: Race condition between device deferred removal and resume device.
Problem Description:

An example scenario that involves deferred removal
1. A new base image gets created (e.g. 'docker load -i'). The base device is activated and
mounted at some point in time during image creation.
2. While image creation is in progress, a privileged container is started
from another image and the host's mount name space is shared with this
container ('docker run --privileged -v /:/host').
3. Image creation completes and the base device gets unmounted. However,
as the privileged container still holds a reference on the base image
mount point, the base device cannot be removed right away. So it gets
flagged for deferred removal.
4. Next, the privileged container terminates and thus its reference to the
base image mount point gets released. The base device (which is flagged
for deferred removal) may now be cleaned up by the device-mapper. This
opens up an opportunity for a race between a 'kworker' thread (executing
the do_deferred_remove() function) and the Docker daemon (executing the
CreateSnapDevice() function).

This PR cancel the deferred removal, if the device is marked for it. And reschedule the
deferred removal later after the device is resumed successfully.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-08-02 10:33:58 -04:00
Qiang Huang
da5d66fb70 Fix TestUpdateKernelMemoryUninitialized on new kernel version
Fixes: #25073

Update kernel memory on running containers without initialized
is forbidden only on kernel version older than 4.6.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-02 13:17:20 +08:00
Brian Goff
38f8b0eb10 Validate mount paths on task create
This is intended as a minor fix for 1.12.1 so that task creation doesn't
do unexpected things when the user supplies erroneous paths.

In particular, because we're currently using hostConfig.Binds to setup
mounts, if a user uses an absolute path for a volume mount source, or a
non-absolute path for a bind mount source, the engine will do the
opposite of what the user requested since all absolute paths are
treated as binds and all non-absolute paths are treated as named
volumes.

Fixes #25253

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-01 23:35:46 -04:00
Diogo Monica
a327c231b5 Add --force to node removal
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
2016-08-01 18:55:58 -07:00
Alexander Morozov
67a47d78a1 Merge pull request #25129 from mlaventure/fix-weird-rpc-lock-on-master
Attach stdin after attach stdout/err to avoid an rpc lock
2016-08-01 14:52:09 -07:00
Brian Goff
361de697bb Merge pull request #25271 from yongtang/25141-better-error-IP-address-autodetection
Better error messages when IP address autodetection fails
2016-08-01 11:00:21 -04:00
Sebastiaan van Stijn
3a538aca97 Merge pull request #25268 from allencloud/better-container-kill-log
make container kill debug log readable
2016-08-01 11:36:40 +02:00
Yong Tang
59db01049a Better error messages when IP address autodetection fails
This fix tries to improve error messages when IP address
autodetection fails, as is specified in 25141.

Previously, error messages only indicate that multiple IPs
exist when autodetection fails. In this fix, if one
interface consists of multiple addresses or multiple
interfaces consist of addresses, the error messages output
the address names and interface names so that end user could
take notice.

This fix is verified manually.
When multiple addresses exist on multiple interfaces:
```
$ sudo docker swarm init
Error response from daemon: could not choose an IP address
to advertise since this system has multiple addresses on different
interfaces (192.168.186.128 on ens33 and 192.168.100.199 on eth10)
 - specify one with --advertise-addr
```
When multiple addresses exist on single interface:
```
$ sudo docker swarm init
Error response from daemon: could not choose an IP address
to advertise since this system has multiple addresses
on interface ens33 (192.168.186.128 and 192.168.55.199)
- specify one with --advertise-addr
```

This fix fixes 25141.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-07-31 20:03:30 -07:00
allencloud
1102ac257b make container kill debug log readable
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-01 01:00:38 +08:00
Sebastiaan van Stijn
4640c19a88 Merge pull request #24773 from clnperez/cgroup-warnings
More accurate cgroup error messages
2016-07-31 16:49:47 +01:00
Tibor Vass
99525da57c Merge pull request #25243 from allencloud/better-daemon-log-on-graphdriver
use %s instead of %q when format in graphdirver log
2016-07-29 14:33:07 -07:00
Stefan J. Wernli
f342b27145 Removing old custom RootFS behavior on Windows.
Windows base layers are no longer the special "layers+base" type, so we can remove all the special handling for that.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-07-29 14:15:59 -07:00
Sebastiaan van Stijn
1e6fd0378b Merge pull request #24081 from Microsoft/jjh/signaltofile
Windows: Stack dump to file
2016-07-29 22:09:35 +02:00
allencloud
dec4481e08 use %s instead of %q when format in graphdirver log
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-30 02:12:55 +08:00
Brian Goff
10fcd30a90 Merge pull request #24020 from yongtang/23973-rename-with-linked-container
Fix docker rename with linked containers
2016-07-29 12:24:35 -04:00
Christy Perez
846f33f93d More accurate cgroup error messages
A kernel may support any of these, but an admin may have unmounted
certain cgroups, so let's include that possibility in the error so
as to avoid users thinking they have a kernel issue.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2016-07-29 09:50:50 -05:00
Vincent Demeester
faf9dac22c Merge pull request #24986 from mlaventure/add-live-restore-to-info
Add live restore to info
2016-07-29 07:37:56 +02:00
Sebastiaan van Stijn
48569e0a35 Merge pull request #22911 from vdemeester/20033-default-logging-tag-value
Standardize default logging tag value
2016-07-29 02:18:57 +02:00
Kenfe-Mickael Laventure
ff62681d59 Add live-restore state to daemon reload event
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-28 17:10:40 -07:00
Kenfe-Mickael Laventure
189aaf8aea Add live-restore state to docker info output
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-28 17:10:40 -07:00
Kenfe-Mickael Laventure
b945422393 Rename config LiveRestore to LiveRestoreEnabled
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-28 17:10:40 -07:00
Justin Cormack
c388a5bdfa Merge pull request #25034 from thaJeztah/update-swarm-usage
Update usage of "Swarm" for consistency
2016-07-29 01:01:00 +01:00
Alexander Morozov
803e2f285a Merge pull request #24976 from lixiaobing10051267/masterFound2
To break the loop when found in search_test.go
2016-07-28 16:59:46 -07:00
Alexander Morozov
ca43efb40e Merge pull request #24502 from allencloud/change-comparison-log-in-container-config
update comparison log in container config
2016-07-28 16:51:11 -07:00
Alexander Morozov
170abb5f7c Merge pull request #24745 from daehyeok/logrus
Refactoring for logrus formatting
2016-07-28 16:50:19 -07:00
Alexander Morozov
e43033bc23 Merge pull request #22982 from nalind/log-newlines
Improve logging of long log lines
2016-07-28 16:41:01 -07:00
Aaron Lehmann
96b2a6e548 Remove join-tokens from the /info API
join-tokens are not needed for this endpoint, and should not be as part
of /info

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit d8f3b3f006)
2016-07-27 18:11:51 -07:00
Sebastiaan van Stijn
f0230049f0
Update usage of "Swarm" for consistency
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-27 23:31:55 +02:00
Michael Crosby
297745b1cd Merge pull request #24760 from anusha-ragunathan/plugin-events
Make daemon events listen for plugin lifecycle events.
2016-07-27 13:36:49 -07:00
Kenfe-Mickael Laventure
e1a61dc264 Attach stdin after attach stdout/err to avoid an rpc lock
Reason of the lock is currently unknown

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-27 07:48:52 -07:00
Brian Goff
bb27d017f3 Merge pull request #25086 from dmcgowan/overlay2-fix-sub-directory-whiteouts
Fix overlay2 sub directory whiteouts
2016-07-26 20:45:41 -04:00
msabansal
aad25801c0 Fixing support for nat to choose a subnet automatically
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-07-26 16:08:42 -07:00
Derek McGowan
5c05b8447d Update diff apply test to check sub directories
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-07-26 12:03:55 -07:00
Anusha Ragunathan
42abccb841 Make daemon events listen for plugin lifecycle events.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-07-26 10:51:47 -07:00
Tibor Vass
bad654b00c Merge pull request #25051 from dmcgowan/fix-untag-without-force-while-container-running
Fix untag without force while container running
2016-07-26 02:12:10 -07:00
Tibor Vass
9ee430fcf5 Merge pull request #25042 from tiborvass/carry-24492
Carry 24492: Remove swarm inspect and use info instead
2016-07-26 01:11:37 -07:00
Tibor Vass
7bb9676a2b Merge pull request #25043 from stevvooe/forked-pull-context
container/controller: avoid cancellation with forked pull context
2016-07-26 01:01:09 -07:00
Derek McGowan
1f7a9b1ab3 Fix untag without force while container running
With digests being added by default, all images have multiple references.
The check for whether force is required to remove the reference should use the new check for single reference which accounts for digest references.
This change restores pre-1.12 behavior and ensures images are not accidentally left dangling while a container is running.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-07-26 00:45:39 -07:00
Tibor Vass
301eba03e1 Merge pull request #25036 from nishanttotla/describe-function-update-executor
Using map to list plugins in node description
2016-07-25 22:19:33 -07:00
Stephen J Day
d8d71ad5b9
container/controller: avoid cancellation with forked pull context
Context cancellations were previously causing `Prepare` to fail
completely on re-entrant calls. To prevent this, we filtered out cancels
and deadline errors. While this allowed the service to proceed without
errors, it had the possibility of interrupting long pulls, causing the
pull to happen twice.

This PR forks the context of the pull to match the lifetime of
`Controller`, ensuring that for each task, the pull is only performed
once. It also ensures that multiple calls to `Prepare` are re-entrant,
ensuring that the pull resumes from its original position.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-25 21:52:10 -07:00
Tibor Vass
1afa819593 Merge pull request #24967 from mavenugo/eligiblenet
improve error message when using ineligible network with service create
2016-07-25 21:02:24 -07:00
Vincent Demeester
e6923f6d75 Remove swarm inspect and use info instead
Remove the swarm inspect command and use docker info instead to display
swarm information if the current node is a manager.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-25 20:31:10 -07:00
Tibor Vass
a6a261261d Merge pull request #25030 from stevvooe/allow-cancellation-propagation
swarm/controller: allow cancellation to propagate
2016-07-25 19:50:32 -07:00
Stephen J Day
d99c6b837f
swarm/controller: allow cancellation to propagate
Ensure that cancellation of a pull propagates rather than continuing to
container creation. This ensures that the `Prepare` method is properly
re-entrant.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-07-25 18:31:24 -07:00
Nishant Totla
feedb7ab5a
Using map to list plugins in node description
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2016-07-25 17:45:32 -07:00
Brian Goff
a4634cd8a8 Merge pull request #24545 from runshenzhu/health-check
swarm: block controller.Start until container is healthy
2016-07-25 20:32:27 -04:00
Tibor Vass
8c7468bf3b Merge pull request #24856 from tiborvass/remove-status-2-from-healthcheck
healthcheck: do not interpret exit code 2 as "starting"
2016-07-25 16:34:43 -07:00
runshenzhu
a99db84b4a extend health check to start service
Signed-off-by: runshenzhu <runshen.zhu@gmail.com>
Signed-off-by: Runshen Zhu <runshen.zhu@gmail.com>
2016-07-25 15:49:22 -07:00
Tibor Vass
91e9f38313 healthcheck: do not interpret exit code 2 as "starting"
Instead reserve exit code 2 to be future proof, document that it should
not be used. Implementation-wise, it is considered as unhealthy, but
users should not rely on this as it may change in the future.

Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 14:28:45 -07:00
Nishant Totla
227c7e4e8d
Sort plugin names in node description
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2016-07-25 10:38:24 -07:00
Tibor Vass
c65925f24b Merge pull request #24943 from aaronlehmann/rolling-updates
Add failure action for rolling updates
2016-07-25 10:15:28 -07:00
Tibor Vass
79de4d2186 Merge pull request #24908 from jhorwit2/jah/24903
Treat HEALTHCHECK NONE the same as not setting a healthcheck
2016-07-25 10:14:38 -07:00
Michael Crosby
b6197e9514 Merge pull request #24942 from anusha-ragunathan/plugin-liverestore
Handle plugin shutdown when liveRestore is set.
2016-07-25 09:49:34 -07:00
Aaron Lehmann
57ae29aa74 Add failure action for rolling updates
This changes the default behavior so that rolling updates will not
proceed once an updated task fails to start, or stops running during the
update. Users can use docker service inspect --pretty servicename to see
the update status, and if it pauses due to a failure, it will explain
that the update is paused, and show the task ID that caused it to pause.
It also shows the time since the update started.

A new --update-on-failure=(pause|continue) flag selects the
behavior. Pause means the update stops once a task fails, continue means
the old behavior of continuing the update anyway.

In the future this will be extended with additional behaviors like
automatic rollback, and flags controlling parameters like how many tasks
need to fail for the update to stop proceeding. This is a minimal
solution for 1.12.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-25 08:51:19 -07:00
Madhu Venugopal
40c88b8c54 improve error message when using ineligible network with service create
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-25 08:31:22 -07:00
Josh Horwitz
4016038bd3 Treat HEALTHCHECK NONE the same as not setting a healthcheck
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
2016-07-25 11:11:14 -04:00
Brian Goff
19ec73b8b5 Merge pull request #24997 from WeiZhang555/fix-unmeaningful-log
small nit: fix unmeaningful log
2016-07-25 10:33:57 -04:00
Zhang Wei
af8359562c small nit: fix unmeaningful log
Truncated dir name can't give any useful information, print whole dir
name will.

Bad debug log is like this:

```
DEBU[2449] aufs error unmounting /var/lib/doc: no such file or directory
```

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-07-26 07:10:28 +08:00