Commit graph

3647 commits

Author SHA1 Message Date
Yong Tang
382c152a73 Emit events for docker daemon
This fix tries to cover the issue raised in #22463 by emitting
events for docker daemon so that user could be notified by
scenarios like config reload, etc.

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

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

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-23 19:00:47 -07:00
Michael Crosby
8bb4d31b10 Remove mountedLayer Mount and Unmount
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 16:52:58 -07:00
Amit Krishnan
86d8758e2b Get the Docker Engine to build clean on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
2016-05-23 16:37:12 -07:00
Michael Crosby
36a82c2032 Fix overlay use of rootdir and defer
Check for the rootDir first because the mergeDir may not exist if root
is present.

Also fix unmounting in the defer to make sure it does not have a
refcount.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 16:03:40 -07:00
Michael Crosby
4bac8bce98 Add windows graph driver ref counter
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 16:03:40 -07:00
Michael Crosby
5b6b8df0c1 Add reference counting to aufs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 15:57:23 -07:00
Michael Crosby
1ba05cdb6a Add fast path for fsmagic supported drivers
For things that we can check if they are mounted by using their fsmagic
we should use that and for others do it the slow way.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 15:57:23 -07:00
Michael Crosby
31e903b0e1 Remove restart test
This test is not applicable anymore now that containers are not stopped
when the daemon is restored.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 15:57:23 -07:00
Michael Crosby
290be017c5 Remove overlay pathCache
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 15:57:23 -07:00
Michael Crosby
009ee16bef Restore ref count
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 15:57:23 -07:00
Alexander Morozov
9f1a121259 Merge pull request #22774 from Microsoft/jjh/client
Windows: Daemon default to Hyper-V containers on client
2016-05-23 11:29:50 -07:00
Alexander Morozov
3ab9049be3 Merge pull request #22856 from thaJeztah/dont-warn-when-net-none
Suppress "IPv4 forwarding" warning for --net=none
2016-05-23 11:11:21 -07:00
Vincent Demeester
d5baf8ddcf
Move some image related methods & struct to smaller files
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-21 22:36:11 +02:00
John Howard
ef2db56bcf Windows: Default to Hyper-V Containers on client
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-21 11:29:53 -07:00
Vincent Demeester
7311d687e0 Merge pull request #22775 from Microsoft/jjh/removewindowsdiff
Windows: Remove windowsdiff graph driver
2016-05-21 08:02:20 +02:00
John Howard
dd0fc2be8b Windows: Remove windowsdiff driver
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-20 16:18:19 -07:00
Sebastiaan van Stijn
27f34593ea
Suppress "IPv4 forwarding" warning for --net=none
There's no need to warn that "ip-forwarding" is disabled
if a container doesn't use networking.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-05-20 17:57:29 +02:00
Vincent Demeester
52debcd58a Merge pull request #22820 from thaJeztah/suppress-incorrect-warning
Suppress "IPv4 forwarding" warning for --net=host
2016-05-20 17:17:10 +02:00
Fabrizio Soppelsa
e009ebdf4c
Add a --filter option to docker search
The filtering is made server-side, and the following filters are
supported:

* is-official (boolean)
* is-automated (boolean)
* has-stars (integer)

Signed-off-by: Fabrizio Soppelsa <fsoppelsa@mirantis.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-20 13:41:28 +02:00
Sebastiaan van Stijn
0e9009bae3 Merge pull request #22554 from justincormack/seccap
Align default seccomp profile with selected capabilities
2016-05-20 12:58:28 +02:00
Ken Herner
04b4e3e6d8 Add test to ZFS for disk quota
Signed-off-by: Ken Herner <kherner@progress.com>
2016-05-19 14:49:04 -04:00
Ken Herner
373654f43e Add error check after parseStorageOpt
Signed-off-by: Ken Herner <kherner@progress.com>
2016-05-19 14:49:04 -04:00
Ken Herner
e918340431 Add support for setting storage size on zfs containers
Now supports setting a containers storage size when using zfs as the
storage engine.  By passing in `--storage-opt size=<size>`, the created
container's storage size will be limited to the given size.  Note that
the way zfs works, the given specified storage size will be given in
addition to the base container size.

Example:

The node image reports a size of `671M` from `df -h` when started.
Setting `--storage-opt size=2G` will result in a drive the size of
`671M` + `2G`, `2.7G` in total.  Available space will be `2.0G`.

The storage size is achieved by setting the zfs option `quota` to the
given size on the zfs volume.

Signed-off-by: Ken Herner <kherner@progress.com>
2016-05-19 14:49:04 -04:00
Vincent Demeester
ebeb5a0422 Merge pull request #22481 from mrunalp/pid_container
Add support for --pid=container:<id>
2016-05-19 19:00:40 +02:00
root
f53902aa77 Fix some mistakes in dockerd.md
Signed-off-by: Wang Xing <hzwangxing@corp.netease.com>
2016-05-19 20:41:37 +08:00
John Howard
04eaa74901 Merge pull request #22712 from swernli/update_fix
Fixing Windows update logic.
2016-05-18 12:00:10 -07:00
Sebastiaan van Stijn
5fb7f9b29e
Suppress "IPv4 forwarding" warning for --net=host
Containers using the host network stack (--net=host)
are not affected by "ip-forwarding" being disabled,
so there's not need to show a warning.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-05-18 20:10:31 +02:00
Mrunal Patel
fb43ef649b Add support for --pid=container:<id>
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-05-17 13:49:05 -04:00
Alessandro Boch
6eb2b903a3 Docker changes for libnetwork vendoring b66c038
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-16 15:04:01 -07:00
John Howard
4c6838137c Merge pull request #22728 from Microsoft/jstarks/improve_import
Windows: reexec during layer import
2016-05-16 11:08:05 -07:00
Tibor Vass
0088b8fbbe Merge pull request #22561 from cpuguy83/delay_start_for_discovery
Wait for discovery on container start error
2016-05-16 09:57:19 -04:00
John Starks
b3bc5e0fe4 Windows: reexec when importing layers
This improves reliability by doing parsing of potentially untrusted data
in a separate process. It opens the door for further security improvements
if we can lock down the reexec-ed process. It also improves import
performance by only taking the backup and restore privileges once, for the
whole process.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-05-13 18:16:11 -07:00
Yong Tang
38c49d9987 Remove docker/ prefix from log messages tag.
This fix tries to address the issue raised in #22358 where syslog's
message tag always starts with `docker/` and can not be removed
by changing the log tag templates.

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

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

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

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

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

This fix fixes #22358.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-12 22:29:30 -07:00
Stefan J. Wernli
a5b64f2847 Fixing Windows update logic.
Removing the call to Shutdown from within Signal in order to rely on waitExit handling the exit of the process.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-05-12 17:45:53 -07:00
Alexander Morozov
cf783266ff Merge pull request #22279 from WeiZhang555/wait-channel
Remove WaitRunning
2016-05-12 14:56:55 -07:00
Alexander Morozov
150009e9d8 Merge pull request #22630 from thaJeztah/refactor-overlay-compatibility
refactor overlay storage driver compatibility check
2016-05-12 12:00:57 -07:00
Arnaud Porterie
e9117578a7 Merge pull request #22445 from yongtang/20936-22443-concurrent-connection
Docker pull/push with max concurrency limits.
2016-05-12 08:51:28 -07:00
Vincent Demeester
7fd9f9964a Merge pull request #22620 from yongtang/05092016-remove-deprecated-driver-specific-log-tags
Remove deprecated driver specific log tags
2016-05-12 13:20:07 +02:00
Yong Tang
7368e41c07 Docker pull/push with max concurrency limits.
This fix tries to address issues raised in #20936 and #22443
where `docker pull` or `docker push` fails because of the
concurrent connection failing.
Currently, the number of maximum concurrent connections is
controlled by `maxDownloadConcurrency` and `maxUploadConcurrency`
which are hardcoded to 3 and 5 respectively. Therefore, in
situations where network connections don't support multiple
downloads/uploads, failures may encounter for `docker push`
or `docker pull`.

This fix tries changes `maxDownloadConcurrency` and
`maxUploadConcurrency` to adjustable by passing
`--max-concurrent-uploads` and `--max-concurrent-downloads` to
`docker daemon` command.

The documentation related to docker daemon has been updated.

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

This fix fixes #20936. This fix fixes #22443.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-11 19:44:54 -07:00
Arnaud Porterie
b3a1ae02a9 Merge pull request #22353 from Microsoft/jjh/dockercp
Windows: docker cp platform semantically consistent paths
2016-05-11 13:08:24 -10:00
Brian Goff
2dce79e05a Wait for discovery on container start error
This gives discovery a chance to initialize, particularly if the K/V
store being used is in a container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-05-11 09:49:51 -04:00
Justin Cormack
a01c4dc8f8 Align default seccomp profile with selected capabilities
Currently the default seccomp profile is fixed. This changes it
so that it varies depending on the Linux capabilities selected with
the --cap-add and --cap-drop options. Without this, if a user adds
privileges, eg to allow ptrace with --cap-add sys_ptrace then still
cannot actually use ptrace as it is still blocked by seccomp, so
they will probably disable seccomp or use --privileged. With this
change the syscalls that are needed for the capability are also
allowed by the seccomp profile based on the selected capabilities.

While this patch makes it easier to do things with for example
cap_sys_admin enabled, as it will now allow creating new namespaces
and use of mount, it still allows less than --cap-add cap_sys_admin
--security-opt seccomp:unconfined would have previously. It is not
recommended that users run containers with cap_sys_admin as this does
give full access to the host machine.

It also cleans up some architecture specific system calls to be
only selected when needed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-11 09:30:23 +01:00
Sebastiaan van Stijn
1fc0acc9ae
refactor overlay storage driver compatibility check
use a consistent approach for checking if the
backing filesystem is compatible with the
storage driver.

also add an error-message for the AUFS driver if
an incompatible combination is found.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-05-10 18:22:36 +02:00
Yong Tang
a20b02b915 Remove deprecated driver specific log tags
Since 1.9, driver specific log tag options
`syslog-tag`
`gelf-tag`
`fluentd-tag`
have been deprecated in favor of the generic tag
option which is standard across different logging
drivers.

This fix removed the deprecated driver specific
log tag options of `syslog-tag`, `gelf-tag`,
`fluentd-tag` for 1.12 and updated the docs.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-10 07:43:44 -07:00
Alexander Morozov
e16753ce19 Merge pull request #22465 from allencloud/handle-error-when-getting-hostname-in-docker-info
handle error when getting hostname in info api
2016-05-09 14:57:36 -07:00
Vincent Demeester
20d5d10983 Merge pull request #21115 from wenchma/linkable
update link comments
2016-05-09 14:37:34 +02:00
Wen Cheng Ma
c52a373bc8 update link comments
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2016-05-09 14:12:28 +08:00
Vincent Demeester
08ec3606f1 Merge pull request #21889 from cpuguy83/logscmd_add_attrs
Add support for reading logs extra attrs
2016-05-07 20:26:33 +02:00
Shijiang Wei
391441c28b fix LogConfig for containers created before docker 1.12 on daemon startup
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-05-08 00:29:38 +08:00
Lei Jitang
5e5e1d7ada Fix docker create with duplicate volume failed to remove
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-05-06 22:48:02 -04:00
allencloud
a1c950913f handle error when getting hostname in info api
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-05-07 08:51:52 +08:00
Brian Goff
bd9d14a07b Add support for reading logs extra attrs
The jsonlog logger currently allows specifying envs and labels that
should be propagated to the log message, however there has been no way
to read that back.

This adds a new API option to enable inserting these attrs back to the
log reader.

With timestamps, this looks like so:
```
92016-04-08T15:28:09.835913720Z foo=bar,hello=world hello
```

The extra attrs are comma separated before the log message but after
timestamps.

Without timestaps it looks like so:
```
foo=bar,hello=world hello
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-05-06 20:42:20 -04:00
John Howard
7f66598583 Windows: docker cp consistent paths
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-06 16:08:53 -07:00
Brian Goff
e9bef66021 Merge pull request #21961 from yongtang/21956-docker-inspect-log-default-options
Docker inspect gave default log options even when the option is emtpy.
2016-05-05 21:02:39 -04:00
Zhu Guihua
401c8d1767 Add disk quota support for btrfs
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
2016-05-05 14:35:13 +08:00
Sebastiaan van Stijn
1fe9715f30 Merge pull request #22423 from mlaventure/rm-containers-if-rm-in-progress-on-restart
Reset RemovalInProgress flag on daemon restart
2016-05-04 23:57:16 +02:00
Vincent Demeester
4c88c67058 Merge pull request #21947 from boynux/fix-filter-exited
exited=0 in filter shouldn't show "Created" ones
2016-05-04 15:21:59 +02:00
Yong Tang
4b5404f15e Docker inspect gave default log options even when the option is emtpy.
This fix tries to addess the issue in #21956 where `docker inspect`
will overwrite the log config options with default option even when
the `--log-driver` is not empty and `--log-opt` is empty. In this
situation, `docker inspect` and `docker run` is different.

With the introduction of #21153, the `HostConfig` will always have
the correct log-driver and log-opt values.

However, the previous processing of `docker inspect` was not updated
after the change in #21153. This results in the incorrect behavior.

This fix addresses this issue by updating `docker inspect` to conform
to #21153 so the the behavior of `docker inspect` and `docker run` is
consistent.

A integration test has been added to cover this fix.

This fix fixes #21956. This fix is related to #21153.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-02 21:14:42 -07:00
Brian Goff
227c83826a Merge pull request #21945 from rhvgoyal/export-min-free-space
Export Mininum Thin Pool Free Space through docker info
2016-05-02 20:20:08 -04:00
Brian Goff
75e63c942e Merge pull request #21153 from mountkin/log-validator
inherit the daemon log options when creating containers
2016-05-02 16:12:43 -04:00
Liron Levin
526abc00b1 Fix authorization issue - when request is denied return forbbiden exist code (403).
- Return 403 (forbidden) when request is denied in authorization flows
(including integration test)
- Fix #22428
- Close #22431

Signed-off-by: Liron Levin <liron@twistlock.com>
2016-05-02 19:14:48 +03:00
Shijiang Wei
1790980ec6 inherit the daemon log options when creating containers
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-05-02 23:04:04 +08:00
Vincent Demeester
7a56581297 Merge pull request #22319 from thaJeztah/network-driver-filter
Add "driver" filter for network ls
2016-04-30 10:38:10 +02:00
Kenfe-Mickael Laventure
ce72473197 Reset RemovalInProgress flag on daemon restart
This flag can be set on disk if the daemon were to crash or error out
while trying to remove container in which case subsequent tries to
delete the container would all fail.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-04-29 14:06:27 -07:00
Tonis Tiigi
668f0a2a4c Simplify blkio resources setup in spec
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-29 13:39:04 -07:00
Sebastiaan van Stijn
23e418b6c9
Add "driver" filter for network ls
This add a new filter to 'docker network ls'
to allow filtering by driver-name.

Contrary to "ID" and "name" filters, this
filter only supports an *exact* match.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-04-29 16:22:26 +02:00
Brian Goff
dbee44c9e0 Merge pull request #21613 from wzyboy/support-unixgram-syslog-address
Support unixgram syslog address
2016-04-28 11:06:17 -04:00
Vincent Demeester
78eb8a5fb9 Merge pull request #21641 from yongtang/21595-discrepancy-on-hostname-validation
API/CLI discrepancy on hostname validation (#21595).
2016-04-28 09:25:13 +02:00
Zhuoyun Wei
57fad95e43
Support unixgram syslog address
- Consider unixgram:// as a valid URL prefix
- Parse unixgram:// addresses
- Update docs

Signed-off-by: Zhuoyun Wei <wzyboy@wzyboy.org>
2016-04-28 11:04:50 +08:00
Zhang Wei
a0191a2341 Remove WaitRunning
Remove function `WaitRunning` because it's actually not necessary, also
remove wait channel for state "running" to avoid mixed use of the state
wait channel.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-27 11:36:47 +08:00
Kai Qiang Wu(Kennan)
0656105710 Add load/save image event support
For every docker load and save operations, it would log related
image events.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-27 01:11:03 +00:00
Brian Goff
0147164cfd Merge pull request #22329 from runcom/fix-tmpfs-order
daemon: reorder mounts before setting them
2016-04-26 20:23:13 -04:00
John Howard
a8c5ba7517 Merge pull request #21384 from Microsoft/10662-IOResourceControls
Add IO Resource Controls for Windows
2016-04-26 15:54:52 -07:00
Antonio Murdaca
6a8ea46c67 daemon: reorder mounts before setting them
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-04-26 11:03:25 +02:00
Kai Qiang Wu(Kennan)
718eba8836 Fix wrong comment
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-26 07:36:14 +00:00
Brian Goff
e2c40555f7 Merge pull request #22318 from mrunalp/mount_label_fix
Fix mount label
2016-04-25 19:54:32 -04:00
Mrunal Patel
e0f98c698b Update runc and spec dependencies for mount label
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Set up the mount label in the spec for a container

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-04-25 14:26:49 -07:00
Darren Stahl
8df2066341 Add IO Resource Controls for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-04-25 13:07:29 -07:00
Stefan J. Wernli
da92dad59f Adding servicing update to postRunProcessing for Windows containers.
This change enables the workflow of finishing installing Windows OS updates in the container after it has completed running, via a special servicing container.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-25 12:16:26 -07:00
Vincent Demeester
88d1ae148c Merge pull request #22272 from yongtang/22271-relative-symlinks
Relative symlinks don't work with --device argument
2016-04-25 18:10:04 +02:00
David Calavera
28b7dc51ae Merge pull request #21583 from allencloud/move-cors-into-common-config
move cors into common config
2016-04-25 09:08:38 -07:00
Yong Tang
632b314b23 Relative symlinks don't work with --device argument
This fix tries to address the issue raised in #22271 where
relative symlinks don't work with --device argument.

Previously, the symlinks in --device was implemneted (#20684)
with `os.Readlink()` which does not resolve if the linked
target is a relative path. In this fix, `filepath.EvalSymlinks()`
has been used which will reolve correctly with relative
paths.

An additional test case has been added to the existing
`TestRunDeviceSymlink` to cover changes in this fix.

This fix is related to #13840 and #20684, #22271.
This fix fixes #22271.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-25 07:22:56 -07:00
Sebastiaan van Stijn
455858fc70
fix reloading of daemon labels from config
commit 20a038eca6 changed
daemon configuration reloading to check if a value
was actually set, however, it checked for the wrong
property ("label" instead of "labels"), which resulted
in the labels only to be loaded from daemon.json if both
a "label" -and- a "labels" property was present.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-04-25 15:57:28 +02:00
allencloud
2feb88cbd3 1.move cors into common config
2.windows can use cors, too
3.remove function setPlatformServerConfig

Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-04-25 10:52:13 +08:00
Vincent Demeester
4e5ad97f5b Merge pull request #22138 from wenchma/deprecated_since_before
Deprecated of docker ps since and before options for v1.12
2016-04-24 11:23:21 +02:00
David Calavera
8a0d2d8e57 Merge pull request #22168 from cpuguy83/22116_hack_in_layer_refcounts
Add refcounts to graphdrivers that use fsdiff
2016-04-22 15:17:12 -07:00
Kai Qiang Wu(Kennan)
62cb06a6c1 Make cpu validation correct
There was an error in validation logic before, should use period
instead of quota, and also add check for negative
number here, if not with that, it would had cpu.cfs_period_us: invalid argument
which is not good for users.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-22 01:18:03 +00:00
Michael Crosby
6f67c13d20 Merge pull request #22213 from yongtang/22210-docker-http-panics
Docker http panics caused by container deletion with empty names.
2016-04-21 10:37:24 -07:00
Brian Goff
7342060b07 Add refcounts to graphdrivers that use fsdiff
This makes sure fsdiff doesn't try to unmount things that shouldn't be.

**Note**: This is intended as a temporary solution to have as minor a
change as possible for 1.11.1. A bigger change will be required in order
to support container re-attach.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-21 12:19:57 -04:00
Brian Goff
b006f7f640 Merge pull request #21683 from mYmNeo/growFS
call growFS when size is a mismatch
2016-04-21 12:02:44 -04:00
Vivek Goyal
55a9b8123d Export Mininum Thin Pool Free Space through docker info
Right now there is no way to know what's the minimum free space threshold
daemon is applying. It would be good to export it through docker info and
then user knows what's the current value. Also this could be useful to
higher level management tools which can look at this value and setup their
own internal thresholds for image garbage collection etc.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2016-04-21 15:42:23 +00:00
Yong Tang
9d8071a74d Docker http panics caused by container deletion with empty names.
This fix tries to fix the http panics caused by container deletion
with empty names in #22210.

The issue was because when an empty string was passed, `GetByName()`
tried to access the first element of the name string without checking
the length. A length check has been added.

A test case for #22210 has been added.

This fix fixes #22210.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-21 07:53:49 -07:00
Brian Goff
bb91bd3a89 Merge pull request #22043 from WeiZhang555/remove-start-event-failed-start
Remove start/die event when fail to start container
2016-04-19 19:45:40 -04:00
Alexander Morozov
eab65e438e Merge pull request #22153 from vdemeester/update-engine-api-again
Update engine api again for CopyToContainer and versions
2016-04-19 11:05:27 -07:00
Vincent Demeester
75cc2c926b Merge pull request #21495 from HackToday/addnetworkfilter
Add network label filter support
2016-04-19 19:15:14 +02:00
Vincent Demeester
7534f17261
Update code for latest engine-api
- Update CopyToContainer uses
- Use engine-api/types/versions instead of pkg/version

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-04-19 16:56:54 +02:00
Brian Goff
8adc8c3a68 Merge pull request #21901 from mavenugo/sid
Add container's short-id as default network alias
2016-04-19 08:16:41 -04:00
Brian Goff
42a7efd691 Merge pull request #22122 from Microsoft/jjh/defaultdir
Windows: Set default directory
2016-04-19 07:27:13 -04:00
Wen Cheng Ma
91b7157064 Deprecated of docker ps since and before options for v1.12
Deprecated note https://github.com/docker/docker/blob/master/docs/deprecated.md#docker-ps-before-and-since-options

Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2016-04-19 18:13:55 +08:00
David Calavera
7fd53f7c71 Merge pull request #21657 from vdemeester/update-engine-api
Update engine api with required arguments
2016-04-18 19:47:22 -07:00
Michael Crosby
eed9c930b8 Merge pull request #22120 from crosbymichael/stats-panic
Create a copy of stats value before modifications
2016-04-18 16:26:23 -07:00
John Howard
c2d183426b Windows: Set default directory
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-18 15:59:41 -07:00
Alexander Morozov
7f767d8ff5 Merge pull request #22069 from rhvgoyal/overlay-private
Make overlay home dir Private mount
2016-04-18 14:56:34 -07:00
Vivek Goyal
e076bccb45 Make overlay home dir Private mount
People have reported following issue with overlay

$ docker run -ti --name=foo -v /dev/:/dev fedora bash
$ docker cp foo:/bin/bash /tmp
$ exit container

Upon container exit, /dev/pts gets unmounted too. This happens because
docker cp volume mounts get propagated to /run/docker/libcontainer/....
and when container exits, it must be tearing down mount point under
/run/docker/libcontainerd/... and as these are "shared" mounts it
propagates events to /dev/pts and it gets unmounted too.

One way to solve this problem is to make sure "docker cp" volume mounts
don't become visible under /run/docker/libcontainerd/..

Here are more details of what is actually happening.

Make overlay home directory (/var/lib/docker/overlay) private mount when
docker starts and unmount it when docker stops. Following is the reason
to do it.

In fedora and some other distributions / is "shared". That means when
docker creates a container and mounts it root in /var/lib/docker/overlay/...
that mount point is "shared".

Looks like after that containerd/runc bind mounts that rootfs into
/runc/docker/libcontainerd/container-id/rootfs. And this puts both source
and destination mounts points in shared group and they both are setup
to propagate mount events to each other.

Later when "docker cp" is run it sets up container volumes under
/var/lib/dokcer/overlay/container-id/... And all these mounts propagate
to /runc/docker/libcontainerd/... Now mountVolumes() makes these new
mount points private but by that time propagation already has happened
and private only takes affect when unmount happens.

So to stop this propagation of volumes by docker cp, make
/var/lib/docker/overlay a private mount point. That means when a container
rootfs is created, that mount point will be private too (it will inherit
property from parent). And that means when bind mount happens in /runc/
dir, overlay mount point will not propagate mounts to /runc/.

Other graphdrivers like devicemapper are already doing it and they don't
face this issue.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2016-04-18 21:48:09 +00:00
Madhu Venugopal
ea531f061d Add container's short-id as default network alias
link feature in docker0 bridge by default provides short-id as a
container alias. With built-in SD feature, providing a container
short-id as a network alias will fill that gap.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-04-18 14:45:16 -07:00
Michael Crosby
d17ee4b506 Create a copy of stats value before modifications
Fixes #22030

Because the publisher uses this same value to all the
stats endpoints we need to make a copy of this as soon as we get it so
that we can make our modifications without it affecting others.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-18 11:41:38 -07:00
Kai Qiang Wu(Kennan)
f812b55692 Add network label filter support
This patch did following:

1) Make filter check logic same as `docker ps ` filters

Right now docker container logic work as following:
when same filter used like below:
 -f name=jack -f name=tom
it would get all containers name is jack or tom(it is or logic)

when different filter used like below:

 -f name=jack -f id=7d1
it would get all containers name is jack and id contains 7d1(it is and logic)

It would make sense in many user cases, but it did lack of compliate filter cases,
like "I want to get containers name is jack or id=7d1", it could work around use
(get id=7d1 containers' name and get name=jack containers, and then construct the
final containers, they could be done in user side use shell or rest API)

2) Fix one network filter bug which could include duplicate result
when use -f name=  -f id=, it would get duplicate results

3) Make id filter same as container id filter, which means match any string.
not use prefix match.

It is for consistent match logic

Closes: #21417

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-18 00:38:48 +00:00
Brian Goff
19a453e6b4 Merge pull request #21939 from calavera/events_until_past
Get events until a time in the past.
2016-04-15 15:33:41 -04:00
David Calavera
caf21c81ff Merge pull request #22066 from thaJeztah/fail-on-unsupported-kernels
Produce fatal error when running on kernel < 3.10.0
2016-04-15 11:41:31 -07:00
David Calavera
a196861517 Merge pull request #22009 from rhvgoyal/docker-cp-fix
Mount volumes rprivate for archival and other use cases
2016-04-15 10:11:33 -07:00
Vincent Demeester
e40e5b97c1 Merge pull request #21006 from cpuguy83/volume_inspect_meta
Allow volume drivers to provide a `Status` field
2016-04-15 18:53:39 +02:00
Brian Goff
36a1c56cf5 Allow volume drivers to provide a Status field
The `Status` field is a `map[string]interface{}` which allows the driver to pass
back low-level details about the underlying volume.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-15 10:56:38 -04:00
Vivek Goyal
cacd400777 Mount volumes rprivate for archival and other use cases
People have reported following problem.

- docker run -ti --name=foo -v /dev/:/dev/ fedora bash
- docker cp foo:/bin/bash /tmp

Once the cp operation is complete, it unmounted /dev/pts on the host. /dev/pts
is a submount of /dev/. This is completely unexpected. Following is the
reson for this behavior.

containerArchivePath() call mountVolumes() which goes through all the mounts
points of a container and mounts them in daemon mount namespace in
/var/lib/docker/devicemapper/mnt/<containerid>/rootfs dir. And once we have
extracted the data required, these are unmounted using UnmountVolumes().

Mounts are done using recursive bind (rbind). And these are unmounted using
lazy mount option on top level mount. (detachMounted()). That means if there
are submounts under top level mounts, these mount events will propagate and
they were "shared" mounts with host, it will unmount the submount on host
as well.

For example, try following.

- Prepare a parent and child mount point.
  $ mkdir /root/foo
  $ mount --bind /root/foo /root/foo 
  $ mount --make-rshared /root/foo
  
- Prepare a child mount 

  $ mkdir /root/foo/foo1
  $ mount --bind /root/foo/foo1 /root/foo/foo1
 
- Bind mount foo at bar

  $ mkdir /root/bar
  $ mount --rbind /root/foo /root/bar
  
- Now lazy unmount /root/bar and it will unmount /root/foo/foo1 as well.

  $ umount -l /root/bar

This is not unintended. We just wanted to unmount /root/bar and anything
underneath but did not have intentions of unmounting anything on source.

So far this was not a problem as docker daemon was running in a seprate
mount namespace where all propagation was "slave". That means any unmounts
in docker daemon namespace did not propagate to host namespace. 

But now we are running docker daemon in host namespace so that it is possible
to mount some volumes "shared" with container. So that if container mounts
something it propagates to host namespace as well. 

Given mountVolumes() seems to be doing only temporary mounts to read some
data, there does not seem to be a need to mount these shared/slave. Just
mount these private so that on unmount, nothing propagates and does not
have unintended consequences. 

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2016-04-15 14:03:11 +00:00
Sebastiaan van Stijn
51b23d8842
Produce fatal error when running on kernel < 3.10.0
Running on kernel versions older than 3.10 has not been
supported for a while (as it's known to be unstable).

With the containerd integration, this has become more
apparent, because kernels < 3.4 don't support PR_SET_CHILD_SUBREAPER,
which is required for containerd-shim to run.

Change the previous "warning" to a "fatal" error, so
that we refuse to start.

There's still an escape-hatch for users by setting
"DOCKER_NOWARN_KERNEL_VERSION=1" so that they can
run "at their own risk".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-04-15 14:33:56 +02:00
Vincent Demeester
b9c94b70bf
Update client code with api changes
Using new methods from engine-api, that make it clearer which element is
required when consuming the API.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-04-15 12:48:01 +02:00
Vincent Demeester
172ca1ca8c Merge pull request #20924 from Microsoft/10662-CPUResourceControls
Add CPU count and maximum resource controls for Windows
2016-04-15 08:14:59 +02:00
Zhang Wei
5548966c37 Remove start/die event when fail to start container
If contaner start fail of (say) "command not found", the container
actually didn't start at all, we shouldn't log start and die event for
it, because that doesnt actually happen.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-15 13:02:34 +08:00
Vincent Demeester
bc0c8828e9 Merge pull request #21172 from yongtang/20909-seccomp-in-docker-info
Show "seccomp" in docker info (#20909).
2016-04-15 01:24:54 +02:00
David Calavera
55053d3537
Get events until a time in the past.
This change allow to filter events that happened in the past
without waiting for future events. Example:

docker events --since -1h --until -30m

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-04-14 16:22:16 -07:00
Darren Stahl
ea8c690886 Add CPU count and maximum resource controls for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-04-14 15:40:25 -07:00
Alexander Morozov
7cd420d63a Merge pull request #21970 from cpuguy83/use_cached_path_on_ls
Fix N+1 calling `Path()` on `volume ls`
2016-04-13 22:47:53 -07:00
Tõnis Tiigi
73ac6d199c Move build endpoint handler from daemon (#21972)
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-13 10:21:00 -07:00
John Starks
6f8878872f Windows: Fix Hyper-V container ACLs for TP5 (#21974)
In TP5, Hyper-V containers need all image files ACLed so that the virtual
machine process can access them. This was fixed post-TP5 in Windows, but
for TP5 we need to explicitly add these ACLs.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-04-13 10:15:38 -07:00
Vincent Demeester
988508a2b5 Merge pull request #19265 from rhatdan/netsysctl
Add support for setting sysctls
2016-04-13 18:36:30 +02:00
Brian Goff
9e6b1852a7 Fix N+1 calling Path() on volume ls
Implements a `CachedPath` function on the volume plugin adapter that we
call from the volume list function instead of `Path.
If a driver does not implement `CachedPath` it will just call `Path`.

Also makes sure we store the path on Mount and remove the path on
Unmount.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-12 20:30:34 -04:00
David Calavera
7c16063afa Merge pull request #21714 from hallyn/2016-03-31/aufs.2
don't try to use aufs in a user namespace
2016-04-12 14:07:51 -07:00
Dan Walsh
9caf7aeefd Add support for setting sysctls
This patch will allow users to specify namespace specific "kernel parameters"
for running inside of a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-04-12 13:37:31 -04:00
Alexander Morozov
d648d40ace Merge pull request #21904 from yongtang/21848-stats-connected-containers
Docker stats is not working when a container is using another container's network.
2016-04-12 10:28:05 -07:00
Alexander Morozov
7b5a6844c2 Merge pull request #21943 from Microsoft/jstarks/utilityvm
Windows: support embedded utility VM images
2016-04-12 10:19:47 -07:00
Rodolfo Carvalho
fee7e7c7a3 Fix a typo in hostConfig.ShmSize validation
Other places referring to the same configuration, including docs, have
the correct spelling.

Signed-off-by: Rodolfo Carvalho <rhcarvalho@gmail.com>
2016-04-12 16:45:05 +02:00
mYmNeo
34a66a14af Grow the container rootfs when it is necessary
Signed-off-by: mYmNeo <thomassong@tencent.com>
2016-04-12 09:27:47 +08:00
John Starks
c70f153f52 Windows: Support embedded utility VM images
For TP5, the utility VM for Hyper-V containers is embedded in the base
layer's contents.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-04-11 17:16:17 -07:00
boynux
f6dd023b4e exited=0 in filter shouldn't show "Created" ones
Newly created containers which are not started yet should not list
when "exited=0" filter is used with "ps -a"

Signed-off-by: Boynux <boynux@gmail.com>
2016-04-11 23:44:05 +02:00
Serge Hallyn
2a71f28a4e don't try to use aufs in a user namespace
If aufs is already modprobe'd but we are in a user namespace, the
aufs driver will happily load but then get eperm when it actually tries
to do something.  So detect that condition.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-04-11 13:38:15 -05:00
Shishir Mahajan
45dc5b46e2 parseStorageOpt: return size rather than updating devInfo.Size field
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-04-11 10:34:13 -04:00
Vincent Demeester
a692910277 Merge pull request #20853 from WeiZhang555/fix-ShouldRestart
Fix ShouldRestart for on-failure handle
2016-04-11 14:01:52 +02:00
Vincent Demeester
f9386538ec Merge pull request #21724 from flyinprogrammer/syslog-opts-env-labels
enable syslog logger to have access to env and labels
2016-04-10 10:58:25 +02:00
Zhang Wei
51e42e6ee0 Fix ShouldRestart for on-failure handle
Currently if you restart docker daemon, all the containers with restart
policy `on-failure` regardless of its `RestartCount` will be started,
this will make daemon cost more extra time for restart.

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

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-10 15:44:47 +08:00
Lei Jitang
b4664e3f86 Merge pull request #21854 from WeiZhang555/restart-failure
Fix critical bug: can't restart an restarting container
2016-04-10 11:17:19 +08:00
Yong Tang
faf2b6f7aa Docker stats is not working when a container is using another container's network.
This fix tries to fix the issue in #21848 where `docker stats` will not correctly
display the container stats in case the container reuse another container's
network stack.

The issue is that when `stats` is performed, the daemon will check for container
network setting's `SandboxID`. Unfortunately, for containers that reuse another
container's network stack (`NetworkMode.IsConnected()`), SandboxID is not assigned.
Therefore, the daemon thinks the id is invalid and remote API will never return.

This fix tries to resolve the SandboxID by iterating through connected containers
and identify the appropriate SandboxID.

A test case for `stats` remote API has been added to check if `stats` will return
within the timeout.

This fix fixes #21848.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-09 20:15:51 +00:00
Vincent Demeester
a01f4dc229 Merge pull request #21853 from coolljt0725/fix_stats
Fix docker stats missing mem limit
2016-04-09 13:46:58 +02:00
John Howard
fec6cd2eb9 Merge pull request #20525 from Microsoft/sjw/update-graphdriver-create
Adding readOnly parameter to graphdriver Create method
2016-04-08 20:44:03 -07:00
Sebastiaan van Stijn
eaa1e8a8c4 Merge pull request #21839 from WeiZhang555/add-start-event
Add missing "start" event back for auto-restart container
2016-04-08 17:52:22 -07:00
Alan Scherger
f67b711277 enable syslog logger to have access to env and labels
Signed-off-by: Alan Scherger <flyinprogrammer@gmail.com>
2016-04-08 19:50:18 -05:00
David Calavera
f62b26571a Merge pull request #21894 from Microsoft/sjw/nanoserver-fix
Fixing warning to correctly output error string.
2016-04-08 16:43:07 -07:00
Stefan J. Wernli
3c220cfcba Fixing warning to correctly output error string.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-08 15:04:04 -07:00
David Calavera
e626011bfb Merge pull request #21760 from hqhq/hq_minimum_reservation
Add minimum limit for memory reservation
2016-04-08 07:58:28 -07:00
Zhang Wei
a705e166cf Fix critical bug: can't restart a restarting container
When user try to restart a restarting container, docker client report
error: "container is already active", and container will be stopped
instead be restarted which is seriously wrong.

What's more critical is that when user try to start this container
again, it will always fail.

This error can also be reproduced with a `docker stop`+`docker start`.

And this commit will fix the bug.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-08 22:02:30 +08:00
Brian Goff
7f865e4953 Merge pull request #21777 from Microsoft/jjh/killTP4
Windows: So long TP4, so long...
2016-04-08 09:33:23 -04:00
Yong Tang
ee4bd806ba API/CLI discrepancy on hostname validation (#21595).
This fix tries to fix the discrepancy between API and CLI on hostname
validation. Previously, the hostname validation was handled at the
CLI interface in runconfig/opts/parse.go and return an error if the
hostname is invalid. However, if an end user use the remote API to
pass the hostname, the error will not be returned immediately.
Instead the error will only be thrown out when the container creation
fails. This creates behavior discrepancy between API and CLI.

In this fix, the hostname validation was moved to
verifyContainerSettings so the behavior will be the same for API and
CLI.

After the change, since CLI does not handle the hostname validation
any more, the previous unit tests about hostname validation on CLI
in runconfig/opts/parse_test.go has to be updated as well because
there is no validation at this stage. All those unit tests are moved
to integration test TestRunTooLongHostname so that the hostname
validation is still properly covered as before.

Note: Since the hostname validation moved to API, the error message
changes from `invalid hostname format for --hostname:` to
`invalid hostname format:` as well because `--hostname` is passed
to CLI only.

This fix fixes #21595.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-08 06:13:08 +00:00
Yong Tang
7581cf96fb Additional syslog-format option to allow microsecond resolution in syslog timestamp.
This fix tries to add an additional syslog-format of `rfc5424micro` which follows
the same as rfc5424 except that it use microsecond resolution for timestamp. The
purpose is to solve the issue raised in #21793 where log events might lose its
ordering if happens on the same second.

The timestamp field in rfc5424 is derived from rfc3339, though the maximium
resolution is limited to "TIME-SECFRAC" which is 6 (microsecond resolution).

The appropriate documentation (`docs/admin/logging/overview.md`) has been updated
to reflect the change in this fix.

This fix adds a unit test to cover the newly introduced format.

This fix fixes #21793.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-08 05:00:11 +00:00
John Howard
d5ef62f489 Merge pull request #21872 from Microsoft/sjw/nanoserver-fix
Fixing nanoserver image load bug.
2016-04-07 21:24:32 -07:00
Zhang Wei
fdfaaeb9aa Add missing "start" event back for auto-restart container
When container is automatically restarted based on restart policy,
docker events can't get "start" event but only get "die" event, this is
not consistent with previous behavior. This commit will add "start"
event back.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-08 11:40:32 +08:00
John Howard
fdd5b5de62 Merge pull request #21774 from Microsoft/jstarks/support_non_base_layered_images
Windows: support non-base-layered images
2016-04-07 20:13:38 -07:00
Lei Jitang
a0a6d031d7 Fix docker stats missing memory limit
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-04-07 22:09:07 -04:00
Brian Goff
681b5e0ed4 Merge pull request #21867 from calavera/remove_reference_from_api
Remove reference package dependency from the api.
2016-04-07 21:56:43 -04:00
John Starks
cf7944bf6f Windows: Support ApplyDiff on a base layer
This adds support to the Windows graph driver for ApplyDiff on a base
layer. It also adds support for hard links, which are needed because the
Windows base layers double in size without hard link support.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-04-07 17:52:28 -07:00
John Starks
d45a26d7e2 Windows: Support non-base-layered images
Previously, Windows only supported running with a OS-managed base image.
With this change, Windows supports normal, Linux-like layered images, too.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-04-07 17:52:26 -07:00
Sebastiaan van Stijn
fc352287c1 Merge pull request #21816 from estesp/case-of-the-missing-else
Don't perform external setkey when net==host
2016-04-07 17:01:30 -07:00
Stefan J. Wernli
a22092b136 Fixing nanoserver image load bug.
Fixes an issue that prevents nano server images from loading properly. Also updates logic for custom image loading to avoid preventing daemon start because an image failed to load.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-07 16:44:51 -07:00
David Calavera
47afe6bd0a Remove reference package dependency from the api.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-04-07 15:01:23 -07:00
Vincent Demeester
2e236d0255 Merge pull request #21828 from dmcgowan/fix-overlay-on-overlay-test
Fix overlay test running on overlay
2016-04-07 10:07:25 +02:00
Vincent Demeester
8785952282 Merge pull request #21830 from anusha-ragunathan/auplink
Be more lenient on auplink errors.
2016-04-07 09:19:38 +02:00
Derek McGowan
824c72f472 Fix overlay test running on overlay
Overlay tests were failing when /var/tmp was an overlay mount with a misleading message.
Now overlay tests will be skipped when attempting to be run on overlay.
Tests will now use the TMPDIR environment variable instead of only /var/tmp

Fixes #21686

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-04-06 21:06:42 -07:00
Anusha Ragunathan
dbd9b7e121 Be more lenient on auplink errors.
On aufs, auplink is run before the Unmount. Irrespective of the
result, we proceed to issue a Unmount syscall. In which case,
demote erros on auplink to warning.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-04-06 18:24:19 -07:00
John Howard
9d7f6bb921 Merge pull request #21733 from Microsoft/sjw/updatepending
Adding postRunProcessing infrastructure for hanlding Windows Update.
2016-04-06 15:36:39 -07:00
Alexander Morozov
65464d11f1 Merge pull request #21809 from Microsoft/jjh/tp4removal
Windows: Remove TP4 support from main codebase
2016-04-06 14:11:33 -07:00
Stefan J. Wernli
818a5198e4 Adding postRunProcessing infrastructure for hanlding Windows Update.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-06 14:03:05 -07:00
Stefan J. Wernli
ef5bfad321 Adding readOnly parameter to graphdriver Create method
Since the layer store was introduced, the level above the graphdriver
now differentiates between read/write and read-only layers.  This
distinction is useful for graphdrivers that need to take special steps
when creating a layer based on whether it is read-only or not.
Adding this parameter allows the graphdrivers to differentiate, which
in the case of the Windows graphdriver, removes our dependence on parsing
the id of the parent for "-init" in order to infer this information.

This will also set the stage for unblocking some of the layer store
unit tests in the next preview build of Windows.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-06 13:52:53 -07:00
Phil Estes
1771d35b48 Don't perform external setkey when net==host
This else case was lost in the migration from native execdriver to OCI
implementation via runc. There is no need to have external setkey when
--net=host.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-04-06 16:45:43 -04:00
Phil Estes
40dc921da2 Merge pull request #21805 from LK4D4/unused_stuff
all: remove some unused funcs and variables
2016-04-06 16:27:14 -04:00
Vincent Demeester
5709f8e422 Merge pull request #21092 from WeiZhang555/fix-21064-detach-keys
Client print error when specify wrong detach keys
2016-04-06 22:14:14 +02:00
Tibor Vass
8c361eb5da Merge pull request #21723 from devimc/master
Fix compilation errors with btrfs-progs-4.5
2016-04-06 15:56:42 -04:00
Tibor Vass
6bd429cb2a Merge pull request #21802 from tiborvass/carry-21716
Carry 21716: When container had no layer data, cleanupContainer crashed
2016-04-06 15:21:38 -04:00
John Howard
331c8a86d4 Windows: Remove TP4 support from main code
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-06 12:12:20 -07:00
Brian Goff
40ccb7114e Merge pull request #21768 from shishir-a412ed/fix_docker_run
Ignore os.IsNotExist errors when calling ToDiskLocking
2016-04-06 14:12:38 -04:00
Alexander Morozov
5ee8652a21 all: remove some unused funcs and variables
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-04-06 10:40:01 -07:00
mYmNeo
0bfc9c8de0 when container had no layer data, cleanupContainer crashed
Signed-off-by: mYmNeo <thomassong@tencent.com>
2016-04-06 12:40:20 -04:00
Tibor Vass
c7cf245053 Merge pull request #21751 from tonistiigi/runc-maskedpaths
Define readonly/mask paths in spec
2016-04-06 12:16:28 -04:00
Shishir Mahajan
606cf5310d Ignore os.IsNotExist errors when calling ToDiskLocking
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-04-06 11:17:56 -04:00
Qiang Huang
50a6181005 Add minimum limit for memory reservation
Kernel has no limit for memory reservation, but in different
kernel versions, the default behavior is different.

On kernel 3.13,
docker run --rm --memory-reservation 1k busybox cat /sys/fs/cgroup/memory/memory.soft_limit_in_bytes
the output would be 4096, but on kernel 4.1, the output is 0.

Since we have minimum limit for memory and kernel memory, we
can have this limit for memory reservation as well, to make
the behavior consistent.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-04-06 09:37:51 +08:00
John Howard
5175c9a5ea Windows: So long TP4, so long...
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-05 16:39:27 -07:00
John Howard
fc9912fd00 Merge pull request #21272 from Microsoft/jstarks/manifest_updates
Add os_version and os_features to Image
2016-04-05 16:16:25 -07:00
Tonis Tiigi
3f81b49352 Define readonly/mask paths in spec
This vendors in new spec/runc that supports
setting readonly and masked paths in the 
configuration. Using this allows us to make an
exception for `—-privileged`.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-04 18:55:55 -07:00
John Starks
194eaa5c0f Add os_version and os_features to Image
These fields are needed to specify the exact version of Windows that an
image can run on. They may be useful for other platforms in the future.

This also changes image.store.Create to validate that the loaded image is
supported on the current machine. This change affects Linux as well, since
it now validates the architecture and OS fields.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-04-04 13:14:57 -07:00
Zhang Wei
91e5bb9541 Let client print error when speicify wrong detach keys
Fix #21064

Let client print error message explicitly when user specifies wrong
detach keys.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-04 15:35:55 +08:00
Sebastiaan van Stijn
b8f38747e6 Improve udev unsupported error message
Show a different message if a dynamic binary
is running, but doesn't have udev sync support.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-04-01 13:31:44 -07:00
Julio Montes
a038cccf88 Fix compilation errors with btrfs-progs-4.5
btrfs-progs-4.5 introduces device delete by devid
for this reason btrfs_ioctl_vol_args_v2's name was encapsulated
in a union

this patch is for setting btrfs_ioctl_vol_args_v2's name
using a C function in order to preserve compatibility
with all btrfs-progs versions

Signed-off-by: Julio Montes <imc.coder@gmail.com>
2016-04-01 08:58:29 -06:00
Sebastiaan van Stijn
42494720c2 Merge pull request #21687 from allencloud/fix-typos
fix typos
2016-03-31 14:18:31 -07:00
Alexander Morozov
b9966f3a81 daemon: remove some unused code
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-03-31 11:24:12 -07:00
Vincent Demeester
e6f2429e01 Merge pull request #21607 from allencloud/change-validateNoSchema-to-validateNoScheme
change validateNoSchema to validateNoScheme
2016-03-31 10:14:23 +02:00
Sebastiaan van Stijn
c7b63338f0 Merge pull request #21637 from tonistiigi/refactor-cleanup
Fix container mount cleanup issues
2016-03-30 23:25:23 -07:00
Sebastiaan van Stijn
ffee5588cd Merge pull request #21372 from anusha-ragunathan/ctrd-rebase
Update mount state of live containers after a daemon crash.
2016-03-30 23:10:04 -07:00
allencloud
5c161ade98 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-03-31 13:26:46 +08:00
allencloud
28d3c22e55 1.change validateNoSchema into validateNoScheme
2.change schema into scheme in docs and some annotations.

Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-03-31 12:29:15 +08:00
Brian Goff
81d9eaa27e Merge pull request #21600 from Microsoft/jstarks/escape_entrypoint
Windows: escape entrypoint before passing to libcontainerd
2016-03-30 18:00:32 -07:00
Tonis Tiigi
05cc737f54 Fix container mount cleanup issues
- Refactor generic and path based cleanup functions into a single function.
- Include aufs and zfs mounts in the mounts cleanup.
- Containers that receive exit event on restore don't require manual cleanup.
- Make missing sandbox id message a warning because currently sandboxes are always cleared on startup. libnetwork#975
- Don't unmount volumes for containers that don't have base path. Shouldn't be needed after #21372

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-30 17:25:49 -07:00
David Calavera
0dac544448 Merge pull request #21309 from nalind/journal-error-reporting
Improve error reporting when following journals
2016-03-30 16:15:34 -07:00
David Calavera
a7742e4379 Merge pull request #21636 from calavera/remove_builder_from_api
Remove builder dependency from the api.
2016-03-30 15:20:05 -07:00
John Starks
6fa0239772 Windows: escape entrypoint before passing to libcontainerd
This makes Windows behavior consistent with Linux -- the entry point must
be an executable, not an executable and set of arguments.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-03-30 12:59:50 -07:00