Commit graph

4539 commits

Author SHA1 Message Date
Akihiro Suda
2e20e63da2 overlay: warn if overlay backing fs doesn't support d_type
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-11-09 07:18:27 +00:00
John Howard
cff9679c6c Windows: Enable fluentd logdriver
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-08 19:54:57 -08:00
John Howard
d9294719b5 Windows: Allow a no-reexec option for importLayer
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-08 17:57:43 -08:00
Victor Vieux
462e57f05e Merge pull request #27567 from yongtang/24391-dns-setting
Add custom DNS settings to service definition
2016-11-08 17:43:00 -08:00
John Howard
5207ff7202 Windows: Plumb through user
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-08 17:41:56 -08:00
Sebastiaan van Stijn
3975d648b7 Merge pull request #27420 from Shugyousha/journaldfixes
Small logger journald cleanup
2016-11-09 01:35:08 +01:00
Victor Vieux
2d42032225 Merge pull request #27992 from Microsoft/jjh/minapitoinfo
Adds `MinAPIVersion` to docker version
2016-11-08 15:49:33 -08:00
Yong Tang
9e8adbecf5 Add custom DNS settings to service definition
This fix tries to fix the issue raised in 24391 about allowing
custom DNS settings to service definition.

This fix adds `DNSConfig` (`Nameservers`, `Options`, `Search`) to
service definition, as well as `--dns`, `--dns-opt`, and `dns-search`
to `service create`.

An integration test has been added to cover the changes in this fix.

This fix fixes 24391.

A PR in swarmkit will be created separately.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-08 15:41:32 -08:00
Darren Stahl
c58e8dea6c Terminate template VMs on layer delete
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-08 15:39:25 -08:00
Aaron Lehmann
0ccbae0437 Merge pull request #27123 from tonistiigi/fix-join-reconnect
Don’t attempt to reconnect swarm on failed join after timeout
2016-11-08 14:53:44 -08:00
Michael Crosby
47637b49a0 Convert err description to lower
Convert this to lower before checking the message of the error.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-11-08 14:42:54 -08:00
Aaron Lehmann
842d11f44c cli: Add options for Raft snapshotting
Add the following options to "swarm init" and "swarm update":

- --max-snapshots: Retain this many old Raft snapshots in addition
  to the latest one

- --snapshot-interval: Number of log entries between Raft snapshots

These options already existed in SwarmKit and the Docker API but were
never exposed in the CLI. I'm adding them here to fix this oversight.

--max-snapshots may be useful for debugging purposes and more
conservative users who want to store rolling backups of old versions of
the Raft state.

--snapshot-interval is most useful for performance tuning. The default
value of 10000 may not be ideal for some setups.

There is also a LogEntriesForSlowFollowers option that is not exposed. I
decided not to expose it along with these others because I don't think
it's generally useful (and I'm not sure what I would call the CLI flag).
But if people want, I can expose it for the sake of completeness.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-08 13:14:01 -08:00
John Howard
27de9f6ece Fix typo limitied
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-08 13:06:24 -08:00
Silvan Jegen
d359daaa48 Clean up journald logger
We clean up the journald logger with these four changes.

1. Make field array static
2. Make function name more appropriate
3. Initialize the file descriptors only once
4. Avoid copying the journald cursor

Point 4 is the most significant change: instead of treating the journald
cursor like a Go string we use it as a raw C.char pointer. That way we
avoid the copying by the C.CString and C.GoString functions.

Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
2016-11-08 19:09:59 +01:00
Nishant Totla
87075353dc
Adding function to resolve tag to digest in daemon
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2016-11-08 09:34:01 -08:00
Sebastiaan van Stijn
9a61bd05f8 Merge pull request #27466 from mrjana/net
Retry AttachNetwork when it fails to find network
2016-11-08 18:25:45 +01:00
John Howard
d29995bb84 Adds minimum API version to version
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-07 21:20:00 -08:00
Daniel Nephin
69efb4652c Merge pull request #28076 from yongtang/25644-docker-service-tty
Add `--tty` to `docker service create/update`
2016-11-07 22:15:27 -05:00
Tibor Vass
109c26bd74 Merge pull request #28056 from LK4D4/solaris_me
Add functional support for Docker sub commands on Solaris
2016-11-07 16:46:18 -08:00
Yong Tang
599be5a551 Add --tty to docker service create/update
This fix tries to add `--tty` to `docker service create/update`. As was
specified in 25644, `TTY` flag has been added to SwarmKit and is
already vendored.

This fix add `--tty` to `docker service create/update`.

Related document has been updated.

Additional integration tests has been added.

This fix fixes 25644.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-07 16:42:32 -08:00
Tõnis Tiigi
67b0311c8c Merge pull request #27615 from darrenstahlmsft/ExecCloseAsync
Asynchronously close streams to prevent holding container lock
2016-11-07 16:16:21 -08:00
Amit Krishnan
934328d8ea Add functional support for Docker sub commands on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-07 09:06:34 -08:00
Yong Tang
818d55c34b Fix /proc/<pid>/oom_score_adj: invalid argument error caused by empty env name
This fix is part of the fix for issue 25099. In 25099, if an env
has a empty name, then `docker run` will throw out an error:
```
ubuntu@ubuntu:~/docker$ docker run -e =A busybox true
docker: Error response from daemon: invalid header field value "oci runtime error:
container_linux.go:247: starting container process caused \"process_linux.go:295:
setting oom score for ready process caused \\\"write /proc/83582/oom_score_adj:
invalid argument\\\"\"\n".
```

This fix validates the Env in the container spec before it is sent
to containerd/runc.

Integration tests have been created to cover the changes.

This fix is part of fix for 25099 (not complete yet, non-utf case
may require a fix in `runc`).
This fix is related to 25300.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-07 08:15:26 -08:00
Dong Chen
ca81f6ee7c dynamic service binding.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-11-04 21:50:56 -07:00
Darren Stahl
4e15420b9b Windows: Add cpu count option
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-04 13:38:50 -07:00
Yong Tang
846baf1fd3 Add --cpus flag to control cpu resources
This fix tries to address the proposal raised in 27921 and add
`--cpus` flag for `docker run/create`.

Basically, `--cpus` will allow user to specify a number (possibly partial)
about how many CPUs the container will use. For example, on a 2-CPU system
`--cpus 1.5` means the container will take 75% (1.5/2) of the CPU share.

This fix adds a `NanoCPUs` field to `HostConfig` since swarmkit alreay
have a concept of NanoCPUs for tasks. The `--cpus` flag will translate
the number into reused `NanoCPUs` to be consistent.

This fix adds integration tests to cover the changes.

Related docs (`docker run` and Remote APIs) have been updated.

This fix fixes 27921.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-04 09:43:10 -07:00
Justin Cormack
efa5e85cf7 Merge pull request #26276 from runcom/seccomp-conf
daemon: add a flag to override the default seccomp profile
2016-11-04 15:45:30 +00:00
Vincent Demeester
b4e14c6edc Merge pull request #27857 from vasil-yordanov/docker-service-hostname-2
Adding the hostname option to docker service command
2016-11-04 15:22:55 +01:00
Vincent Demeester
9f7cc7d032 Merge pull request #28035 from thaJeztah/add-test-for-long-loglines
add tests for long log-lines and trailing lines
2016-11-04 07:59:20 +01:00
Alexander Morozov
c072347078 Merge pull request #27912 from LK4D4/vndr
project: use vndr for vendoring
2016-11-03 18:30:19 -07:00
Brian Goff
7248742ae7 Merge pull request #28052 from mavenugo/nid
Handle NetworkDettach for the case of network-id
2016-11-03 21:00:37 -04:00
Sebastiaan van Stijn
58a930d66b Merge pull request #26792 from mrunalp/bug/26790
Add SELinux options to security opt even when it is not empty
2016-11-03 17:04:36 -07:00
Madhu Venugopal
5f17e0f6c9 Handle NetworkDettach for the case of network-id
When a container is attached to an "--attachable" network, it strictly
forms the attacherKey using either the network-id or network-name
because at the time of attachment, the daemon may not have the network
downloaded locally from the manager. Hence, when the NetworkDettach is
called, it should use either network-name or network-id. This fix
addresses the missing network-id based dettachment case.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-11-03 15:56:35 -07:00
Alexander Morozov
f2614f2107 project: use vndr for vendoring
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-03 15:31:46 -07:00
French Ben
3661510f7f Updated AWS logstream to understand tags
Signed-off-by: French Ben <frenchben@docker.com>
2016-11-03 13:49:40 -07:00
Brian Goff
02bc2e652b Merge pull request #27331 from Microsoft/jjh/spew
Add spew debugging
2016-11-03 16:36:20 -04:00
Mrunal Patel
4c10c2ded3 Ensure that SELinux Options are set when seccomp is already set
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-11-03 13:23:53 -07:00
Sebastiaan van Stijn
b2641bd9df Merge pull request #27910 from dperny/node_ip_in_raft
Auto-detect node IP address
2016-11-03 10:30:55 -07:00
John Howard
4c62b12636 Spew debugging
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-03 10:05:11 -07:00
Sebastiaan van Stijn
ee34dd9f8a
add tests for long log-lines and trailing lines
this adds new tests to test logging of long log-lines
(without newlines), and trailing log-lines.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-11-03 10:01:00 -07:00
Justin Cormack
81683e898a Merge pull request #27599 from estesp/getent-path
Add support for looking up user/groups via `getent`
2016-11-03 15:11:42 +00:00
Drew Erny
9bcf623719 added node ip autodetection
Manager now auto-detects the address that an agent connects to the cluster
from and stores it. This is useful for many kinds of internal cluster
management tools.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2016-11-03 08:10:14 -07:00
Boaz Shuster
786a95493d Return an empty stats if the container is restarting
In case, a container is restarting indefinitely running
"docker stats --no-stream <restarting_container>" is suspended.

To fix this, the daemon makes sure the container is either not
running or restarting if `--no-stream` is set to true and if so
returns an empty stats.

Should fix #27772.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2016-11-03 13:26:24 +02:00
Nikolay Milovanov
b222aa1a58 Adding the hostname option to docker service command
Signed-off-by: Nikolay Milovanov <nmil@itransformers.net>
2016-11-03 10:02:14 +00:00
Vincent Demeester
19b5b4aada Merge pull request #27951 from LK4D4/dump_always_to_file
daemon: always dump stack to file
2016-11-03 00:35:06 -07:00
Vincent Demeester
ef915fd036
Add support for Names and ID in stats format
This adds support to display names or id of container instead of what
was provided in the request.

This keeps the default behavior (`docker stats byname` will display
`byname` in the `CONTAINER` colmun and `docker stats byid` will display
the id in the `CONTAINER` column) but adds two new format directive.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-03 07:20:46 +01:00
Vincent Demeester
1f4137857f Merge pull request #28006 from dmcgowan/clean-overlay2-layerstore
Cleanup invalid code in overlay2 and layer store
2016-11-02 23:16:38 -07:00
John Howard
cb352501af Merge pull request #27963 from darrenstahlmsft/RenameDelete
Windows: Rename layers before deletion
2016-11-02 19:20:39 -07:00
Brian Goff
666377b23e Merge pull request #27986 from milindchawre/fix_21803
Fixes #21803 : Removing unused configuration in daemon/logger/fluentd
2016-11-02 21:03:15 -04:00
Derek McGowan
6622cc970e
Cleanup invalid code in overlay2 and layer store
The overlay2 change ensures that the correct path is used to resolve the
symlink. The current code will not fail since the symlinks are always given
a value of "../id/diff" which ends up ignoring the incorrect "link" value.
Fix this code so it doesn't cause unexpected errors in the future if the
symlink changes.

The layerstore cleanup ensures that the empty layer returns a tar stream if
the provided parent is empty. Any value other than empty still returns an
error since the empty layer has no parent. Currently empty layer is not
used anywhere that TarStreamFrom is used but could break in the future if
this function is called.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-11-02 16:13:53 -07:00
Drew Erny
5b6c565f74 use named pipe on windows
Signed-off-by: Drew Erny <drew.erny@docker.com>
2016-11-02 13:47:35 -07:00
Antonio Murdaca
b237189e6c
daemon: add a flag to override the default seccomp profile
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-11-02 21:41:29 +01:00
Alexander Morozov
e5d36586ac daemon: always dump stack to file
Dumping to log is unusable in 90% of cases and inspecting file is much
more convenient.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-02 11:22:43 -07:00
Alexander Morozov
78a83a2269 Merge pull request #27932 from thaJeztah/promote-overlay
promote overlay(2) graphdriver
2016-11-02 07:00:49 -07:00
milindchawre
3463bbcc71 Fixes #21803 : Removing unused configuration in daemon/logger/fluentd
Signed-off-by: milindchawre <milindchawre@gmail.com>
2016-11-02 11:11:02 +00:00
Vincent Demeester
ebf10dc5b0 Merge pull request #27883 from mavenugo/na
Copy only the relevant endpoint configs from Attachable config
2016-11-02 11:50:31 +01:00
Sebastiaan van Stijn
f96d45dc8a Merge pull request #27948 from WeiZhang555/consistent-filters
Replace all "Filter" field with "Filters" for consistency
2016-11-02 00:53:15 -07:00
Jana Radhakrishnan
849e345e2c Retry AttachNetwork when it fails to find network
When trying to attach to swarm scope network for an unmanaged container
sometimes even if attaching to network succeeds, we may not find the
network because some other container which was using the network went
down and removed the network. So if it is not found, try to detach and
reattach to re-download the network from the manager.

Fixes #26588

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-11-01 21:46:24 -07:00
Darren Stahl
be68006d19 Windows: Rename layers before deletion
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-01 18:05:09 -07:00
Michael Crosby
74bdacb908 Merge pull request #27953 from thaJeztah/fix-deprecation-version
Update deprecation versions for "email" and colon in "security options"
2016-11-01 14:31:32 -07:00
Michael Crosby
22f3e43e9a Merge pull request #22641 from cpuguy83/build_finalization
Adds ability to flatten image after build
2016-11-01 14:30:18 -07:00
Alexander Morozov
bf16fa47b7 Merge pull request #27929 from daehyeok/logrus_refactoring
Fix logrus formatting
2016-11-01 11:12:46 -07:00
Brian Goff
362369b4bb Adds ability to squash image after build
Allow built images to be squash to scratch.
Squashing does not destroy any images or layers, and preserves the
build cache.

Introduce a new CLI argument --squash to docker build
Introduce a new param to the build API endpoint `squash`

Once the build is complete, docker creates a new image loading the diffs
from each layer into a single new layer and references all the parent's
layers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-01 13:41:59 -04:00
Sebastiaan van Stijn
e41a39dbae
Update deprecation versions for "email" and colon in "security options"
These features were originally scheduled
for removal in docker 1.13, but we changed
our deprecation policy to keep features
for three releases instead of two.

This updates the deprecation version
to match the deprecation policy.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-11-01 09:12:27 -07:00
Zhang Wei
89a6966726 Replace all "Filter" field with "Filters" for consistency
In file `api/types/client.go`, some of the "*Options{}" structs own a
`Filters` field while some else have the name of `Filter`, this commit
will rename all `Filter` to `Filters` for consistency. Also `Filters`
is consistent with API with format `/xxx?filters=xxx`, that's why
`Filters` is the right name.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-11-01 23:09:30 +08:00
Sebastiaan van Stijn
299beff1c4
promote overlay(2) graphdriver
Now that overlay has matured, using
overlay is a better choice than devicemapper
on loopback devices.

This change promotes overlay in the
priority list. It also adds the
overlay2 graphdriver to the list
because overlay2 (if supported)
should be preferred over overlay.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-10-31 23:32:10 -07:00
Daehyeok Mun
fa710e504b 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.

Fixed issue #23459

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-10-31 22:05:01 -06:00
Yanqiang Miao
a9b6319e67 Optimized the indentation of codes and fix two typos
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-11-01 10:35:18 +08:00
Brian Goff
2fc760496b Merge pull request #27648 from dnephin/swagger-gen-operations
Generated more api types from swagger spec
2016-10-31 15:33:16 -04:00
Vincent Demeester
a0629eab73 Merge pull request #27884 from Microsoft/jjh/copyfiletodot
Windows: Fix COPY file . after WORKDIR
2016-10-31 17:54:44 +01:00
Brian Goff
0cdcb9ea73 Merge pull request #27782 from tombooth/27779-decouple-watcher-close
Decouple removing the fileWatcher from reading
2016-10-31 11:50:26 -04:00
Daniel Nephin
181562c2e5 Generate ContainerWait response from the swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-31 11:19:53 -04:00
Daniel Nephin
f196cf6a09 Generate container update response from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-31 11:16:02 -04:00
Daniel Nephin
bad849fc82 Generate container create response from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-31 11:16:02 -04:00
Daniel Nephin
29df3bdb11 Use a config to generate swagger api types
Moves the resposne types to a package under api/types

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-31 11:13:41 -04:00
Daniel Nephin
5c2498fd3c Generate VolumesCreateRequest from the swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-31 11:13:41 -04:00
John Howard
f0b93b6ed8 Windows: Fix COPY file . after WORKDIR
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-30 13:12:27 -07:00
Madhu Venugopal
c5dd4d70c6 Copy only the relevant endpoint configs from Attachable config
When a container is run on a --attachable network, the endpoint
configs passed by the user were incorrectly overwritten.
Copy the relevant configs instead of overwriting the entire configs.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-10-29 17:11:30 -07:00
Qiang Huang
e6866492c4 Fix bunch of typos
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-10-29 15:03:26 +08:00
Vincent Demeester
515e5dade7 Merge pull request #24698 from jhorwit2/jah/clist-health-filter-format
Fixes #24022 - Adds container health support to docker ps filter/format
2016-10-29 06:56:06 +02:00
Vincent Demeester
1fb9c4e891 Merge pull request #27840 from estesp/add-userns-status-to-info
Add "userns" to `docker info` security options output
2016-10-29 02:58:34 +02:00
Phil Estes
ae74092e45 Add "userns" to docker info security options output
If user namespaces is enabled on the daemon, reveal that via docker info
by adding "userns" to the list of security options reported by the
info endpoint.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-10-28 19:16:57 -04:00
Phil Estes
6cb8392be9 Add support for looking up user/groups via getent
When processing the --userns-remap flag, add the
capability to call out to `getent` if the user and
group information is not found via local file
parsing code already in libcontainer/user.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-10-28 19:06:07 -04:00
Vincent Demeester
f860289131 Merge pull request #27369 from cezarsa/hc
Add --health-* flags to service create and update
2016-10-28 21:59:52 +02:00
Josh Horwitz
1a149a0ea5 Adds container health support to docker ps filter
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
2016-10-28 15:43:04 -04:00
John Howard
9aa7501696 Merge pull request #27842 from Microsoft/jjh/supportdiff
Windows: support docker diff
2016-10-28 12:41:08 -07:00
Darren Stahl
07cd19655b Stop holding container lock while waiting on streams
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-28 12:19:22 -07:00
Michael Crosby
b57f321a4a Merge pull request #26709 from boucher/checkpoint-dir
Allow providing a custom storage directory for docker checkpoints
2016-10-28 11:12:44 -07:00
Michael Crosby
9e436c9aad Merge pull request #26464 from vdemeester/11065-stop-signal-and-restart-policies
Taking stop-signal into account when docker kill
2016-10-28 11:08:55 -07:00
John Howard
4fac603682 Windows: support docker diff
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-28 11:06:54 -07:00
Michael Crosby
1e989abefb Merge pull request #26659 from yongtang/26341-fixed-cidr-multiple-addresses-bridge
Fix issue for `--fixed-cidr` when bridge has multiple addresses
2016-10-28 11:05:01 -07:00
Vincent Demeester
87ddc8b0a5 Merge pull request #26837 from AkihiroSuda/newtmpfs
api: add TypeTmpfs to api/types/mount
2016-10-28 19:21:26 +02:00
Cezar Sa Espinola
7bd2611789
Add --health-* commands to service create and update
A HealthConfig entry was added to the ContainerSpec associated with the
service being created or updated.

Signed-off-by: Cezar Sa Espinola <cezarsa@gmail.com>
2016-10-28 15:19:08 -02:00
boucher
bd7d51292c Allow providing a custom storage directory for docker checkpoints
Signed-off-by: boucher <rboucher@gmail.com>
2016-10-28 07:56:05 -04:00
Tom Booth
a69a59ffc7 Decouple removing the fileWatcher from reading
Fixes #27779

Currently `followLogs` can get into a deadlock if we receive an inotify
IN_MODIFY event while we are trying to close the `fileWatcher`. This is
due to the fact that closing the `fileWatcher` happens in the same block
as consumes events from the `fileWatcher`. We are trying to run
`fileWatcher.Close`, which is waiting for an IN_IGNORE event to come in
over inotify to confirm the watch was been removed. But, because an
IN_MODIFY event has appeared after `Close` was entered but before the
IN_IGNORE, the broadcast never comes. The IN_MODIFY cannot be consumed
as the events channel is unbuffered and the only `select` that reads
from it is busy waiting for the IN_IGNORE event.

In order to try and fix this race condition I've moved the removal of
the `fileWatcher` out to a separate go block that waits for a signal to
close, removes the watcher and then signals to the previous selects on
the close signal.

This has introduced a `fileWatcher.Remove` in the final case, but if we
try and remove a watcher that does not exist it will just return an
error saying so. We are not doing any checking on the return of `Remove`
so this shouldn't cause any side-effects.

Signed-off-by: Tom Booth <tombooth@gmail.com>
2016-10-28 10:53:38 +01:00
Akihiro Suda
18768fdc2e api: add TypeTmpfs to api/types/mount
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-10-28 08:38:32 +00:00
Sebastiaan van Stijn
0aaef963a8 Merge pull request #27845 from cpuguy83/experimental_checks_daemon
error out if checkpoint specified on non-experimental
2016-10-27 20:42:09 -07:00
Vincent Demeester
10d77b878c Merge pull request #25800 from vdemeester/25798-fix-event-actions
Fix 25798 : Allow "partial/prefix" filter for health_status, exec_create and exec_start events
2016-10-28 05:20:49 +02:00
Vincent Demeester
5945ba64b2 Merge pull request #27839 from vdemeester/lets-clise-this
Small log formatting fixes
2016-10-28 05:20:24 +02:00
Brian Goff
3c0a2bb289 error out if checkpoint specified on non-experimental
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-10-27 17:43:57 -07:00
Sebastiaan van Stijn
33474a11fe Merge pull request #25820 from crosbymichael/prom
Add metrics output to docker
2016-10-27 16:44:26 -07:00
Vincent Demeester
71d8313ad4
Fix some event filtering
Make it possible to use health_status, exec_start and exec_create as
is in event filter. This way, using `health_status` as filter will allow
to get all health_status events (healthy, unhealthy, …) instead of
having to us all combination (`health_status: healthy`, `health_status:
unhealthy`, …). Same goes for `exec_start` and `exec_create`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-10-27 16:14:13 -07:00
Vincent Demeester
2f7e907846
Small log formatting fixes
… and clise to close 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-10-27 15:29:24 -07:00
Michael Crosby
3343d234f3 Add basic prometheus support
This adds a metrics packages that creates additional metrics.  Add the
metrics endpoint to the docker api server under `/metrics`.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add metrics to daemon package

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

api: use standard way for metrics route

Also add "type" query parameter

Signed-off-by: Alexander Morozov <lk4d4@docker.com>

Convert timers to ms

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-10-27 10:34:38 -07:00
Yong Tang
e9c4c513d1 Fix issue for --fixed-cidr when bridge has multiple addresses
This fix tries to address the issue raised in 26341
where multiple addresses in a bridge may cause `--fixed-cidr`
to not have the correct addresses.

The issue is that `netutils.ElectInterfaceAddresses(bridgeName)`
only returns the first IPv4 address.

This fix (together with the PR created in libnetwork )
changes `ElectInterfaceAddresses()` and `addresses()`
so that all IPv4 addresses are returned. This will allow the
possibility of selectively choose the address needed.

In `daemon_unix.go`, bridge address is chosen by comparing with
the `--fixed-cidr` first, thus resolve the issue in 26341.

This fix is tested manually, as is described in 26341:
```
brctl addbr cbr0
ip addr add 10.111.111.111/20 dev cbr0 label cbr0:main
ip addr add 10.222.222.222/12 dev cbr0 label cbr0:docker
ip link set cbr0 up
docker daemon --bridge=cbr0 --iptables=false --ip-masq=false --fixed-cidr=10.222.222.222/24
docker run --rm busybox ip route get 8.8.8.8 | grep -Po 'src.*'
src 10.222.222.0
```

This fix fixes 26341.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-26 20:11:29 -07:00
Tom Booth
6314bec641 Do not directly cast io.ReadSeeker to io.Reader
`golint` had the following issue when linting this file:

```
daemon/logger/jsonfilelog/read.go:116:10: should omit type io.Reader
from declaration of var rdr; it will be inferred from the right-hand
side
```

In order to keep it happy changing it to an indirect assignment will
still maintain the same functionality.

Signed-off-by: Tom Booth <tombooth@gmail.com>
2016-10-26 17:37:48 +01:00
Erik St. Martin
56f77d5ade Implementing support for --cpu-rt-period and --cpu-rt-runtime so that
containers may specify these cgroup values at runtime. This will allow
processes to change their priority to real-time within the container
when CONFIG_RT_GROUP_SCHED is enabled in the kernel. See #22380.

Also added sanity checks for the new --cpu-rt-runtime and --cpu-rt-period
flags to ensure that that the kernel supports these features and that
runtime is not greater than period.

Daemon will support a --cpu-rt-runtime flag to initialize the parent
cgroup on startup, this prevents the administrator from alotting runtime
to docker after each restart.

There are additional checks that could be added but maybe too far? Check
parent cgroups to ensure values are <= parent, inspecting rtprio ulimit
and issuing a warning.

Signed-off-by: Erik St. Martin <alakriti@gmail.com>
2016-10-26 11:33:06 -04:00
Tonis Tiigi
e4349ad901 Fix overlay unmount for the root case
In root case no mount call or reference count
increment actually happens so don’t try to unmount.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-25 14:40:13 -07:00
Stephen J Day
3b1af17518
cluster/container: correctly name swarm tasks
Even after a slew of PRs, this still wasn't quite right. Now, we ensure
the task name is calculared in one place in the executor, as least.

We'll have to follow this up once the `api/naming` package from SwarmKit
lands.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-10-25 14:17:57 -07:00
John Howard
ff6db320f8 Merge pull request #27747 from Microsoft/jjh/clientisolationcomment
Windows: Add comment for containers on client SKUs
2016-10-25 13:37:25 -07:00
Alexander Morozov
844a3166e5 Merge pull request #27698 from tonistiigi/cluster-config-refactor
Refactor swarm node config to struct
2016-10-25 13:29:55 -07:00
Akira Koyasu
cb176c848e add scheme to fluentd-address
Signed-off-by: Akira Koyasu <mail@akirakoyasu.net>

- add scheme to fluentd-address
- define a new type `location`
- use `errors.Wrapf`
2016-10-26 03:36:51 +09:00
John Howard
87ab13add4 Windows: Add comment re client containers
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-25 10:30:00 -07:00
Vincent Demeester
11cd64f0dc Merge pull request #27525 from AkihiroSuda/prune-network-cluster
add `docker network prune`
2016-10-25 09:02:28 -07:00
Antonio Murdaca
8ed31089c0 Merge pull request #27467 from tonistiigi/attach-cb
Move stdio attach from libcontainerd backend to callback
2016-10-25 16:23:07 +02:00
Akihiro Suda
7e24c16086 add docker network prune
`docker network prune` prunes unused networks, including overlay ones.
`docker system prune` also prunes unused networks.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-10-25 06:43:54 +00:00
Sebastiaan van Stijn
f901c5ed1c Merge pull request #27699 from yongtang/27695-info-duplicate-nat-null-plugin
Remove duplicate `nat`, `null` in `docker info` for Windows
2016-10-24 18:41:34 -07:00
Sebastiaan van Stijn
411e7b4416 Merge pull request #24533 from yongtang/24392-docker-info-label-duplicate-keys
Remove duplicate keys in labels of `docker info`
2016-10-24 18:12:28 -07:00
Sebastiaan van Stijn
ba41a5edac Merge pull request #27223 from mlaventure/merge-experimental
Make experimental a runtime flag
2016-10-24 16:58:32 -07:00
Tonis Tiigi
b1014428c1 Refactor swarm node config to struct
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-24 16:36:50 -07:00
Vincent Demeester
09985ad897 Merge pull request #27624 from erxian/remove-duplicate-err-judgement
remove duplicated error judgement in cluster.go
2016-10-24 16:11:53 -07:00
Yong Tang
3347aba957 Remove duplicate nat, null in docker info for Windows
This fix tries to address the issue raised in 27695 where
duplicate `nat` and `null` has been listed in `docker info`
for Windows.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-24 15:21:14 -07:00
Kenfe-Mickael Laventure
7781a1bf0f Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-24 15:20:01 -07:00
Brian Goff
0ab13dda66 Merge pull request #26848 from miaoyq/del-a-redundant-err-return
Delete a redundant error return
2016-10-24 11:27:08 -07:00
Vincent Demeester
d2e64247e6
Taking stop-signal into account when docker kill
If a container sets a stop-signal, taking it into account to disable or
not the restart policy.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-10-24 11:10:14 -07:00
Tonis Tiigi
37a3be2449 Move stdio attach from libcontainerd backend to callback
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-24 00:20:36 -07:00
Vincent Demeester
ce6cfef36d Merge pull request #27460 from Microsoft/jjh/dockerpid
Windows: Calculate PID file after root
2016-10-22 13:41:42 +02:00
Vincent Demeester
9058ec3be5 Merge pull request #27596 from aaronlehmann/rolling-restart
Add force option to service update
2016-10-22 13:37:12 +02:00
Sebastiaan van Stijn
a6688959b4 Merge pull request #26973 from allencloud/change-code-in-container-restore
change code in container restore
2016-10-21 18:53:37 -07:00
Sebastiaan van Stijn
3c385b9f6b Merge pull request #27117 from dnephin/swagger-gen
Add swagger.yaml and generate a few types from the spec
2016-10-21 18:15:28 -07:00
Yanqiang Miao
2d126f190d Delete a redundant error return
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-10-22 08:53:57 +08:00
Aaron Lehmann
c9fdf9abf8 Add force option to service update
Currently, there's no way to restart the tasks of a service without
making an actual change to the service. This leads to us giving awkward
workarounds as in
https://github.com/docker/docker.github.io/pull/178/files, where we tell
people to scale a service up and down to restore balance, or make
unnecessary changes to trigger a restart.

This change adds a --force option to "docker service update", which
forces the service to be updated even if no changes require that.

Since rolling update parameters are respected, the user can use
"docker service --force" to do a rolling restart. For example, the
following is supported:

   docker service update --force --update-parallelism 2 \
   --update-delay 5s myservice

Since the default value of --update-parallelism is 1, the default
behavior is to restart the service one task at a time.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-21 17:43:27 -07:00
Evelynhsu
75c51ad76b remove duplicated error judgement in cluster.go
Signed-off-by: erxian <evelynhsu21@gmail.com>
2016-10-21 14:28:10 +08:00
Aaron Lehmann
bc52939b04 Merge pull request #27613 from stevvooe/archive-package-cleanup
pkg/archive: remove unnecessary Archive and Reader type
2016-10-20 20:56:23 -07:00
Stephen J Day
aa2cc18745
pkg/archive: remove unnecessary Archive and Reader type
The `archive` package defines aliases for `io.ReadCloser` and
`io.Reader`. These don't seem to provide an benefit other than type
decoration. Per this change, several unnecessary type cases were
removed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-10-20 19:31:24 -07:00
Aaron Lehmann
12a4ed0317 Vendor swarmkit in master
Also, update libnetwork and grpc.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-20 13:49:22 -07:00
Aaron Lehmann
2c620d0aa2 Merge pull request #27287 from mavenugo/pluginv2-sk2
Allow multiple handlers to support network plugins in swarm-mode
2016-10-20 13:43:04 -07:00
Daniel Nephin
b06c352783 Generate api/types:Image from the swagger spec
and rename it to a more appropriate name ImageSummary.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-20 13:24:23 -07:00
Daniel Nephin
f06d8d6db9 Generate api/types:Port from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-20 13:24:23 -07:00
Daniel Nephin
0243936d92 Add swagger.yaml
Generate Volume type from the swagger.yaml
Add makefile target for generating the models

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-20 13:24:23 -07:00
Vincent Demeester
13fd75c3dd Merge pull request #27470 from runcom/expose-exec-pid
record pid of exec'd process
2016-10-20 21:36:21 +02:00
Alexander Morozov
c18fbc9455 Merge pull request #22337 from allencloud/support-insecure-registry-config-reload
support insecure registry in configuration reload
2016-10-20 11:41:23 -07:00
Antonio Murdaca
1808348136
record pid of exec'd process
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-20 17:06:11 +02:00
Vincent Demeester
f529f2a0d5 Merge pull request #27535 from YuPengZTE/dev
Fix the typo of URLs
2016-10-20 16:51:50 +02:00
Yong Tang
9ce8aac55e Show volume options for docker volume inspect
This fix tries to address the issue raised in 25545 where
volume options at the creation time is not showed up
in `docker volume inspect`.

This fix adds the field `Options` in `Volume` type and
persist the options in volume db so that `volume inspect`
could display the options.

This fix adds a couple of test cases to cover the changes.

This fix fixes 25545.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-20 05:14:27 -07:00
Vincent Demeester
1b677816f5 Merge pull request #24594 from jwendell/24355
Exec: Add ability to set environment variables
2016-10-20 13:26:48 +02:00
allencloud
582803f00a support insecure registry in configuration reload
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-20 07:54:31 +08:00
Vincent Demeester
4a4f028c47 Merge pull request #23036 from yongtang/22471-daemon-shutdown-timeout-daemon
Add config parameter to change stop timeout during daemon shutdown
2016-10-19 18:47:50 +02:00
Jonh Wendell
e03bf1221e Exec: Add ability to set environment variables
Keeping the current behavior for exec, i.e., inheriting
variables from main process. New variables will be added
to current ones. If there's already a variable with that
name it will be overwritten.

Example of usage: docker exec -it -e TERM=vt100 <container> top

Closes #24355.

Signed-off-by: Jonh Wendell <jonh.wendell@redhat.com>
2016-10-19 12:39:25 -02:00
Vincent Demeester
15fb3fd9da Merge pull request #26965 from Microsoft/jjh/rootpath
Windows: Set correct root path logic
2016-10-19 15:50:37 +02:00
Vincent Demeester
7a4d286ddd Merge pull request #27387 from talex5/health-restart
Reset health status to starting when a container is restarted
2016-10-19 15:48:59 +02:00
YuPengZTE
fa378413f8 Fix the typo of URLs
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
2016-10-19 17:46:27 +08:00
Derek McGowan
520034e35b
Add limit to page size used by overlay2 driver
Go can falsely report a larger page size than supported,
causing overlay2 mount arguments to be truncated. When overlay2
detects the mount arguments have hit the page limit, it will
switch to using relative paths. If this limit is smaller than
the actual page size there is no behavioral problems, but if it
is larger mounts can fail for images with many layers.

Closes #27384

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-10-18 17:34:19 -07:00
Sebastiaan van Stijn
3b0660da30 Merge pull request #26421 from aaronlehmann/update-thresholds-rollbacks
Service update failure thresholds and rollback
2016-10-18 15:26:24 -07:00
Alexander Morozov
32156e1758 Merge pull request #27483 from YuPengZTE/devFixLink
Fix the typo of link in devmapper
2016-10-18 12:45:31 -07:00
Aaron Lehmann
6d4b527699 Service update failure thresholds and rollback
This adds support for two enhancements to swarm service rolling updates:

- Failure thresholds: In Docker 1.12, a service update could be set up
  to either pause or continue after a single failure occurs. This adds
  an --update-max-failure-ratio flag that controls how many tasks need to
  fail to update for the update as a whole to be considered a failure. A
  counterpart flag, --update-monitor, controls how long to monitor each
  task for a failure after starting it during the update.

- Rollback flag: service update --rollback reverts the service to its
  previous version. If a service update encounters task failures, or
  fails to function properly for some other reason, the user can roll back
  the update.

SwarmKit also has the ability to roll back updates automatically after
hitting the failure thresholds, but we've decided not to expose this in
the Docker API/CLI for now, favoring a workflow where the decision to
roll back is always made by an admin. Depending on user feedback, we may
add a "rollback" option to --update-failure-action in the future.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-18 10:09:50 -07:00
Kenfe-Mickaël Laventure
f5c21faf88 Merge pull request #27472 from dnephin/move-graphdriver-quota
Move graphdriver quota
2016-10-18 09:09:09 -07:00
Yong Tang
d7be6b2deb Add config parameter to change stop timeout during daemon shutdown
This fix tries to add a daemon config parameter `--shutdown-timeout`
that specifies the timeout value to stop containers gracefully
(before SIGKILL). The default value is 15s.

The `--shutdown-timeout` parameter is added to daemon options and
config file. It will also be updated during daemon reload.

Additional test cases have been added to cover the change.

This fix fixes #22471.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-18 08:07:50 -07:00
Yong Tang
e4c9079d09 Remove duplicate keys in labels of docker info
This fix tries to address the issue raised in 24392 where
labels with duplicate keys exist in `docker info`, which
contradicts with the specifications in the docs.

The reason for duplicate keys is that labels are stored as
slice of strings in the format of `A=B` (and the input/output).

This fix tries to address this issue by checking conflict
labels when daemon started, and remove duplicate labels (K-V).

The existing `/info` API has not been changed.

An additional integration test has been added to cover the
changes in this fix.

This fix fixes 24392.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-18 07:45:27 -07:00
Vincent Demeester
dad8cbfc2d Merge pull request #22566 from yongtang/22471-daemon-shutdown-timeout
Add config parameter to change per-container stop timeout during daemon shutdown
2016-10-18 14:33:09 +02:00
Sebastiaan van Stijn
24582e8153 Merge pull request #27471 from caarlos0/logentries
Added Logentries Driver
2016-10-18 01:33:28 -07:00
YuPengZTE
f7701d90a9 Fix the typo of link in devmapper
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
2016-10-18 16:02:38 +08:00
Daniel Nephin
eb4c4b7ecf Make golint happy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-17 17:28:27 -07:00
Daniel Nephin
767727480f move graphdriver/projectquota.go to its own package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-10-17 17:27:24 -07:00
Yong Tang
cc703784f3 Update docker stop and docker restart to allow not specifying timeout and use the one specified at container creation time.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-17 12:53:35 -07:00
Yong Tang
e66d210891 Add config parameter to change per-container stop timeout during daemon shutdown
This fix tries to add a flag `--stop-timeout` to specify the timeout value
(in seconds) for the container to stop before SIGKILL is issued. If stop timeout
is not specified then the default timeout (10s) is used.

Additional test cases have been added to cover the change.

This fix is related to #22471. Another pull request will add `--shutdown-timeout`
to daemon for #22471.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-17 12:28:46 -07:00
John Howard
7453d028da Windows: Calculate PID file after root
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-17 11:48:51 -07:00
Amir Goldstein
9ea5071446 projectquota: fix build failure with new kernels
In kernel version >= v4.5 the project quota ioctl definitions
have been made public via the include/uapi/linux/fs.h API, so
that ext4 could use the same API.

Avoid re-defining the ioctl API if it is already defined in fs.h.

Signed-off-by: Amir Goldstein <amir73il@aquasec.com>
2016-10-17 21:44:23 +03:00
Vincent Demeester
165a3d0a75 Merge pull request #25566 from allencloud/fix-config-load-bug
fix config load error with default ulimits
2016-10-17 18:58:12 +02:00
Michael Crosby
8863a9f62c Merge pull request #24771 from aquasecurity/xfs_quota
Implement XFS quota for overlay2
2016-10-17 09:23:42 -07:00
Madhu Venugopal
5e9c78aeaf Allow plugins to have multiple handlers
Currently the plugins pkg allows a single handler. This assumption
breaks down if there are mutiple listeners to a plugin of a certain
Manifest such as NetworkDriver or IpamDriver when swarm-mode is enabled.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-10-17 09:00:17 -07:00
Vincent Demeester
e40c512f60 Merge pull request #27392 from Microsoft/jjh/securitydescriptor
Windows: Set administrators ACL on debug listener
2016-10-17 17:13:38 +02:00
Vincent Demeester
b0f3d7a1b5 Merge pull request #27367 from Microsoft/jjh/fieldsincontainer
Windows: Factor out unused fields in container
2016-10-17 16:50:39 +02:00
allencloud
e3164842f3 fix config load error with ulimits
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-17 18:48:40 +08:00
Yong Tang
40f25809ab Fix an incorrect WARNING output in docker run/create
This fix tries to fix an incorrect `WARNING` output in `docker run/create`:
```
ubuntu@ubuntu:~/docker$ docker run -d --cpu-percent 80 busybox top
WARNING: %s does not support CPU percent. Percent discarded.
WARNING: linux
e963d1108e455e7f8f57626ca1305b5f1999e46025d2865b9a21fc8abc51a546
```

The reason was that in `daemon/daemon_unix.go`, the warning string
was not combined with `fmt.Sprintf` before appended to the output.

This fix fixes this issue.

This fix has been manually tested and verified:
```
ubuntu@ubuntu:~/docker$ docker run -d --cpu-percent 80 busybox top
WARNING: linux does not support CPU percent. Percent discarded.
fcf53f79d389235bae846d3d40804834659ac025edbc0d075ed91841a8e4c740
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-16 17:11:39 -07:00
Sebastiaan van Stijn
f2c094cb99 Merge pull request #27334 from darrenstahlmsft/ExpandSandboxSizeZero
Windows: Stop expanding sandbox size when no new size is specified
2016-10-14 17:51:32 -07:00
John Howard
192e6d9995 Windows: Set ACL on debug listener
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-14 09:15:17 -07:00
Thomas Leonard
b8793cff48 Reset health status to starting when a container is restarted
Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
2016-10-14 15:49:12 +01:00
Tibor Vass
9ced849832 Merge pull request #27027 from tonistiigi/fix-name-collision
Fix name collision handling in restore
2016-10-14 08:59:56 +02:00
Sebastiaan van Stijn
429812f86a Merge pull request #27335 from barracks510/master
Simplify function signature
2016-10-13 18:54:01 -07:00
John Howard
600f0ad211 Windows: Factor out unused fields in container
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-13 14:51:10 -07:00
Elena Morozova
64238fef8c all: replace loop with single append
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
2016-10-13 13:31:52 -07:00
Sebastiaan van Stijn
0542dcc2d0 Merge pull request #27207 from tonistiigi/deprecate-repo-shortid
Deprecate repo:shortid syntax
2016-10-12 23:44:38 -07:00
Dennis Chen
445620f231 Simplify function signature
Signed-off-by: Dennis Chen <barracks510@gmail.com>
2016-10-12 21:31:55 -04:00
Darren Stahl
0da31c68f1 Stop expanding sandbox size when no new size is specified
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-12 16:58:57 -07:00
Tibor Vass
8658748ef7 Merge pull request #27293 from anusha-ragunathan/use-pluginv2-authz
Make authz use pluginv2
2016-10-13 00:28:43 +02:00
Sebastiaan van Stijn
a7db0a8402 Merge pull request #27294 from mlaventure/hide-unused-volume-fields
Move types.Volumes optional fields under a new type
2016-10-11 23:55:25 +02:00
Anusha Ragunathan
c5393ee147 Make authorization plugins use pluginv2.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-11 13:09:28 -07:00
Kenfe-Mickael Laventure
d36952749d Move types.Volumes optional fields under a new type
This allows us to hide those fields when they are not filled.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-11 11:49:26 -07:00
Anusha Ragunathan
a98be0344b Update plugingetter import path in docker/docker.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-11 11:24:18 -07:00
Sebastiaan van Stijn
f7d1682c60 Merge pull request #26896 from jmzwcn/issue26244
Fix issue26244:swarm service, with overlay network, fails to remove all containers
2016-10-11 14:40:39 +02:00
Justin Cormack
d316e172da Merge pull request #26690 from mwhudson/ignore-oom_score_adj-failure
Ignore failure to set oom_score_adj, as happens in an unprivileged container.
2016-10-11 10:01:22 +01:00
Tõnis Tiigi
2945f902bd Merge pull request #27259 from LK4D4/no_map_pointers
daemon: do not use pointers to map
2016-10-10 13:15:03 -07:00
Alexander Morozov
44c280afbf daemon: do not use pointers to map
Also, do not shadow err with :=

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-10-10 11:37:36 -07:00
Justin Cormack
b5cbd84439 Merge pull request #27230 from allencloud/fix-bugs-in-prune
better prune and system df
2016-10-10 19:30:06 +01:00
Kenfe-Mickaël Laventure
7ba31540f0 Merge pull request #27209 from tonistiigi/sleep-between-layers
Fix naivediffdriver timestamp precision bug
2016-10-10 10:24:49 -07:00
allencloud
fd62b6c950 better prune and system df
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-11 00:42:21 +08:00
Daniel Zhang
434eae7dfd fix issue26244
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2016-10-09 12:36:44 +08:00
Tonis Tiigi
d1a83059f7 Fix naivediffdriver timestamp precision bug
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-07 13:52:17 -07:00
Tonis Tiigi
606a245d85 Remove restartmanager from libcontainerd
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-07 12:09:54 -07:00
Vincent Demeester
febf53d91a Merge pull request #26996 from Microsoft/jjh/imageinspectosversion
(Windows) Inspect image populate OSVersion
2016-10-07 18:33:01 +02:00
Vincent Demeester
b3cc3d7bf9 Merge pull request #23389 from Microsoft/jjh/credentialspec
Windows: Support credential specs
2016-10-07 18:32:44 +02:00
Vincent Demeester
91312f71aa Merge pull request #26882 from runcom/proxy-path
Specify userland proxy path
2016-10-07 09:44:39 +02:00
Carlos Alexandro Becker
2764d67c3a
added logentries driver
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2016-10-06 22:48:53 -03:00
Tonis Tiigi
5fc71599a0 Deprecate repo:shortid syntax
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-06 17:12:17 -07:00
John Howard
b7f537e811 Inspect populate image OSVersion
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-06 11:46:24 -07:00
John Howard
e85867cb68 Windows: Support credential specs
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-06 09:32:22 -07:00
Antonio Murdaca
dd2e1947dc
daemon: add --userland-proxy-path flag
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-06 17:31:53 +02:00
Brian Goff
f19120c305 Merge pull request #27167 from Microsoft/jjh/blockexport
Windows: export not supported
2016-10-06 16:05:36 +02:00
John Howard
73932d8d22 Windows: export not supported
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-05 13:15:44 -07:00
Stefan J. Wernli
78540d0d18 Fixing servicing bug by always specifying LayerFolderPath
During the recent OCI changes, I mistakenly thought LayerFolderPath is only needed for Windows Server containers (isolation=process) and not for Hyper-V Containers, but it turns out it is also required for servicing containers used to finish installing updates.  Since the servicing containers need to reuse the container's create options, this change makes it so that LayerFolderPath is always filled in for all containers as part of constructing the create options.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-10-04 15:29:30 -07:00
Vincent Demeester
694ba71e36 Merge pull request #26989 from aboch/none
Respect --bridge=none
2016-10-04 16:25:39 +02:00
Brian Goff
5e072a25f8 Merge pull request #27136 from allencloud/add-lock-in-libcontainerd
add lock in libcontainerd client AddProcess of Windows
2016-10-04 09:29:59 -04:00
allencloud
5143be0ccf add lock in libcontainerd client AddProcess of Windows
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-04 10:29:21 +08:00
Anusha Ragunathan
0cc7f0185f Merge pull request #26860 from anusha-ragunathan/nw-pv2
Make libnetwork use pluginv2.
2016-10-03 17:12:16 -07:00
Anusha Ragunathan
ed6e30767e Shutdown plugins after containers.
Fixes #26278

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-03 15:52:44 -07:00
Tonis Tiigi
7381c84bfb Don’t attempt to reconnect swarm on failed join after timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-03 13:38:01 -07:00
Alessandro Boch
a0af884d3a Respect --bridge=none
- Do not create the default "bridge" network
- Get rid of the docker0 bridge

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-10-03 11:08:34 -07:00
Anusha Ragunathan
a00940f02c Initialize libnetwork and IPAMDriver with pluginstore.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-03 10:40:05 -07:00
Vincent Demeester
6e8a2cd291 Merge pull request #27062 from yank1/Inconsistency-"on_failure"-vs-"on-failure"
Fix conversion of restart-policy from GRPC
2016-10-01 10:39:00 +02:00
Arnaud Porterie
86de7c000f Merge pull request #26108 from mlaventure/data-mngt
New Data Management commands
2016-10-01 03:17:18 +00:00
Kenfe-Mickael Laventure
b650a7bd27 Add new df subcomand to the system command
This command display the state of the data usage of the docker daemon.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-30 14:35:23 -07:00
Michael Crosby
97660c6ec5 Merge pull request #26961 from Microsoft/jjh/oci
Windows: OCI runtime spec compliance
2016-09-30 10:13:57 -07:00
Kay Yan
bc32fcabeb Fix conversion of restart-policy from GRPC
restart-condition for services from "on_failure" to "on-failure".

Since GRPC does not support dashes in properties, this change
added a conversion when _setting_ the restart-condition.

However, when inspecting a service, no conversion took place
from the internal GRPC value, resulting in "on_failure" to
be shown.

This change updates the conversion to fix this, and removes
a "hack" that was previously used for this, now using a
Switch to compare to actual types.

Before this change:

    docker service create --name web --restart-condition=on-failure nginx:alpine

    docker service inspect --format '{{ json .Spec.TaskTemplate.RestartPolicy }}' web
    {"Condition":"on_failure","MaxAttempts":0}

Afer this change:

    docker service create --name web --restart-condition=on-failure nginx:alpine

    docker service inspect --format '{{ json .Spec.TaskTemplate.RestartPolicy }}' web
    {"Condition":"on-failure","MaxAttempts":0}

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2016-09-30 15:54:47 +08:00
Tonis Tiigi
e981459609 Fix missing hostname and links in exec env
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-29 13:46:10 -07:00
Michael Crosby
1d669d82c1 Merge pull request #26994 from Microsoft/jjh/fix26461regression
Windows: Don't set PATH/TERM on exec
2016-09-29 13:34:12 -07:00
allencloud
6184ff312d change code in container restore
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-30 02:44:21 +08:00
Vincent Demeester
b6ad6d98fd Merge pull request #24411 from vdemeester/24393-ps-filter-managed
Add a new "is-task" ps filter
2016-09-29 18:54:15 +02:00
Tonis Tiigi
a9c1575b1a Fix name collision handling in restore
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-29 08:35:10 -07:00
Kenfe-Mickael Laventure
33f4d68f4d Add /{containers,volumes,images}/prune API endpoint
These new endpoints request the daemon to delete all resources
considered "unused" in their respective category:
  - all stopped containers
  - all volumes not attached to any containers
  - images with no associated containers

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-29 07:42:53 -07:00
Kenfe-Mickael Laventure
f2e11fb8d1 Add /system/df API endpoint
This endpoint return data regarding the space used by docker on disk

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-29 07:42:53 -07:00
Kenfe-Mickael Laventure
b717de5153 Update Images() to allow retrieving specific image size data
Those data include:
 - size of data shared with other images
 - size of data unique to a given image
 - how many containers are using a given image

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-29 07:42:53 -07:00
Kenfe-Mickael Laventure
c6db1e9c1b Add Size and RefCount fields to types.Volume
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-29 07:42:53 -07:00
John Howard
e880bbc48b Windows: Don't set PATH/TERM on exec
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-28 13:42:27 -07:00
Vincent Demeester
601004e1a7 Merge pull request #26972 from allencloud/clear-health-monitor-log
make health check log more readable
2016-09-28 14:22:43 +02:00
Sebastiaan van Stijn
9f0593990f Merge pull request #26941 from runcom/docker-init-path-1
configure docker-init binary path
2016-09-28 13:12:59 +02:00
Vincent Demeester
5280ba83e5
Add a new "is-task" ps filter
This makes it easier to list containers that are part of a task
(swarm mode) and those who are not.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-09-28 12:45:30 +02:00
Vincent Demeester
b0e1b8fc79 Merge pull request #24850 from yongtang/24270-service-tasks-filter
Fix partial/full filter issue in `service tasks --filter`
2016-09-28 11:50:27 +02:00
allencloud
a4a4f3733f make health check log more readable
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-28 14:10:15 +08:00
John Howard
8f76a1d08b Windows: Set correct root path logic
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-27 15:21:28 -07:00
John Howard
02309170a5 Remove hacked Windows OCI spec, compile fixups
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-27 12:07:35 -07:00
Vincent Demeester
97d4b9c465 Merge pull request #26074 from allencloud/return-err-when-remove-container-in-progress
make client side know container removal in progress
2016-09-27 18:48:03 +02:00
Vincent Demeester
b881148385 Merge pull request #26255 from Microsoft/jjh/xenon-test-infrastructure
Add isolation to info - enables Hyper-V containers CI bring-up
2016-09-27 18:46:51 +02:00
Brian Goff
c2f57291ac Merge pull request #26898 from YuPengZTE/devErrorsNew
In error, the first letter is low-case letter
2016-09-27 10:10:57 -04:00
Antonio Murdaca
6a12685bb7
configure docker-init binary path
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-09-27 14:49:17 +02:00
Yong Tang
eb19c2f080 Let swarmkit handle cluster defaults in swarm init if not specified
This fix tries to address the issue raised in 24958 where previously
`docker swarm init` will automatically fill in all the default value
(instead of letting swarmkit to handle the default).

This fix update the `swarm init` so that initial value are passed only
when a flag change has been detected.

This fix fixes 24958.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-27 04:19:38 -07:00
allencloud
9a58f298d1 make client side know container removal in progress
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-27 18:06:54 +08:00
Vincent Demeester
b826bebda0 Merge pull request #24634 from thaJeztah/make-network-name-required
API return network-list if no network-name or id is provided
2016-09-27 10:20:38 +02:00
YuPengZTE
110ab746ba In error, the first letter is low-case letter
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
2016-09-27 10:40:07 +08:00
Yong Tang
f676fc93c3 Fix partial/full filter issue in service tasks --filter
This fix tries to address the issue related to 24108 and 24790, and
also the case from 24620#issuecomment-233715656

The reason for the failure case in the above mentioned issues is that
currently Task names are actually indexed by Service Name
(`e.ServiceAnnotations.Name`)

To fix it, a pull request in swarmkit (swarmkit/pull/1193) has been
opened separately.

This fix adds the integration tests for the above mentioned issues.
Swarmkit revendoring is needed to completely fix the issues.

This fix fixes 24108.
This fix fixes 24790.
This fix is related to 24620.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-26 16:01:20 -07:00