Prechádzať zdrojové kódy

Merge pull request #27079 from vieux/cherry-picks-and-changelog-1.12.2

Cherry-picks and Changelog 1.12.2-rc2
Victor Vieux 8 rokov pred
rodič
commit
545d909aac

+ 1 - 1
CHANGELOG.md

@@ -5,7 +5,7 @@ information on the list of deprecated flags and APIs please have a look at
 https://docs.docker.com/engine/deprecated/ where target removal dates can also
 https://docs.docker.com/engine/deprecated/ where target removal dates can also
 be found.
 be found.
 
 
-## 1.12.2-rc1 (2016-09-27)
+## 1.12.2-rc2 (2016-10-03)
 
 
 **IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
 **IMPORTANT**: Docker 1.12 ships with an updated systemd unit file for rpm
 based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When
 based installs (which includes RHEL, Fedora, CentOS, and Oracle Linux 7). When

+ 4 - 3
api/client/image/build.go

@@ -37,7 +37,7 @@ type buildOptions struct {
 	context        string
 	context        string
 	dockerfileName string
 	dockerfileName string
 	tags           opts.ListOpts
 	tags           opts.ListOpts
-	labels         []string
+	labels         opts.ListOpts
 	buildArgs      opts.ListOpts
 	buildArgs      opts.ListOpts
 	ulimits        *runconfigopts.UlimitOpt
 	ulimits        *runconfigopts.UlimitOpt
 	memory         string
 	memory         string
@@ -64,6 +64,7 @@ func NewBuildCommand(dockerCli *client.DockerCli) *cobra.Command {
 		tags:      opts.NewListOpts(validateTag),
 		tags:      opts.NewListOpts(validateTag),
 		buildArgs: opts.NewListOpts(runconfigopts.ValidateEnv),
 		buildArgs: opts.NewListOpts(runconfigopts.ValidateEnv),
 		ulimits:   runconfigopts.NewUlimitOpt(&ulimits),
 		ulimits:   runconfigopts.NewUlimitOpt(&ulimits),
+		labels:    opts.NewListOpts(runconfigopts.ValidateEnv),
 	}
 	}
 
 
 	cmd := &cobra.Command{
 	cmd := &cobra.Command{
@@ -92,7 +93,7 @@ func NewBuildCommand(dockerCli *client.DockerCli) *cobra.Command {
 	flags.StringVar(&options.cpuSetMems, "cpuset-mems", "", "MEMs in which to allow execution (0-3, 0,1)")
 	flags.StringVar(&options.cpuSetMems, "cpuset-mems", "", "MEMs in which to allow execution (0-3, 0,1)")
 	flags.StringVar(&options.cgroupParent, "cgroup-parent", "", "Optional parent cgroup for the container")
 	flags.StringVar(&options.cgroupParent, "cgroup-parent", "", "Optional parent cgroup for the container")
 	flags.StringVar(&options.isolation, "isolation", "", "Container isolation technology")
 	flags.StringVar(&options.isolation, "isolation", "", "Container isolation technology")
-	flags.StringSliceVar(&options.labels, "label", []string{}, "Set metadata for an image")
+	flags.Var(&options.labels, "label", "Set metadata for an image")
 	flags.BoolVar(&options.noCache, "no-cache", false, "Do not use cache when building the image")
 	flags.BoolVar(&options.noCache, "no-cache", false, "Do not use cache when building the image")
 	flags.BoolVar(&options.rm, "rm", true, "Remove intermediate containers after a successful build")
 	flags.BoolVar(&options.rm, "rm", true, "Remove intermediate containers after a successful build")
 	flags.BoolVar(&options.forceRm, "force-rm", false, "Always remove intermediate containers")
 	flags.BoolVar(&options.forceRm, "force-rm", false, "Always remove intermediate containers")
@@ -264,7 +265,7 @@ func runBuild(dockerCli *client.DockerCli, options buildOptions) error {
 		Ulimits:        options.ulimits.GetList(),
 		Ulimits:        options.ulimits.GetList(),
 		BuildArgs:      runconfigopts.ConvertKVStringsToMap(options.buildArgs.GetAll()),
 		BuildArgs:      runconfigopts.ConvertKVStringsToMap(options.buildArgs.GetAll()),
 		AuthConfigs:    dockerCli.RetrieveAuthConfigs(),
 		AuthConfigs:    dockerCli.RetrieveAuthConfigs(),
-		Labels:         runconfigopts.ConvertKVStringsToMap(options.labels),
+		Labels:         runconfigopts.ConvertKVStringsToMap(options.labels.GetAll()),
 	}
 	}
 
 
 	response, err := dockerCli.Client().ImageBuild(ctx, body, buildOptions)
 	response, err := dockerCli.Client().ImageBuild(ctx, body, buildOptions)

+ 5 - 1
api/server/router/network/network_routes.go

@@ -161,7 +161,11 @@ func (n *networkRouter) deleteNetwork(ctx context.Context, w http.ResponseWriter
 		return err
 		return err
 	}
 	}
 	if _, err := n.clusterProvider.GetNetwork(vars["id"]); err == nil {
 	if _, err := n.clusterProvider.GetNetwork(vars["id"]); err == nil {
-		return n.clusterProvider.RemoveNetwork(vars["id"])
+		if err = n.clusterProvider.RemoveNetwork(vars["id"]); err != nil {
+			return err
+		}
+		w.WriteHeader(http.StatusNoContent)
+		return nil
 	}
 	}
 	if err := n.backend.DeleteNetwork(vars["id"]); err != nil {
 	if err := n.backend.DeleteNetwork(vars["id"]); err != nil {
 		return err
 		return err

+ 3 - 1
contrib/check-config.sh

@@ -185,7 +185,7 @@ flags=(
 	KEYS
 	KEYS
 	VETH BRIDGE BRIDGE_NETFILTER
 	VETH BRIDGE BRIDGE_NETFILTER
 	NF_NAT_IPV4 IP_NF_FILTER IP_NF_TARGET_MASQUERADE
 	NF_NAT_IPV4 IP_NF_FILTER IP_NF_TARGET_MASQUERADE
-	NETFILTER_XT_MATCH_{ADDRTYPE,CONNTRACK}
+	NETFILTER_XT_MATCH_{ADDRTYPE,CONNTRACK,IPVS}
 	NF_NAT NF_NAT_NEEDED
 	NF_NAT NF_NAT_NEEDED
 
 
 	# required for bind-mounting /dev/mqueue into containers
 	# required for bind-mounting /dev/mqueue into containers
@@ -233,6 +233,8 @@ flags=(
 	NET_CLS_CGROUP $netprio
 	NET_CLS_CGROUP $netprio
 	CFS_BANDWIDTH FAIR_GROUP_SCHED RT_GROUP_SCHED
 	CFS_BANDWIDTH FAIR_GROUP_SCHED RT_GROUP_SCHED
 	IP_VS
 	IP_VS
+	IP_VS_NFCT
+ 	IP_VS_RR
 )
 )
 check_flags "${flags[@]}"
 check_flags "${flags[@]}"
 
 

+ 3 - 1
docs/reference/api/docker_remote_api_v1.24.md

@@ -4668,7 +4668,9 @@ Stop and remove the service `id`
 
 
 **Example response**:
 **Example response**:
 
 
-    HTTP/1.1 200 No Content
+    HTTP/1.1 200 OK
+    Content-Length: 0
+    Content-Type: text/plain; charset=utf-8
 
 
 **Status codes**:
 **Status codes**:
 
 

+ 3 - 1
docs/reference/api/docker_remote_api_v1.25.md

@@ -4704,7 +4704,9 @@ Stop and remove the service `id`
 
 
 **Example response**:
 **Example response**:
 
 
-    HTTP/1.1 200 No Content
+    HTTP/1.1 200 OK
+    Content-Length: 0
+    Content-Type: text/plain; charset=utf-8
 
 
 **Status codes**:
 **Status codes**:
 
 

+ 4 - 3
hack/make/cross

@@ -10,13 +10,14 @@ daemonSupporting=(
 
 
 # if we have our linux/amd64 version compiled, let's symlink it in
 # if we have our linux/amd64 version compiled, let's symlink it in
 if [ -x "$DEST/../binary-daemon/dockerd-$VERSION" ]; then
 if [ -x "$DEST/../binary-daemon/dockerd-$VERSION" ]; then
-	mkdir -p "$DEST/linux/amd64"
+	arch=$(go env GOHOSTARCH)
+	mkdir -p "$DEST/linux/${arch}"
 	(
 	(
-		cd "$DEST/linux/amd64"
+		cd "$DEST/linux/${arch}"
 		ln -s ../../../binary-daemon/* ./
 		ln -s ../../../binary-daemon/* ./
 		ln -s ../../../binary-client/* ./
 		ln -s ../../../binary-client/* ./
 	)
 	)
-	echo "Created symlinks:" "$DEST/linux/amd64/"*
+	echo "Created symlinks:" "$DEST/linux/${arch}/"*
 fi
 fi
 
 
 for platform in $DOCKER_CROSSPLATFORMS; do
 for platform in $DOCKER_CROSSPLATFORMS; do

+ 2 - 1
hack/make/tgz

@@ -4,7 +4,8 @@ CROSS="$DEST/../cross"
 
 
 set -e
 set -e
 
 
-if [ ! -d "$CROSS/linux/amd64" ]; then
+arch=$(go env GOHOSTARCH)
+if [ ! -d "$CROSS/linux/${arch}" ]; then
 	echo >&2 'error: binary and cross must be run before tgz'
 	echo >&2 'error: binary and cross must be run before tgz'
 	false
 	false
 fi
 fi

+ 1 - 1
hack/release.sh

@@ -258,7 +258,7 @@ release_build() {
 
 
 # Upload binaries and tgz files to S3
 # Upload binaries and tgz files to S3
 release_binaries() {
 release_binaries() {
-	[ -e "bundles/$VERSION/cross/linux/amd64/docker-$VERSION" ] || {
+	[ "$(find bundles/$VERSION -path "bundles/$VERSION/cross/*/*/docker-$VERSION")" != "" ] || {
 		echo >&2 './hack/make.sh must be run before release_binaries'
 		echo >&2 './hack/make.sh must be run before release_binaries'
 		exit 1
 		exit 1
 	}
 	}

+ 1 - 0
libcontainerd/client_linux.go

@@ -101,6 +101,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly
 	clnt.unlock(containerID)
 	clnt.unlock(containerID)
 
 
 	if err := clnt.backend.AttachStreams(processFriendlyName, *iopipe); err != nil {
 	if err := clnt.backend.AttachStreams(processFriendlyName, *iopipe); err != nil {
+		clnt.lock(containerID)
 		return err
 		return err
 	}
 	}
 	clnt.lock(containerID)
 	clnt.lock(containerID)

+ 2 - 2
libcontainerd/types_linux.go

@@ -27,9 +27,9 @@ type Process struct {
 	Capabilities []string `json:"capabilities,omitempty"`
 	Capabilities []string `json:"capabilities,omitempty"`
 	// Rlimits specifies rlimit options to apply to the process.
 	// Rlimits specifies rlimit options to apply to the process.
 	Rlimits []specs.Rlimit `json:"rlimits,omitempty"`
 	Rlimits []specs.Rlimit `json:"rlimits,omitempty"`
-	// ApparmorProfile specified the apparmor profile for the container.
+	// ApparmorProfile specifies the apparmor profile for the container.
 	ApparmorProfile *string `json:"apparmorProfile,omitempty"`
 	ApparmorProfile *string `json:"apparmorProfile,omitempty"`
-	// SelinuxProcessLabel specifies the selinux context that the container process is run as.
+	// SelinuxLabel specifies the selinux context that the container process is run as.
 	SelinuxLabel *string `json:"selinuxLabel,omitempty"`
 	SelinuxLabel *string `json:"selinuxLabel,omitempty"`
 }
 }