Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit e126c63

Browse files
Merge component 'engine' from git@github.com:docker/engine 19.03
2 parents f0e27e5 + 8d20869 commit e126c63

37 files changed

Lines changed: 71020 additions & 197 deletions

File tree

components/engine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#
2626

2727
ARG CROSS="false"
28-
ARG GO_VERSION=1.12.16
28+
ARG GO_VERSION=1.12.17
2929
ARG DEBIAN_FRONTEND=noninteractive
3030

3131
FROM golang:${GO_VERSION}-stretch AS base

components/engine/Dockerfile.e2e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_VERSION=1.12.16
1+
ARG GO_VERSION=1.12.17
22

33
FROM golang:${GO_VERSION}-alpine AS base
44

components/engine/Dockerfile.simple

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# This represents the bare minimum required to build and test Docker.
77

8-
ARG GO_VERSION=1.12.16
8+
ARG GO_VERSION=1.12.17
99

1010
FROM golang:${GO_VERSION}-stretch
1111

components/engine/Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ FROM microsoft/windowsservercore
165165
# Use PowerShell as the default shell
166166
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
167167

168-
ARG GO_VERSION=1.12.16
168+
ARG GO_VERSION=1.12.17
169169

170170
# Environment variable notes:
171171
# - GO_VERSION must be consistent with 'Dockerfile' used by Linux.

components/engine/api/swagger.yaml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ info:
6565
6666
# Authentication
6767
68-
Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as `POST /images/(name)/push`. These are sent as `X-Registry-Auth` header as a Base64 encoded (JSON) string with the following structure:
68+
Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as `POST /images/(name)/push`. These are sent as `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) (JSON) string with the following structure:
6969
7070
```
7171
{
@@ -3021,14 +3021,36 @@ definitions:
30213021
type: "object"
30223022
properties:
30233023
Constraints:
3024-
description: "An array of constraints."
3024+
description: |
3025+
An array of constraint expressions to limit the set of nodes where
3026+
a task can be scheduled. Constraint expressions can either use a
3027+
_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find
3028+
nodes that satisfy every expression (AND match). Constraints can
3029+
match node or Docker Engine labels as follows:
3030+
3031+
node attribute | matches | example
3032+
---------------------|--------------------------------|-----------------------------------------------
3033+
`node.id` | Node ID | `node.id==2ivku8v2gvtg4`
3034+
`node.hostname` | Node hostname | `node.hostname!=node-2`
3035+
`node.role` | Node role (`manager`/`worker`) | `node.role==manager`
3036+
`node.platform.os` | Node operating system | `node.platform.os==windows`
3037+
`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`
3038+
`node.labels` | User-defined node labels | `node.labels.security==high`
3039+
`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04`
3040+
3041+
`engine.labels` apply to Docker Engine labels like operating system,
3042+
drivers, etc. Swarm administrators add `node.labels` for operational
3043+
purposes by using the [`node update endpoint`](#operation/NodeUpdate).
3044+
30253045
type: "array"
30263046
items:
30273047
type: "string"
30283048
example:
30293049
- "node.hostname!=node3.corp.example.com"
30303050
- "node.role!=manager"
30313051
- "node.labels.type==production"
3052+
- "node.platform.os==linux"
3053+
- "node.platform.arch==x86_64"
30323054
Preferences:
30333055
description: "Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence."
30343056
type: "array"
@@ -3617,7 +3639,7 @@ definitions:
36173639
com.example.some-other-label: "some-other-value"
36183640
Data:
36193641
description: |
3620-
Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2))
3642+
Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))
36213643
data to store as secret.
36223644
36233645
This field is only used to _create_ a secret, and is not returned by
@@ -3667,7 +3689,7 @@ definitions:
36673689
type: "string"
36683690
Data:
36693691
description: |
3670-
Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-3.2))
3692+
Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5))
36713693
config data.
36723694
type: "string"
36733695
Templating:
@@ -6749,7 +6771,7 @@ paths:
67496771
required: false
67506772
- name: "X-Registry-Auth"
67516773
in: "header"
6752-
description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
6774+
description: "A base64url-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
67536775
type: "string"
67546776
- name: "platform"
67556777
in: "query"
@@ -6977,7 +6999,7 @@ paths:
69776999
type: "string"
69787000
- name: "X-Registry-Auth"
69797001
in: "header"
6980-
description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
7002+
description: "A base64url-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
69817003
type: "string"
69827004
required: true
69837005
tags: ["Image"]
@@ -8683,7 +8705,7 @@ paths:
86838705
type: "string"
86848706
- name: "X-Registry-Auth"
86858707
in: "header"
8686-
description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)"
8708+
description: "A base64url-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)"
86878709
type: "string"
86888710
- name: "body"
86898711
in: "body"
@@ -8848,7 +8870,7 @@ paths:
88488870
type: "string"
88498871
- name: "X-Registry-Auth"
88508872
in: "header"
8851-
description: "A base64-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)"
8873+
description: "A base64url-encoded auth configuration to use when pulling a plugin from a registry. [See the authentication section for details.](#section/Authentication)"
88528874
type: "string"
88538875
- name: "body"
88548876
in: "body"
@@ -9541,7 +9563,7 @@ paths:
95419563
foo: "bar"
95429564
- name: "X-Registry-Auth"
95439565
in: "header"
9544-
description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
9566+
description: "A base64url-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
95459567
type: "string"
95469568
tags: ["Service"]
95479569
/services/{id}:
@@ -9700,7 +9722,7 @@ paths:
97009722
type: "string"
97019723
- name: "X-Registry-Auth"
97029724
in: "header"
9703-
description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
9725+
description: "A base64url-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
97049726
type: "string"
97059727

97069728
tags: ["Service"]

components/engine/api/types/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type ContainerCommitOptions struct {
5050

5151
// ContainerExecInspect holds information returned by exec inspect.
5252
type ContainerExecInspect struct {
53-
ExecID string
53+
ExecID string `json:"ID"`
5454
ContainerID string
5555
Running bool
5656
ExitCode int

components/engine/contrib/dockerd-rootless.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#
44
# Usage: dockerd-rootless.sh --experimental [DOCKERD_OPTIONS]
55
# Currently, specifying --experimental is mandatory.
6-
# Also, to expose ports, you need to specify
7-
# --userland-proxy-path=/path/to/rootlesskit-docker-proxy
86
#
97
# External dependencies:
108
# * newuidmap and newgidmap needs to be installed.

components/engine/daemon/cluster/swarm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func (c *Cluster) Init(req types.InitRequest) (string, error) {
3333
// API handlers to finish before shutting down the node.
3434
c.mu.Lock()
3535
if !c.nr.nodeState.IsManager() {
36+
c.mu.Unlock()
3637
return "", errSwarmNotManager
3738
}
3839
c.mu.Unlock()

components/engine/daemon/create_unix.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ func (daemon *Daemon) createContainerOSSpecificSettings(container *container.Con
4646

4747
// Skip volumes for which we already have something mounted on that
4848
// destination because of a --volume-from.
49-
if container.IsDestinationMounted(destination) {
49+
if container.HasMountFor(destination) {
50+
logrus.WithField("container", container.ID).WithField("destination", spec).Debug("mountpoint already exists, skipping anonymous volume")
51+
// Not an error, this could easily have come from the image config.
5052
continue
5153
}
5254
path, err := container.GetResourcePath(destination)

components/engine/daemon/daemon.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,24 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
866866
registerMetricsPluginCallback(d.PluginStore, metricsSockPath)
867867

868868
gopts := []grpc.DialOption{
869+
// WithBlock makes sure that the following containerd request
870+
// is reliable.
871+
//
872+
// NOTE: In one edge case with high load pressure, kernel kills
873+
// dockerd, containerd and containerd-shims caused by OOM.
874+
// When both dockerd and containerd restart, but containerd
875+
// will take time to recover all the existing containers. Before
876+
// containerd serving, dockerd will failed with gRPC error.
877+
// That bad thing is that restore action will still ignore the
878+
// any non-NotFound errors and returns running state for
879+
// already stopped container. It is unexpected behavior. And
880+
// we need to restart dockerd to make sure that anything is OK.
881+
//
882+
// It is painful. Add WithBlock can prevent the edge case. And
883+
// n common case, the containerd will be serving in shortly.
884+
// It is not harm to add WithBlock for containerd connection.
885+
grpc.WithBlock(),
886+
869887
grpc.WithInsecure(),
870888
grpc.WithBackoffMaxDelay(3 * time.Second),
871889
grpc.WithDialer(dialer.Dialer),

0 commit comments

Comments
 (0)