Commit graph

4015 commits

Author SHA1 Message Date
Daniel Nephin
c452e1bfe6 Move errors/ to api/errors
Using:
        gomvpkg -from github.com/docker/docker/errors
                -to github.com/docker/docker/api/errors
                -vcs_mv_cmd "git mv {{.Src}} {{.Dst}}"

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-16 12:27:13 -04:00
John Howard
cc4e17cbba Windows: Turn off builds<14393
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-15 15:20:16 -07:00
Tõnis Tiigi
4c82365cdb Merge pull request #26596 from drakenator/26384-healthcheck-race
Prevent stdout / stderr race condition in limitedBuffer.
2016-09-15 10:59:45 -07:00
Stephen Drake
c3319445aa Prevent stdout / stderr race condition in limitedBuffer.
Signed-off-by: Stephen Drake <stephen@xenolith.net>
2016-09-15 13:31:11 +02:00
allencloud
9279a93f6d correct some nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-15 12:17:58 +08:00
Sebastiaan van Stijn
8ac2000f50 Merge pull request #25540 from estesp/ro-plus-userns
Remove --read-only restriction when user ns enabled
2016-09-14 13:53:58 +02:00
Jana Radhakrishnan
3ae023cd22 Merge pull request #26551 from cpuguy83/26548_fix_tasks
Do not look at `Attachment` tasks in /tasks
2016-09-13 21:27:15 -07:00
Madhu Venugopal
1d76ab4f80 Merge pull request #26449 from mrjana/net
Fix autostart for swarm scope connected containers
2016-09-13 18:22:16 -07:00
Brian Goff
15eee038c0 Do not look at Attachment tasks in /tasks
Fixes #26548

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-13 20:44:06 -04:00
Jana Radhakrishnan
c9fb551d60 Fix autostart for swarm scope connected containers
The swarm scope network connected containers with autostart enabled
there was a dependency problem with the cluster to be initialized before
we can autostart them. With the current container restart code happening
before cluster init, these containers were not getting autostarted
properly. Added a fix to delay the container start of those containers
which has atleast one swarm scope endpoint to until after the cluster is
initialized.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-13 14:21:58 -07:00
Brian Goff
29b1c1da73 Migrate old mount format to use mount specs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-13 09:55:35 -04:00
Brian Goff
fc7b904dce Add new HostConfig field, Mounts.
`Mounts` allows users to specify in a much safer way the volumes they
want to use in the container.
This replaces `Binds` and `Volumes`, which both still exist, but
`Mounts` and `Binds`/`Volumes` are exclussive.
The CLI will continue to use `Binds` and `Volumes` due to concerns with
parsing the volume specs on the client side and cross-platform support
(for now).

The new API follows exactly the services mount API.

Example usage of `Mounts`:

```
$ curl -XPOST localhost:2375/containers/create -d '{
  "Image": "alpine:latest",
  "HostConfig": {
    "Mounts": [{
      "Type": "Volume",
      "Target": "/foo"
      },{
      "Type": "bind",
      "Source": "/var/run/docker.sock",
      "Target": "/var/run/docker.sock",
      },{
      "Type": "volume",
      "Name": "important_data",
      "Target": "/var/data",
      "ReadOnly": true,
      "VolumeOptions": {
	"DriverConfig": {
	  Name: "awesomeStorage",
	  Options: {"size": "10m"},
	  Labels: {"some":"label"}
	}
      }]
    }
}'
```

There are currently 2 types of mounts:

  - **bind**: Paths on the host that get mounted into the
    container. Paths must exist prior to creating the container.
  - **volume**: Volumes that persist after the
    container is removed.

Not all fields are available in each type, and validation is done to
ensure these fields aren't mixed up between types.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-13 09:55:35 -04:00
Vincent Demeester
eb0728a993 Merge pull request #26439 from lixiaobing10051267/masterReload
fix logruns.Warnf while daemon.networkOptions fails
2016-09-13 11:03:52 +02:00
lixiaobing10051267
56916b5e8d fix logruns.Warnf while daemon.networkOptions fails
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-09-13 09:17:39 +08:00
Alexander Morozov
036a8f77b0 Merge pull request #26461 from crosbymichael/term-exec
Add TERM env var to exec
2016-09-12 14:57:37 -07:00
Michael Crosby
4633f15f13 Add TERM env var to exec
When the `-t` flag is passed on exec make sure to add the TERM env var
to mirror the expected configuration from run.

Fixes #9299

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-12 09:20:27 -07:00
Vincent Demeester
ab2c9b373d Merge pull request #26483 from miaoyq/optimized-debug-print-in-devicemapper
Optimized debug print in the 'deviceset.go'
2016-09-12 15:08:12 +02:00
Akihiro Suda
e03cc68e3a test: fix trivial code convention noncompliance
daemon/events/testutils: rename eventstestutils to testutils
volume/testutils: rename volumetestutils to testutils

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-12 07:36:52 +00:00
Yanqiang Miao
664ad19486 Optimized debug print in the 'deviceset.go'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-12 15:34:17 +08:00
Brian Goff
ebae43efc2 Merge pull request #26457 from aboch/auto
Add fallback to resolveSystemAddr() in linux
2016-09-09 20:46:29 -04:00
Alessandro Boch
c0b24c600e Add fallback to resolveSystemAddr() in linux
- So that swarm init will still work w/o specifying the advertise
  address when the daemon is running inside a container

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-09 13:27:57 -07:00
Phil Estes
cf58eb437c Merge pull request #22049 from boucher/docker-checkpoint-restore
Implement containerd API for checkpoints
2016-09-09 13:36:55 -04:00
Phil Estes
6062ae5742
Remove --read-only restriction when user ns enabled
The restriction is no longer necessary given changes at the runc layer
related to mount options of the rootfs. Also cleaned up the docs on
restrictions left for userns enabled mode. Re-enabled tests related to
--read-only when testing a userns-enabled daemon in integration-cli.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2016-09-09 13:23:41 -04:00
lixiaobing10051267
b4b9efd4c5 Specify the required version while the version not support daemon
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-09-09 23:04:45 +08:00
boucher
d8fef66b03 Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
2016-09-08 21:31:52 -04:00
Brian Goff
ba07661f0d Merge pull request #26405 from yongtang/26326-inspect-ulimit-with-daemon-default
Fix Ulimits in `docker inspect` when daemon default exists
2016-09-08 13:21:26 -04:00
Madhu Venugopal
719a640743 Merge pull request #25962 from mrjana/net
Add support for docker run in swarm mode overlay
2016-09-08 09:39:00 -07:00
Brian Goff
b1dfefc4bb Merge pull request #26205 from allencloud/fix-warnings-append
add warnings when verifying container settings
2016-09-08 12:10:37 -04:00
Yong Tang
7d705a7355 Fix ulimits in docker inspect when daemon default exists
This fix tries to fix 26326 where `docker inspect` will not show
ulimit even when daemon default ulimit has been set.

This fix merge the HostConfig's ulimit with daemon default in
`docker inspect`, so that when daemon is started with `default-ulimit`
and HostConfig's ulimit is not set, `docker inspect` will output
the daemon default.

An integration test has been added to cover the changes.

This fix fixes 26326.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-07 23:15:22 -07:00
Jana Radhakrishnan
99a98ccc14 Add support for docker run in swarm mode overlay
This PR adds support for running regular containers to be connected to
swarm mode multi-host network so that:
    - containers connected to the same network across the cluster can
      discover and connect to each other.
    - Get access to services(and their associated loadbalancers)
      connected to the same network

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 21:20:41 -07:00
Sven Dowideit
5be6ccc433 Merge pull request #24586 from farcaller/gcplogs
Added optional flags to init gcp logger metadata
2016-09-08 13:47:48 +10:00
John Howard
52f0474851 Windows: docker top implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-07 16:29:02 -07:00
Brian Goff
ce5eb34e68 Merge pull request #26378 from rhvgoyal/fix-max-retries
devmapper: Fail to start container if xfs_nospace_max_retries can't be enforced
2016-09-07 16:56:45 -04:00
Michael Crosby
7c36a1af03 Move engine-api client package
This moves the engine-api client package to `/docker/docker/client`.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00
Michael Crosby
91e197d614 Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00
Vivek Goyal
6cc55dd65b devmapper: Fail to start container if xfs_nospace_max_retries can't be enforced
We just introduced a new tunable dm.xfs_nospace_max_retries. But this tunable
will work only on new kernels where xfs supports this feature. On older
kernels xfs does not allow tuning this behavior.

There are two issues. First one is that if xfsSetNospaceRetries() fails,
it returns error but leaves the device activated and mounted. We should
be unmounting the device and deactivate it before returning.
 
Second issue is, if docker is started on older kernel, with
dm.xfs_nospace_max_retries specified, then docker will silently ignore the
fact that /sys file to tweak this behavior is not present and will continue.
But I think it might be better to fail container creation/start if kernel
does not support this feature.

This patch fixes it. After this patch, user will get an error like following
when container is run.

# docker run -ti fedora bash
docker: Error response from daemon: devmapper: user specified daemon option dm.xfs_nospace_max_retries but it does not seem to be supported on this system :open /sys/fs/xfs/dm-5/error/metadata/ENOSPC/max_retries: no such file or directory.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2016-09-07 14:03:01 -04:00
Tõnis Tiigi
a6daa94e3e Merge pull request #26342 from cpuguy83/20079_restore_volume_migrate
restore migrating pre-1.7.0 volumes
2016-09-07 10:56:07 -07:00
Brian Goff
94cfa2cc37 Merge pull request #26209 from allencloud/validate-heartbeat-in-discovery
validate heartbeat in discovery cluster opts
2016-09-07 12:11:53 -04:00
Brian Goff
cb6ea5b4f5 Merge pull request #26347 from anusha-ragunathan/plugins-libnetwork
Adding pluginv2 support for libnetwork.
2016-09-07 08:04:34 -04:00
Anusha Ragunathan
17b8aba1d9 Adding pluginv2 support for libnetwork (part 1)
Legacy plugins (aka pluginv1) calls in libnetwork are replaced with
calls using the new plugin model (aka pluginv2). pkg/plugins is still
used for managing the http client connections to the plugin.

This commit makes the necessary changes in docker/docker. Part 2 will
will take care of the libnetwork changes.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-09-06 14:30:55 -07:00
Brian Goff
dc712b9249 restore migrating pre-1.7.0 volumes
This was removed in a clean-up
(060f4ae617) but should not have been.
Fixes issues with volumes when upgrading from pre-1.7.0 daemons.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-06 17:17:47 -04:00
Phil Estes
078964177f Merge pull request #25950 from akalipetis/fix-#21738-userns-mount-create
Host mounted directories are correctly chowned to the remapped root, if the directory does not already exist
2016-09-06 12:42:39 -04:00
Michael Crosby
0d03c060c7 Merge pull request #26212 from rhvgoyal/xfs-enospc
devmapper: Set xfs max_retries to 0 upon ENOSPC
2016-09-06 09:03:09 -07:00
Antonis Kalipetis
72d8a77d52
Make host directory mounts use idtools.MkdirAllNewAs
This makes sure that:
1. Already existing directories are left untouched
2. Newly created directories are chowned to the correct root UID/GID in case of user namespaces
3. All parent directories still get created with host root UID/GID

Fix #21738

Signed-off-by: Antonis Kalipetis <akalipetis@gmail.com>
2016-09-05 12:46:57 +03:00
Yong Tang
83d79f13aa Fix issue in disconnecting a container from network
This fix tries to address the issue raised in 26220 where
disconnecting a container from network does not work if
the network id (instead of network name) has been specified.

The issue was that internally when trying to disconnecting
a contaienr fromt the network, the originally passed network
name or id has been used.

This fix uses the resolved network name (e.g., `bridge`).

An integration test has been added to cover the changes.

This fix fixes 26220.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-04 07:28:45 -07:00
Vivek Goyal
4f0017b9ad devmapper: Provide a knob dm.xfs_nospace_max_retries
When xfs filesystem is being used on top of thin pool, xfs can get ENOSPC
errors from thin pool when thin pool is full. As of now xfs retries the
IO and keeps on retrying and does not give up. This can result in container
application being stuck for a very long time. In fact I have seen instances
of unkillable processes. So that means once thin pool is full and process
gets stuck, container can't be stopped/killed either and only option left
seems to be power recycle of the box.

In another instance, writer did not block but failed after a while. But
when I tried to exit/stop the container, unmounting xfs hanged and only
thing I could do was power cycle the machine.

Now upstream kernel has committed patches where it allows user space to
customize user space behavior in case of errors. One of the knobs is
max_retries, which specifies how many times an IO should be retried
when ENOSPC is encountered.

This patch sets provides a tunable knob (dm.xfs_nospace_max_retries) so
that user can specify value for max_retries and tune xfs behavior. If
one sets this value to 0, xfs will not retry IO when ENOSPC error is
encountered. It will instead give up and shutdown filesystem.

This knob can be useful if one is running into unkillable
processes/containers issue on top of xfs.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2016-09-01 11:38:09 -04:00
Antonio Murdaca
5ff21add06
New seccomp format
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-09-01 11:53:07 +02:00
Justin Cormack
8ccac1ad4d Merge pull request #26200 from runcom/engine-api-vendor
vendor docker/engine-api@f9cef59044
2016-09-01 10:51:34 +01:00
Vincent Demeester
f173555de8 Merge pull request #26180 from yongtang/25943-validate-ip6
Fix issue in `--ip6` validation for `docker create`
2016-09-01 11:02:16 +02:00
Antonio Murdaca
8f7a8c75ae
vendor docker/engine-api@f9cef59044
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-08-31 22:39:13 +02:00