Commit graph

4055 commits

Author SHA1 Message Date
Michael Crosby
d2bc5d6276 Merge pull request #26756 from rhvgoyal/init-rw-layer
layer_store: Use CreateReadWrite() for -init layer instead of Create()
2016-09-21 15:45:06 -07:00
Vivek Goyal
2508ca000e layer_store: Use CreateReadWrite() for -init layer instead of Create()
init layer is read/write layer and not read only layer. Following commit
introduced new graph driver method CreateReadWrite.

ef5bfad Adding readOnly parameter to graphdriver Create method

So far only windows seem to be differentiating between above two methods.
Making this change to make sure -init layer calls right method so that
we don't have surprises in future.

Windows does not need init layer. This patch also gets rid of creation of
init layer on windows.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2016-09-21 14:45:25 -04:00
Vincent Demeester
340f50c1c4 Merge pull request #26737 from miaoyq/del-setting-hostconfig-during-start-container
Modify the print and comment of setting host configuration options when the container starts
2016-09-21 13:30:53 +02:00
Sebastiaan van Stijn
fd1037b432 Merge pull request #26723 from anusha-ragunathan/volmount_win
Add missing call to "VolumeDriver.Mount" during container start.
2016-09-21 10:28:29 +02:00
Antonio Murdaca
b683958dee Merge pull request #26751 from Microsoft/jjh/reverthostconfig
Revert Box from HostConfig
2016-09-21 09:53:39 +02:00
Tõnis Tiigi
511fd49402 Merge pull request #26641 from Microsoft/jjh/aggressivenamespacing
Windows: OCI aggressive namespacing
2016-09-20 13:37:41 -07:00
John Howard
6b74e2f09d Revert Box from HostConfig
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-20 12:01:04 -07:00
Anusha Ragunathan
ef728a1641 Merge pull request #26645 from anusha-ragunathan/use-pluginv2-graph
Make graphdrivers work with pluginv2.
2016-09-20 10:59:33 -07:00
John Howard
4348878242 Merge pull request #25849 from darrenstahlmsft/LibcontainerdRaces
Lock all calls to hcsshim to prevent close races
2016-09-20 10:34:54 -07:00
Anusha Ragunathan
fefea805e9 Make graphdrivers work with pluginv2.
As part of making graphdrivers support pluginv2, a PluginGetter
interface was necessary for cleaner separation and avoiding import
cycles.

This commit creates a PluginGetter interface and makes pluginStore
implement it. Then the pluginStore object is created in the daemon
(rather than by the plugin manager) and passed to plugin init as
well as to the different subsystems (eg. graphdrivers, volumedrivers).
A side effect of this change was that some code was moved out of
experimental. This is good, since plugin support will be stable soon.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-09-20 08:49:48 -07:00
Arnaud Porterie
359742f2a9 Merge pull request #25097 from msabansal/autosubnet
Fixing support for nat to choose a subnet automatically
2016-09-20 15:23:44 +00:00
Yanqiang Miao
26b6b47420 Remove the support of setting host configuration options when the container starts
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

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

update

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

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-20 20:57:17 +08:00
Michael Crosby
ee3ac3aa66 Add init process for zombie fighting
This adds a small C binary for fighting zombies.  It is mounted under
`/dev/init` and is prepended to the args specified by the user.  You
enable it via a daemon flag, `dockerd --init`, as it is disable by
default for backwards compat.

You can also override the daemon option or specify this on a per
container basis with `docker run --init=true|false`.

You can test this by running a process like this as the pid 1 in a
container and see the extra zombie that appears in the container as it
is running.

```c

int main(int argc, char ** argv) {
	pid_t pid = fork();
	if (pid == 0) {
		pid = fork();
		if (pid == 0) {
			exit(0);
		}
		sleep(3);
		exit(0);
	}
	printf("got pid %d and exited\n", pid);
	sleep(20);
}
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-19 17:33:50 -07:00
Anusha Ragunathan
b15264004d Add missing call to "VolumeDriver.Mount" during container start.
On container start, volume mounts are setup which should include
invoking "VolumeDriver.Mount" to setup necessary mounts. This was
missing for Windows containers. Fix that.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-09-19 14:40:45 -07:00
Sebastiaan van Stijn
8c508ef813 Merge pull request #26579 from Microsoft/jjh/ociprocess
Windows: OCI `process` struct and console size to uint
2016-09-19 22:52:16 +02:00
Darren Stahl
740e26f384 Lock all calls to hcsshim to prevent close races
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-19 12:59:02 -07:00
John Howard
53774423ff Windows: OCI process struct convergence
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-19 10:34:31 -07:00
John Howard
c89db6c044 Windows: OCI aggressive namespacing
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-19 10:23:11 -07:00
John Howard
72de562943 Windows: Remove osversion from OCI
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-19 10:16:15 -07:00
Tõnis Tiigi
b72c7f74a6 Merge pull request #26577 from Microsoft/jjh/fstabmount
Windows: Move to fstab options as per OCI
2016-09-19 10:13:46 -07:00
Brian Goff
45a8f68026 Merge pull request #26616 from tonistiigi/id-digest
Generalize content addressable and reference storage
2016-09-18 09:40:16 -04:00
Brian Goff
bc60f5af84 Merge pull request #26650 from Microsoft/jjh/firststart
Windows: OCI remove first start
2016-09-18 09:27:10 -04:00
Brian Goff
112ba3637d Merge pull request #26578 from Microsoft/jjh/ociuser
Windows: Unify OCI user struct
2016-09-18 09:20:45 -04:00
John Howard
f61315f0df Windows: Remove TP5 hack from graphdriver
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-17 16:16:50 -07:00
John Howard
4a0419f536 Merge pull request #25737 from Microsoft/jjh-statistics
Windows: Add support for docker stats
2016-09-17 09:31:24 -07:00
Vincent Demeester
e54171378c Merge pull request #26656 from miaoyq/rename-name-to-destination
Rename the variable 'name' to 'destination'
2016-09-17 16:01:02 +02:00
Vincent Demeester
5d7b725071 Merge pull request #26606 from dnephin/move_errors
Move errors package to api/errors
2016-09-17 16:00:38 +02:00
Vincent Demeester
1d8ad2974e Merge pull request #26643 from allencloud/validate-two-service-modes-in-request
return err when both two service modes in request
2016-09-17 15:50:55 +02:00
Brian Goff
3548356957 Merge pull request #26555 from miaoyq/refactor-aufsMount
refactor the function 'aufsMount' in 'daemon/graphdriver/aufs/aufs.go'
2016-09-17 08:04:18 -04:00
allencloud
c413d4177b return err when both two service mode in request
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-09-17 19:04:46 +08:00
Yanqiang Miao
57cec5a777 Rename the variable 'name' to 'destination'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-17 10:52:11 +08:00
John Howard
f7fd408ba7 Windows: OCI remove first start
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 16:05:55 -07:00
John Howard
340e5233b2 Windows: stats support
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 11:56:15 -07:00
Michael Crosby
efe4e914ef Merge pull request #26207 from splunk/splunk-logging-driver-performance-improvements
Splunk Logging Driver performance improvements
2016-09-16 10:22:09 -07:00
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
Tonis Tiigi
805223982c Generalize content addressable and reference storage
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-15 18:08:19 -07: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
John Howard
bb585b9c10 Windows: Move to fstab options as per OCI
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-15 10:12:20 -07:00
John Howard
93f61b85eb Windows: Unify OCI user struct
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-15 09:59:27 -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
Yanqiang Miao
b6a268d91f refactor the function 'aufsMount' in 'daemon/graphdriver/aufs/aufs.go'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-14 15:42:51 +08: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