Commit graph

3647 commits

Author SHA1 Message Date
Nalin Dahyabhai
7772d270c0 Remove the logger.Message ContainerID field
Log drivers are instantiated on a per-container basis, and passed the
container ID (along with other information) when they're initialized.
Drivers that care about that value are caching the value that they're
passed when they're initialized and using it in favor of the value
contained in Message structures that are passed to them, so the field in
Messages is unused, so we remove it.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2016-05-31 16:41:29 -04:00
Antonio Murdaca
b18062122d graphtest: fix cleanup logic
device Base should not exists on failure:

--- FAIL: TestDevmapperCreateBase (0.06s)
    graphtest_unix.go:122: stat
/tmp/docker-graphtest-079240530/devicemapper/mnt/Base/rootfs/a subdir:
no such file or directory
--- FAIL: TestDevmapperCreateSnap (0.00s)
    graphtest_unix.go:219: devmapper: device Base already
exists.

it should be:

--- FAIL: TestDevmapperCreateBase (0.25s)
	graphtest_unix.go:122: stat
/tmp/docker-graphtest-828994195/devicemapper/mnt/Base/rootfs/a subdir:
no such file or directory
--- FAIL: TestDevmapperCreateSnap (0.13s)
	graphtest_unix.go:122: stat
/tmp/docker-graphtest-828994195/devicemapper/mnt/Snap/rootfs/a subdir:
no such file or directory

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-31 20:08:57 +02:00
Justin Cormack
6bd797b43f Error out if user tries to specify a custom seccomp profile on system that does not support it
Fixes #23031

If a profile is explicitly passed but the system is not built with seccomp support,
error out rather than just running without a profile at all as we would previously.
Behaviour is unchanged if no profile is specified or unconfined is specified.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-31 17:52:40 +01:00
Phil Estes
8e4a451448 Optimize docker ps when name/id filters in use
When a partial ID or name is used in `docker ps` filters, today the
entire list of containers is walked even though there are shorter paths
to acquiring the subset of containers that match the ID or name. Also,
container's locks are used during this walk, causing increased lock
contention on a busy daemon.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-05-30 17:43:55 -04:00
Vincent Demeester
edcc9577bf Merge pull request #22103 from coolljt0725/fix_22093
Fix docker create with duplicate volume failed to remove
2016-05-30 15:57:13 +02:00
Sebastiaan van Stijn
f3a7abee81 Merge pull request #22384 from yongtang/22358-log-tag-prefix
Remove `docker/` prefix from log messages tag.
2016-05-30 14:48:31 +02:00
Alexander Morozov
c050102536 Merge pull request #23019 from vdemeester/more-daemon-horn-moving
Moving some more methods away from daemon.go
2016-05-28 22:07:31 -07:00
Yong Tang
46ea8ff75d Fix build errors caused by update aws-sdk-go to v1.1.30
This fix tries to fix build errors caused by updating
aws-sdk-go to v1.1.30.

This fix fixes #22961.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-28 18:49:17 -07:00
John Starks
f182748b9b Windows: fix Windows graph driver name
Reverting "Windows filter storage driver" to "windowsfilter".

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-05-27 16:24:02 -07:00
Michael Crosby
b1f8b45b8f Merge pull request #23067 from shishir-a412ed/fix_commit_issue
Fixes Issue # 22992: docker commit failing
2016-05-27 15:06:29 -07:00
Sebastiaan van Stijn
4441a6c4c6 Merge pull request #22716 from jmzwcn/issue22466-patches
Embedded DNS problem after renaming container. Step2:change in docker…
2016-05-27 23:27:42 +02:00
Brian Goff
ec3ccde18b Merge pull request #22438 from yongtang/22420-inconsistent-tmpfs-behavior
Inconsistent --tmpfs behavior
2016-05-27 15:54:37 -04:00
Shishir Mahajan
09d0720e2f Fixes Issue # 22992: docker commit failing.
1) docker create / run / start: this would create a snapshot device and mounts it onto the filesystem.
So the first time GET operation is called. it will create the rootfs directory and return the path to rootfs
2) Now when I do docker commit. It will call the GET operation second time. This time the refcount will check
that the count > 1 (count=2). so the rootfs already exists, it will just return the path to rootfs.

Earlier it was just returning the mp: /var/lib/docker/devicemapper/mnt/{ID} and hence the inconsistent paths error.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-05-27 14:35:46 -04:00
Brian Goff
1d87f788b1 Merge pull request #23030 from Microsoft/jjh/xenonworkdir
Windows: Default isolation and workdir
2016-05-27 11:31:36 -04:00
Vincent Demeester
bfa0885c37
Moving some more methods away from daemon.go
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-27 11:32:26 +02:00
Vincent Demeester
cd012efa2e
Validate filter values before calling registry.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-27 11:13:12 +02:00
Brian Goff
3f6fa8af45 Merge pull request #22993 from rhatdan/relabel
Multiple fixes for SELinux labels.
2016-05-26 22:51:17 -04:00
Yong Tang
397a6fefad Inconsistent --tmpfs behavior
This fix tries to address the issue raised in #22420. When
`--tmpfs` is specified with `/tmp`, the default value is
`rw,nosuid,nodev,noexec,relatime,size=65536k`. When `--tmpfs`
is specified with `/tmp:rw`, then the value changed to
`rw,nosuid,nodev,noexec,relatime`.

The reason for such an inconsistency is because docker tries
to add `size=65536k` option only when user provides no option.

This fix tries to address this issue by always pre-progating
`size=65536k` along with `rw,nosuid,nodev,noexec,relatime`.
If user provides a different value (e.g., `size=8192k`), it
will override the `size=65536k` anyway since the combined
options will be parsed and merged to remove any duplicates.

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

This fix fixes #22420.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-26 19:28:18 -07:00
John Howard
6952135fc8 Windows: Default isolation and workdir
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-26 13:24:22 -07:00
Vincent Demeester
72fefc0441
Invert CgroupDevicesEnabled condition
It feels better to test where it's required than listing everywhere it
is not required.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-26 13:09:11 +02:00
Sebastiaan van Stijn
75109b32db Merge pull request #22861 from vdemeester/daemon-images-search-refactoring
Daemon images search refactoring
2016-05-26 12:34:31 +02:00
Vincent Demeester
ecdf75dca6 Merge pull request #22997 from aboch/ports
Update port info on network connect/disconnect
2016-05-26 12:18:00 +02:00
Daniel Zhang
be072a8954 Embedded DNS problem after renaming container. Step2:change in docker/daemon side and add integration test
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2016-05-26 12:59:44 +08:00
Alexander Morozov
089166ebe2 Merge pull request #23000 from jstarks/use_image_version_for_console_check
Windows: Use image version, not OS version for TTY fixup
2016-05-25 17:40:56 -07:00
Alessandro Boch
f198dfd856 Update port info on network connect/disconnect
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-25 17:02:50 -07:00
Alexander Morozov
d9db8960fd Merge pull request #22949 from vdemeester/move-daemon-container-horn
Move some container related methods and structs to smaller files
2016-05-25 13:42:07 -07:00
Dan Walsh
c3dd6074b0 Multiple fixes for SELinux labels.
SELinux labeling should be disabled when using --privileged mode

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

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

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-05-25 16:11:02 -04:00
Michael Crosby
dca92044be Merge pull request #22985 from samuelkarp/awslogs-logging-driver
awslogs: Fix a race in mockcwlogsclient
2016-05-25 13:08:00 -07:00
John Starks
6508c015fe Windows: Use image version, not OS version for TTY fixup
A previous change added a TTY fixup for stdin on older Windows versions to
work around a Windows issue with backspace/delete behavior. This change
used the OS version to determine whether to activate the behavior.
However, the Windows bug is actually in the image, not the OS, so it
should have used the image's OS version.

This ensures that a Server TP5 container running on Windows 10 will have
reasonable console behavior.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-05-25 12:22:52 -07:00
Samuel Karp
c1ad02ccc8 awslogs: Fix a race in mockcwlogsclient
Signed-off-by: Samuel Karp <skarp@amazon.com>
2016-05-25 11:50:22 -07:00
Sebastiaan van Stijn
0fe4417a3b Merge pull request #22908 from vdemeester/7967-since-before-image-filters
Add before and since filter to images
2016-05-25 20:15:23 +02:00
Brian Goff
a41e823c1b Merge pull request #22969 from AkihiroSuda/fix22963LogRace
Fix a race in daemon/logger.TestCopier
2016-05-25 11:09:51 -04:00
Vincent Demeester
750e16f57c
Add before and since filter to images
Add support for two now filter on the `images` command : `before` and
`since`. They work the same as the one on the `ps` command but for
images.

        $ docker images --filter before=myimage
        # display all images older than myimage
        $ docker images --filter since=myimage
        # display all images younger than myimage

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-25 13:49:10 +02:00
Vincent Demeester
2a4b4a8133 Merge pull request #22962 from normalfaults/b
fixed spelling error in windows.go
2016-05-25 12:21:08 +02:00
Akihiro Suda
ab533f0651 Fix a race in daemon/logger.TestCopier
Update #22963

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-05-25 05:07:24 +00:00
Yong Tang
90bd41a74d The option --add-host and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--add-host` and `--net=host` to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-24 18:49:11 -07:00
Nirmal Mehta
59bb86a964 Merge branch 'master' into b 2016-05-24 21:43:45 -04:00
Nirmal Mehta
36a9151b27 fixed spelling error in windows.go
Signed-off-by: Nirmal Mehta <nirmalkmehta@gmail.com>
2016-05-24 21:40:08 -04:00
Yong Tang
23821fe586 The option --dns, --dns-search, --dns-opt and --net=host should not be mutually exclusive.
This fix tries to address the issue raised in #21976 and allows
the options of `--dns`, `--dns-search`, `--dns-opt` and `--net=host`
to work at the same time.

The documentation has been updated and additional tests have been
added to cover this change.

This fix fixes #21976.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-24 16:03:26 -07:00
Michael Crosby
0802401d22 Merge pull request #22948 from dmcgowan/remove-unused-overlay-mounted
Remove unused mounted function in overlay
2016-05-24 13:08:06 -07:00
Vincent Demeester
86a7632d63 Merge pull request #22091 from amitkris/build_solaris
Get the Docker Engine to build clean on Solaris
2016-05-24 21:41:36 +02:00
Vincent Demeester
fb48bf518b
Move some container related methods and structs to smaller files
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-24 21:31:15 +02:00
Derek McGowan
5cc0824730 Remove unused mounted function in overlay
The mount check is now done by the FSChecker. This function is no longer needed and shouldn't be called.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-05-24 11:02:07 -07:00
Alexander Morozov
38217d4353 Merge pull request #22932 from chenchun/fix_build
Fix building image  error if bridge network is disabled
2016-05-24 10:33:34 -07:00
Vincent Demeester
f0d6fd93a2 Merge pull request #22756 from wangxing1517/fix_docs_dockerd.md
Fix incorrectly named "ip-mask" and "api-cors-headers" options
2016-05-24 18:21:52 +02:00
Vincent Demeester
636c276f67
Add Unit test to daemon.SearchRegistryForImages…
… and refactor a little bit some daemon on the way.

- Move `SearchRegistryForImages` to a new file (`daemon/search.go`) as
  `daemon.go` is getting pretty big.
- `registry.Service` is now an interface (allowing us to decouple it a
  little bit and thus unit test easily).
- Add some unit test for `SearchRegistryForImages`.
- Use UniqueExactMatch for search filters
- And use empty restore id for now in client.ContainerStart.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-24 11:07:11 +02:00
Vincent Demeester
d76d38c7d0 Merge pull request #22590 from yongtang/22463-docker-daemon-events
Emit events for docker daemon
2016-05-24 11:05:39 +02:00
Chun Chen
a8d013495c Fix building image error if bridge network is disabled
Signed-off-by: Chun Chen <ramichen@tencent.com>
2016-05-24 16:20:26 +08:00
Alexander Morozov
d7dfe9103b Merge pull request #22541 from crosbymichael/graph-restore
Implement graph driver restore on reboot
2016-05-23 22:57:23 -07:00
Yong Tang
62014aaf9a Add filter for events emitted by docker daemon
This fix tries to cover the issue raised in #22463 by adding
filter for events emitted by docker daemon so that user could
utilize filter to receive events of interest.

Documentations have been updated for this fix.

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
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