Commit Graph

5465 Commits

Author SHA1 Message Date
eefbd135ae Remove solaris build tag and `contrib/mkimage/solaris
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4785f1a7ab7ec857dc3ca849ee6ecadf519ef30e
Component: engine
2017-11-02 00:01:46 +00:00
45def429d3 Merge pull request #34424 from simonferquel/swarm-service-isolation
Added support for swarm service isolation mode
Upstream-commit: d91c5f42eb37c6f88cec4021c10c0a1ded1785c3
Component: engine
2017-11-01 16:41:10 -04:00
c0bf3ebcc8 Merge pull request #35177 from sargun/add-quota-tests
Add tests to project quotas and detection mechanism
Upstream-commit: 226eb8004e0e9b1cd55b37ce4c235c0f19ca9a14
Component: engine
2017-10-30 21:08:38 +01:00
89f40238db Merge pull request #34888 from jahkeup/sized-logger
logger: copy to log driver's bufsize, fixes #34887
Upstream-commit: dfc2d62632d32f9d38166ea477f0ca033a5c91c2
Component: engine
2017-10-30 12:37:41 -07:00
bd61323342 logger: copy to log driver's bufsize
Log drivers may have an internal buffer size that can be accommodated
by the copier as it is more effective to buffer and send fewer though
larger messages that the log driver can consume.

This eliminates the need for Partial handling for drivers that do not
support the concept (ie: awslogs, which can only have events up to
service limits).

Signed-off-by: Jacob Vallejo <jakeev@amazon.com>
Upstream-commit: e1ada0b885b31de0bb0e79b4d99ae4d48b65f721
Component: engine
2017-10-30 16:25:09 +00:00
1377e81acb Added support for swarm service isolation mode
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: f28cb422e69bd4239401e6ea32b65b56485d6691
Component: engine
2017-10-30 16:16:18 +01:00
b3821c58fe Merge pull request #34999 from kolyshkin/wait-on-rm
ContainerWait on remove: don't stuck on rm fail
Upstream-commit: 220d6c4aff7e3c8887f8c39e8f47b4aca21ab22f
Component: engine
2017-10-29 11:04:41 -07:00
320e3a6526 Add tests to project quotas and detection mechanism
This adds a mechanism (read-only) to check for project quota support
in a standard way. This mechanism is leveraged by the tests, which
test for the following:
 1. Can we get a quota controller?
 2. Can we set the quota for a particular directory?
 3. Is the quota being over-enforced?
 4. Is the quota being under-enforced?
 5. Can we retrieve the quota?

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 6966dc0aa9134c518babcbf1f02684cae5374843
Component: engine
2017-10-27 11:07:37 -07:00
b238ed565f Improve devicemapper driver-status output
Do not print "Data file" and "Metadata file" if they're
not used, and sort/group output.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8f702de9b705ced68b6244239ac81d86ebdd6b0a
Component: engine
2017-10-27 10:12:39 +02:00
8efb0e1631 ContainerWait on remove: don't stuck on rm fail
Currently, if a container removal has failed for some reason,
any client waiting for removal (e.g. `docker run --rm`) is
stuck, waiting for removal to succeed while it has failed already.
For more details and the reproducer, please check
https://github.com/moby/moby/issues/34945

This commit addresses that by allowing `ContainerWait()` with
`container.WaitCondition == "removed"` argument to return an
error in case of removal failure. The `ContainerWaitOKBody`
stucture returned to a client is amended with a pointer to `struct Error`,
containing an error message string, and the `Client.ContainerWait()`
is modified to return the error, if any, to the client.

Note that this feature is only available for API version >= 1.34.
In order for the old clients to be unstuck, we just close the connection
without writing anything -- this causes client's error.

Now, docker-cli would need a separate commit to bump the API to 1.34
and to show an error returned, if any.

[v2: recreate the waitRemove channel after closing]
[v3: document; keep legacy behavior for older clients]
[v4: convert Error from string to pointer to a struct]
[v5: don't emulate old behavior, send empty response in error case]
[v6: rename legacy* vars to include version suffix]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: f963500c544daa3c158c0ca3d2985295c875cb6b
Component: engine
2017-10-25 13:11:56 -07:00
373458dd9c Merge pull request #34670 from sargun/use_copy_file_range
Use In-kernel File Copy for Overlayfs and VFS on Linux
Upstream-commit: ce5800c329510bbf38c6899c3386633823acefcd
Component: engine
2017-10-25 17:10:44 +02:00
7f1869d232 Merge pull request #35285 from crosbymichael/solaris
Remove solaris files
Upstream-commit: 17bb1d3663f6586e83b453670526e3186bb56dd3
Component: engine
2017-10-25 15:14:04 +02:00
a04c3458dc Add zero-copy support to copy module
This changeset allows Docker's VFS, and Overlay to take advantage of
Linux's zerocopy APIs.

The copy function first tries to use the ficlone ioctl. Reason being:
 - they do not allow partial success (aka short writes)
 - clones are expected to be a fast metadata operation
See: http://oss.sgi.com/archives/xfs/2015-12/msg00356.html

If the clone fails, we fall back to copy_file_range, which internally
may fall back to splice, which has an upper limit on the size
of copy it can perform. Given that, we have to loop until the copy
is done.

For a given dirCopy operation, if the clone fails, we will not try
it again during any other file copy. Same is true with copy_file_range.

If all else fails, we fall back to traditional copy.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 3ec4ec2857c714387e7b59c2cf324565f6ae55e2
Component: engine
2017-10-24 13:14:40 -07:00
671341f0e3 Separate daemon/graphdriver/overlay/copy into its own package
Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 5298785b8e612ca5d3943fada08a46978971ba70
Component: engine
2017-10-24 13:14:40 -07:00
d78181e968 Remove solaris files
For obvious reasons that it is not really supported now.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 5a9b5f10cf967f31f0856871ad08f9a0286b4a46
Component: engine
2017-10-24 15:39:34 -04:00
2740139c0c Merge pull request #35125 from ripcurld0/reload_no_config
Reload daemon even if "/etc/docker/daemon.json" does not exist
Upstream-commit: 04e8d7b8bfc531fdfc6fb201fae39820002455fe
Component: engine
2017-10-24 21:23:49 +02:00
68eac4a32f Merge pull request #35055 from adnxn/creds-endpoint
Add credentials endpoint option for awslogs driver
Upstream-commit: 158c072bde002c574e10f54763844f67e0ae34c0
Component: engine
2017-10-24 14:45:14 -04:00
259cc0cc87 Increase container default shutdown timeout on Windows
The shutdown timeout for containers in insufficient on Windows. If the daemon is shutting down, and a container takes longer than expected to shut down, this can cause the container to remain in a bad state after restart, and never be able to start again. Increasing the timeout makes this less likely to occur.

Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: ed74ee127f42f32ee98be7b908e1562b1c0554d7
Component: engine
2017-10-23 10:31:31 -07:00
74a0738e87 Merge pull request #35253 from Microsoft/jjh/startuplogging
Windows: Fix startup logging
Upstream-commit: 2058854c4b118b28abe638befbb98320526da902
Component: engine
2017-10-23 18:43:41 +02:00
1dbedcfc9e Merge pull request #34895 from mlaventure/containerd-1.0-client
Containerd 1.0 client
Upstream-commit: 402540708c9a0c35dc0b279a0f330455633537b8
Component: engine
2017-10-23 10:38:03 -04:00
b49329396e Reload daemon even if "/etc/docker/daemon.json" does not exist
Before this commit if "--config-file" wasn't set the daemon would use
the default configuration file which is "/etc/docker/daemon.json".

When attempting to reload the daemon if that file didn't exist
and error message would display.

This behaviour is changed in a way that if the default configuration
file does not exist and no other configuration file is set
the daemon uses an empty configuration which later will be updated
and reloaded using the "reload" function given as an argument in Reload.

However, if the "--config-file" is set and the file is removed
or renamed an error message will be displayed and no reload will be done.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 0f8119a87dc301e9543c45c416d6b4545da1fc46
Component: engine
2017-10-22 15:20:52 +03:00
e59c840b6d Merge pull request #35077 from ryansimmen/35076-WindowsDaemonTmpDir
Windows Daemon should respect DOCKER_TMPDIR
Upstream-commit: ab0eb8fcf6fe6b4ee12393edcd6465501b5c66a1
Component: engine
2017-10-20 08:40:43 -07:00
044d7f995b Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ddae20c032058a0fd42c34c2e9750ee8f6296ac8
Component: engine
2017-10-20 07:11:37 -07:00
d03ac8e017 Fix startup logging
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7d0dea10557e01865d67aa90c43b294fa6b36c42
Component: engine
2017-10-19 11:09:29 -07:00
fcfff58f66 Windows Daemon should respect DOCKER_TMPDIR
Signed-off-by: Ryan Simmen <ryan.simmen@gmail.com>
Upstream-commit: 5611f127a7028c40a2ba59a1a09f92cdfe99f2ba
Component: engine
2017-10-19 10:47:46 -04:00
d91c638398 Typo fixed and simple code.
Signed-off-by: Ri Xu <xuri@360.net>
Upstream-commit: 87e8a936e82ecfbef59b829d8bbfca3fb4aa3163
Component: engine
2017-10-18 10:26:58 +08:00
9816812d14 Merge pull request #35157 from BSWANG/fix-panic-on-restore
fix panic on get container pid when live restore containers
Upstream-commit: fa2df86ab62a231c8859400540bb4542143f3e0c
Component: engine
2017-10-16 20:24:20 -04:00
77fe26d1a3 daemon: oci: obey CL_UNPRIVILEGED for user namespaced daemon
When runc is bind-mounting a particular path "with options", it has to
do so by first creating a bind-mount and the modifying the options of
said bind-mount via remount. However, in a user namespace, there are
restrictions on which flags you can change with a remount (due to
CL_UNPRIVILEGED being set in this instance). Docker historically has
ignored this, and as a result, internal Docker mounts (such as secrets)
haven't worked with --userns-remap. Fix this by preserving
CL_UNPRIVILEGED mount flags when Docker is spawning containers with user
namespaces enabled.

Ref: https://github.com/opencontainers/runc/pull/1603
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: c0f883fdeeb2480970fb48fbcbc2a842aa5a90e8
Component: engine
2017-10-16 02:52:56 +11:00
03dc500ba7 Merge pull request #34509 from thaJeztah/fix-network-delete
Fix network name masking network ID on delete
Upstream-commit: 0181eb8f213284b0fae754f28123076c5cab9be4
Component: engine
2017-10-13 08:40:09 -07:00
c90eb48e09 Merge pull request #34960 from sterchelen/34953-Prune-Volume-lack-event-entry
Fix #34953 how volumes are pruned from daemon
Upstream-commit: 2a7388a6c47a58c402acfe0059fbe27a7a090c23
Component: engine
2017-10-12 09:24:26 -07:00
594afcb5ff Merge pull request #35144 from Microsoft/jjh/fixdownlevel
Fix regression on inspect
Upstream-commit: 1ffa10ee2630917e4f2a88f5e4daf34d700eaa1f
Component: engine
2017-10-12 00:52:28 +02:00
33fa7572b6 Fix network name masking network ID on delete
If a network is created with a name that matches another
network's ID, the network with that name was masking the
other network's ID.

As a result, it was not possible to remove the network
with a given ID.

This patch changes the order in which networks are
matched to be what we use for other cases;

1. Match on full ID
2. Match on full Name
3. Match on Partial ID

Before this patch:

    $ docker network create foo
    336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b

    $ docker network create 336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b
    4a698333f1197f20224583abce14876d7f25fdfe416a8545927006c315915a2a

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    4a698333f119        336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b   bridge              local
    d1e40d43a2c0        bridge                                                             bridge              local
    336717eac9ea        foo                                                                bridge              local
    13cf280a1bbf        host                                                               host                local
    d9e4c03728a0        none                                                               null                local

    $ docker network rm 336717eac9eaa3da6557042a04efc803f7e8862ce6cf96f6b9565265ba5c618b
    4a698333f1197f20224583abce14876d7f25fdfe416a8545927006c315915a2a

    $ docker network ls
    NETWORK ID          NAME                DRIVER              SCOPE
    d1e40d43a2c0        bridge              bridge              local
    336717eac9ea        foo                 bridge              local
    13cf280a1bbf        host                host                local
    d9e4c03728a0        none                null                local

After this patch:

    $ docker network create foo
    2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835

    $ docker network create 2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835
    6cbc749a529cd2d9d3b10566c84e56c4203dd88b67417437b5fc7a6e955dd48f

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    6cbc749a529c        2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835   bridge              local
    166c943dbeb5        bridge                                                             bridge              local
    2d1791a7def4        foo                                                                bridge              local
    6c45b8aa6d8e        host                                                               host                local
    b11c96b51ea7        none                                                               null                local

    $ docker network rm 2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835
    2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835

    $ docker network ls
    NETWORK ID          NAME                                                               DRIVER              SCOPE
    6cbc749a529c        2d1791a7def4e2a1ef0f6b83c6add333df0bb4ced2f196c584cb64e6bd94b835   bridge              local
    166c943dbeb5        bridge                                                             bridge              local
    6c45b8aa6d8e        host                                                               host                local
    b11c96b51ea7        none                                                               null                local

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e52001c56e12e4fc63fb5d89ef919295d6ddd5d5
Component: engine
2017-10-11 21:57:05 +02:00
6bfc0ecd57 Don't abort when setting may_detach_mounts
83c2152de503012195bd26069fd8fbd2dea4b32f sets the kernel param for
fs.may_detach_mounts, but this is not neccessary for the daemon to
operate. Instead of erroring out (and thus aborting startup) just log
the error.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c6a2044497e0e1ff61350859c8572a2c31c17ced
Component: engine
2017-10-11 14:54:24 -04:00
84fbbffdb4 fix panic on get container pid when live restore containers
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
Upstream-commit: db8de0d0da0a5285dfc35d2c81553a1b2d8db24e
Component: engine
2017-10-10 22:45:34 +08:00
1ec5c9a00f Merge pull request #34758 from ghislainbourgeois/33495-add-tcp-to-gelf-log-driver
Add TCP support for GELF log driver
Upstream-commit: 3437f0f4e57453097c42088fcfc2ac6bf7c59170
Component: engine
2017-10-10 10:26:01 -04:00
3730192eec Fix downlevel regression
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9b2a20819e7b29ce4dee46d87e8c32ae7ca9899
Component: engine
2017-10-09 13:47:28 -07:00
f174f34034 Fix #34953 how volumes are pruned from daemon
- Call the function that create an event entry while volumes are
pruning.
- Pass volume.Volume type on volumeRm instead of a name. Volume lookup is done
on the exported VolumeRm function.
- Skip volume deletion when force option used and it does not exists.

Signed-off-by: Nicolas Sterchele <sterchele.nicolas@gmail.com>
Upstream-commit: 63864ad8c17f0119a38af3cb9b1bc64a8afd0584
Component: engine
2017-10-09 21:15:26 +02:00
3d973055bf LCOW: API change JSON header to string POST parameter
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d98ecf2d6cdad7dae65868398440cfdc855e5263
Component: engine
2017-10-06 15:26:48 -07:00
35db73fa01 LCOW: API: Add platform to /images/create and /build
Signed-off-by: John Howard <jhoward@microsoft.com>

This PR has the API changes described in https://github.com/moby/moby/issues/34617.
Specifically, it adds an HTTP header "X-Requested-Platform" which is a JSON-encoded
OCI Image-spec `Platform` structure.

In addition, it renames (almost all) uses of a string variable platform (and associated)
methods/functions to os. This makes it much clearer to disambiguate with the swarm
"platform" which is really os/arch. This is a stepping stone to getting the daemon towards
fully multi-platform/arch-aware, and makes it clear when "operating system" is being
referred to rather than "platform" which is misleadingly used - sometimes in the swarm
meaning, but more often as just the operating system.
Upstream-commit: 0380fbff37922cadf294851b1546f4c212c7f364
Component: engine
2017-10-06 11:44:18 -07:00
9da01454db Fix conflicting container name producint 400 error instead of 409
Commit ebcb7d6b406fe50ea9a237c73004d75884184c33 removed string checking
for error messages, in favor of typed errors.

In this change, the status code for conflicting container  names
changed from 409 to 400 (validationError).

This patch add a `nameConflictError`, changing the status code to
409 as it was in older versions.

With this change applied, the correct 409 status is returned:

```bash
$ docker create --name c1 busybox
```

```bash
$ curl --unix-socket /var/run/docker.sock -v -XPOST -H"Content-Type: application/json" -d'{"Image":"busybox"}' http://localhost/containers/create?name=c1
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying /var/run/docker.sock...
* Connected to localhost (/var/run/docker.sock) port 80 (#0)
> POST /containers/create?name=c1 HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 19
>
* upload completely sent off: 19 out of 19 bytes
< HTTP/1.1 409 Conflict
< Api-Version: 1.33
< Content-Type: application/json
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/17.06.0-dev (linux)
< Date: Thu, 28 Sep 2017 15:07:23 GMT
< Content-Length: 229
<
{"message":"Conflict. The container name \"/c1\" is already in use by container \"ed2efdc806c1883954e677eb9ab8cbc7e286c9c5934ef6724fd5d93c56744923\". You have to remove (or rename) that container to be able to reuse that name."}
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e424343b4348f994d5c2922e7556629a620b4b3b
Component: engine
2017-10-04 20:39:45 +02:00
b11186b8f9 Merge pull request #34342 from coolljt0725/fallback_to_naive_diff
Fallback to use naive diff driver if enable CONFIG_OVERLAY_FS_REDIRECT_DIR
Upstream-commit: 595b929c573236dd95111429039f7f0788c1a7e5
Component: engine
2017-10-03 06:45:17 -07:00
7a1f68fd02 Add credentials endpoint option for awslogs driver
Signed-off-by: Adnan Khan <adnkha@amazon.com>
Upstream-commit: c7cc9d67590dd11343336c121e3629924a9894e9
Component: engine
2017-10-02 00:25:49 -07:00
76886c96d8 fix typo
Signed-off-by: Yuhao Fang <fangyuhao@gmail.com>
Upstream-commit: c673319dea5adcb33379b13f8e70c1d157e7c87d
Component: engine
2017-10-01 23:11:58 +08:00
28e35b96d0 Fixing panic when sandbox is nil
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: c4ad0747e929a41ecec7e8c2ae2bd0cc037401ed
Component: engine
2017-09-29 09:23:06 -07:00
00bb761ead Merge pull request #34990 from pradipd/update_field_name
Update field name
Upstream-commit: 853df8f32bf560428fdc39dfd9bfa7bb7c610346
Component: engine
2017-09-27 20:00:18 +02:00
240408899b Merge pull request #34928 from darrenstahlmsft/HnsRunning
Ensure Host Network Service exists
Upstream-commit: 6af60b3c6180817e06ce87d562643b442a866502
Component: engine
2017-09-27 17:35:08 +02:00
4262667057 Merge pull request #34985 from thaJeztah/remove-use-of-deprecated-filter-functions
Remove use of deprecated filter functions
Upstream-commit: a343cba40c25deb2893e13f9a81dbcc4d19d16e2
Component: engine
2017-09-27 17:34:07 +02:00
7ed1303eb4 Merge pull request #34881 from ityangchen/test-moby
"docker swarm init --force-new-cluster" use limit
Upstream-commit: 0b968f91958eea12c2fa82cec64790cb03367232
Component: engine
2017-09-27 14:11:46 +02:00
e4f32567d3 Updating moby to correspond to naming convention used in https://github.com/docker/swarmkit/pull/2385
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: d00a07b1e6d46c3cc9ef95e8b6227115830e2701
Component: engine
2017-09-26 22:08:10 +00:00
de74f6b50c Merge pull request #34952 from allencloud/add-specific-event-filter
add node/service/secret/config specific event filter
Upstream-commit: afe31900915782daf67b40d405d8e7b8e01ab2dd
Component: engine
2017-09-26 22:46:41 +02:00