Commit graph

35655 commits

Author SHA1 Message Date
Tibor Vass
6ba1e91877
Merge pull request #37651 from tiborvass/new-builder-prune
builder: add prune options to the API
2018-09-04 07:50:09 -07:00
Tibor Vass
8af91768c7
Merge pull request #37692 from AntaresS/live-reload-buildkit
allow features option live reloading
2018-09-01 17:03:23 -07:00
Tonis Tiigi
354c241041 builder: implement ref checker
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-01 23:40:06 +00:00
Tibor Vass
d47435a004 builder: fix pruning all cache
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-01 22:01:17 +00:00
Tibor Vass
8ff7847d1c builder: add prune options to the API
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-01 22:01:17 +00:00
Brian Goff
9be3ed429b
Merge pull request #37734 from kolyshkin/poller
pkg/filenotify/poller fixes
2018-09-01 08:55:24 -07:00
Sebastiaan van Stijn
91ca2a15f7
Merge pull request #37739 from kolyshkin/local-volume-mount-selinux
Fix relabeling local volume source dir
2018-09-01 01:50:08 +02:00
Anda Xu
58a75cebdd allow features option live reloadable
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-08-31 12:43:04 -07:00
Kir Kolyshkin
27d9030b23 Fix relabeling local volume source dir
In case a volume is specified via Mounts API, and SELinux is enabled,
the following error happens on container start:

> $ docker volume create testvol
> $ docker run --rm --mount source=testvol,target=/tmp busybox true
> docker: Error response from daemon: error setting label on mount
> source '': no such file or directory.

The functionality to relabel the source of a local mount specified via
Mounts API was introduced in commit 5bbf5cc and later broken by commit
e4b6adc, which removed setting mp.Source field.

With the current data structures, the host dir is already available in
v.Mountpoint, so let's just use it.

Fixes: e4b6adc
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-08-30 15:58:49 -07:00
Kir Kolyshkin
fffa8958d0 pkg/filenotify/poller: fix Close()
The code in Close() that removes the watches was not working,
because it first sets `w.closed = true` and then calls w.close(),
which starts with
```
        if w.closed {
                return errPollerClosed
	}
```

Fix by setting w.closed only after calling w.remove() for all the
files being watched.

While at it, remove the duplicated `delete(w.watches, name)` code.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-08-29 22:16:04 -07:00
Kir Kolyshkin
dfbb64ea7d pkg/filenotify/poller: close file asap
There is no need to wait for up to 200ms in order to close
the file descriptor once the chClose is received.

This commit might reduce the chances for occasional "The process
cannot access the file because it is being used by another process"
error on Windows, where an opened file can't be removed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-08-29 13:51:09 -07:00
Kir Kolyshkin
88bcf1573c pkg/filenotify: poller.Add: fix fd leaks on err
In case of errors, the file descriptor is never closed. Fix it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-08-29 13:46:46 -07:00
Vincent Demeester
64b7575802
Merge pull request #37727 from thaJeztah/bump_golang_1.10.4
Bump Go to 1.10.4
2018-08-29 08:37:11 +02:00
Tibor Vass
082da188a3
Merge pull request #37728 from thaJeztah/fix_prefix_matching
Fix regression when filtering container names using a leading slash
2018-08-28 16:59:30 -07:00
Sebastiaan van Stijn
6f9b5ba810
Fix regression when filtering container names using a leading slash
Commit 5c8da2e967 updated the filtering behavior
to match container-names without having to specify the leading slash.

This change caused a regression in situations where a regex was provided as
filter, using an explicit leading slash (`--filter name=^/mycontainername`).

This fix changes the filters to match containers both with, and without the
leading slash, effectively making the leading slash optional when filtering.

With this fix, filters with and without a leading slash produce the same result:

    $ docker ps --filter name=^a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    21afd6362b0c        busybox             "sh"                2 minutes ago       Up 2 minutes                            a2
    56e53770e316        busybox             "sh"                2 minutes ago       Up 2 minutes                            a1

    $ docker ps --filter name=^/a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    21afd6362b0c        busybox             "sh"                2 minutes ago       Up 2 minutes                            a2
    56e53770e316        busybox             "sh"                3 minutes ago       Up 3 minutes                            a1

    $ docker ps --filter name=^b
    CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS               NAMES
    b69003b6a6fe        busybox             "sh"                About a minute ago   Up About a minute                       b1

    $ docker ps --filter name=^/b
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    b69003b6a6fe        busybox             "sh"                56 seconds ago      Up 54 seconds                           b1

    $ docker ps --filter name=/a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    21afd6362b0c        busybox             "sh"                3 minutes ago       Up 3 minutes                            a2
    56e53770e316        busybox             "sh"                4 minutes ago       Up 4 minutes                            a1

    $ docker ps --filter name=a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    21afd6362b0c        busybox             "sh"                3 minutes ago       Up 3 minutes                            a2
    56e53770e316        busybox             "sh"                4 minutes ago       Up 4 minutes                            a1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-28 21:40:13 +02:00
John Howard
a005332346
Merge pull request #37726 from kolyshkin/make-ps1
hack/make.ps1: know where we failed
2018-08-28 10:17:45 -07:00
Sebastiaan van Stijn
fe1fb7417c
Bump Go to 1.10.4
Includes fixes to the go command, linker, and the net/http, mime/multipart,
ld/macho, bytes, and strings packages. See the Go 1.10.4 milestone on the
issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.10.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-28 10:08:30 +02:00
Akihiro Suda
e8cc5a0b37
Merge pull request #37717 from taylanisikdemir/gcplogs-windows
Enable gcplogs driver on windows
2018-08-27 19:24:24 -07:00
Kir Kolyshkin
d2788cb2f0 hack/make.ps1: know where we failed
In case of an exception, it makes great sense to print out some
information telling where exactly it happened.

_.InvocationInfo.PositionMessage gives script name, line number,
character position and (depending on the PS version) highlights
the part where error has happened.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-08-27 18:04:57 -07:00
Sebastiaan van Stijn
0c5f8d2b9b
Merge pull request #37718 from kolyshkin/test-attach-detach
integration-cli: fix TestAttachDetach, rm TestAttachDetachTruncatedID
2018-08-27 15:13:23 +02:00
Doug Davis
fe3bc75cc4
Merge pull request #37721 from SeungUkLee/master
fixed typo (becuase -> because)
2018-08-26 07:12:45 -04:00
SeungUkLee
a79f8b48d4 fixed typo (becuase -> because)
Signed-off-by: SeungUkLee <lsy931106@gmail.com>
2018-08-26 17:30:40 +09:00
Sebastiaan van Stijn
41481abdc6
Merge pull request #37674 from Microsoft/jjh/revendor82018
Revendor Microsoft/hcsshim and go-winio, plus container/containerd
2018-08-25 19:54:22 +02:00
Kir Kolyshkin
9f3a343a51 integration-cli: fix TestAttachDetach, rm TestAttachDetachTruncatedID
It looks like the logic of the test became wrong after commit
ae0883c ("Move TestAttachDetach to integration-cli").

The original logic was:
* (a few first steps skipped for clarity)
* send escape sequence to "attach";
* check "attach" is exiting (i.e. escape sequence works);
* check the container is still alive;
* kill the container.

Also, timeouts were big at that time, in the order of seconds.

The logic after the above mentioned commit and until now is:
* ...
* send escape sequence to "attach";
* check the container is running (why shouldn't it?);
* kill the container;
* checks that the "attach" has exited.

So, from the "let's check detach using escape sequence is working"
the test became something like "let's check that attach is gone
once we kill the container".

Let's fix the above test, also increasing the timeout waiting
for attach to exit (which fails from time to time on power CI).

Now, the second test, TestAttachDetachTruncatedID, does the exact
same thing, except it uses a truncated container ID. It does not
seem to be of much value, so let's remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-08-24 14:48:38 -07:00
Taylan Isikdemir
2f81dc358a enable gcplogs driver on windows
Signed-off-by: Taylan Isikdemir <taylani@google.com>
2018-08-23 20:02:04 +00:00
John Howard
5accd82634 Add containerd.WithTimeout(60*time.Second) to match old calls
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-08-23 12:03:43 -07:00
John Howard
2e5222a346 Bump containerd to 3f42445e38d1081f4b8c3b8d7d1ed1860198ed7a
Signed-off-by: John Howard <john.howard@microsoft.com>
2018-08-23 12:03:43 -07:00
John Howard
805211a6e8 Revendor hcsshim and go-winio
Signed-off-by: John Howard <john.howard@microsoft.com>
2018-08-23 12:03:33 -07:00
Vincent Demeester
0d9d86107d
Merge pull request #37695 from thaJeztah/wrap_wrap_wrapper
Use errors.Wrap() in daemon errors, and cleanup messages
2018-08-23 19:36:20 +02:00
Sebastiaan van Stijn
bf95fbc54f
Use errors.Wrap() in daemon errors, and cleanup messages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-23 16:12:44 +02:00
Sebastiaan van Stijn
b384467326
Merge pull request #37696 from estesp/log-error-spelling
Fix incorrect spelling in error message
2018-08-23 12:16:22 +02:00
Sebastiaan van Stijn
d508a4fbc6
Merge pull request #37699 from tiborvass/fix-network-buildkit
builder: fix bridge networking when using buildkit
2018-08-23 12:12:53 +02:00
Tibor Vass
dc7e472db9 builder: fix bridge networking when using buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-08-23 05:20:01 +00:00
Phil Estes
f962bd06ed
Fix incorrect spelling in error message
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-08-22 11:28:11 -04:00
Sebastiaan van Stijn
a0385f7ad7
Merge pull request #37650 from anshulpundir/vndr
Add support for filtering on node labels
2018-08-22 12:51:47 +01:00
Tibor Vass
3ba4f9b221
Merge pull request #37691 from tiborvass/tmp-disable-bridge
builder: temporarily disable bridge networking when using buildkit
2018-08-21 20:41:57 -07:00
Tibor Vass
16084ea8c8 builder: temporarily disable bridge networking when using buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-08-22 03:29:17 +00:00
Tibor Vass
ef50da44b3
Merge pull request #37688 from tiborvass/features-not-flat
Fix logic when enabling buildkit
2018-08-21 18:56:41 -07:00
Tibor Vass
1cc3deebc4
Merge pull request #37684 from thaJeztah/add_remote_api_warning
Add warning if REST API is accessible through an insecure connection
2018-08-21 16:52:37 -07:00
Tibor Vass
c973cde760 Fix logic when enabling buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-08-21 23:49:08 +00:00
Tibor Vass
9972a826c8
Merge pull request #37686 from andrewhsu/bk-no-ex
remove experimental guard for buildkit
2018-08-21 16:43:46 -07:00
Andrew Hsu
01c9e7082e move /session api endpoint out of experimental
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-08-21 22:43:34 +00:00
Andrew Hsu
239047c2d3 remove experimental guard for buildkit
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-08-21 22:19:45 +00:00
Sebastiaan van Stijn
3bd1e7b59b
Merge pull request #37636 from thaJeztah/add_swarm_label_tests
Add unit test for swarm labels on containers
2018-08-21 23:02:46 +01:00
Anshul Pundir
514ce73391
Changes to cluster/filter, swagger.yaml, version-history.md for filtering on node labels.
Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-21 22:17:23 +02:00
Sebastiaan van Stijn
547b993e07
Add warning if REST API is accessible through an insecure connection
The remote API allows full privilege escalation and is equivalent to
having root access on the host. Because of this, the API should never
be accessible through an insecure connection (TCP without TLS, or TCP
without TLS  verification).

Although a warning is already logged on startup if the daemon uses an
insecure configuration, this warning is not very visible (unless someone
decides to read the logs).

This patch attempts to make insecure configuration more visible by sending
back warnings through the API (which will be printed when using `docker info`).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-21 22:03:24 +02:00
Sebastiaan van Stijn
2629fe9326
Merge pull request #37502 from thaJeztah/you_have_been_warned
Add "Warnings" to /info endpoint, and move detection to the daemon
2018-08-21 10:37:27 +01:00
Sebastiaan van Stijn
a3d4238b9c
Add "Warnings" to /info endpoint, and move detection to the daemon
When requesting information about the daemon's configuration through the `/info`
endpoint, missing features (or non-recommended settings) may have to be presented
to the user.

Detecting these situations, and printing warnings currently is handled by the
cli, which results in some complications:

- duplicated effort: each client has to re-implement detection and warnings.
- it's not possible to generate warnings for reasons outside of the information
  returned in the `/info` response.
- cli-side detection has to be updated for new conditions. This means that an
  older cli connecting to a new daemon may not print all warnings (due to
  it not detecting the new conditions)
- some warnings (in particular, warnings about storage-drivers) depend on
  driver-status (`DriverStatus`) information. The format of the information
  returned in this field is not part of the API specification and can change
  over time, resulting in cli-side detection no longer being functional.

This patch adds a new `Warnings` field to the `/info` response. This field is
to return warnings to be presented by the user.

Existing warnings that are currently handled by the CLI are copied to the daemon
as part of this patch; This change is backward-compatible with existing
clients; old client can continue to use the client-side warnings, whereas new
clients can skip client-side detection, and print warnings that are returned by
the daemon.

Example response with this patch applied;

```bash
curl --unix-socket /var/run/docker.sock http://localhost/info | jq .Warnings
```

```json
[
  "WARNING: bridge-nf-call-iptables is disabled",
  "WARNING: bridge-nf-call-ip6tables is disabled"
]
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-21 11:36:15 +02:00
Vincent Demeester
969adfc647
Merge pull request #37679 from Microsoft/jjh/disable-rs5-failing-test
Disable TestExecWindowsOpenHandles on RS5 temporarily
2018-08-21 11:35:47 +02:00
John Howard
15a25f6eb9 Disable TestExecWindowsOpenHandles on RS5 temporarily
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-08-20 19:48:20 -07:00