Commit Graph

4668 Commits

Author SHA1 Message Date
a00f1ffcd6 Merge pull request #32874 from cpuguy83/metrics_plugins
Add support for metrics plugins
Upstream-commit: 680084b2a2eb1ac1ced2dd4c695fdc469c25dc7f
Component: engine
2017-05-12 15:44:34 -07:00
d7fd55d70a Merge pull request #32993 from cyli/root-rotation-cli
API changes to rotate swarm root CA
Upstream-commit: eb8abc95985bf3882a4a177c409a96e36e25f5b7
Component: engine
2017-05-12 10:12:32 -07:00
e9abb077b7 Add support for metrics plugins
Allows for a plugin type that can be used to scrape metrics.
This is useful because metrics are not neccessarily at a standard
location... `--metrics-addr` must be set, and must currently be a TCP
socket.
Even if metrics are done via a unix socket, there's no guarentee where
the socket may be located on the system, making bind-mounting such a
socket into a container difficult (and racey, failure-prone on daemon
restart).

Metrics plugins side-step this issue by always listening on a unix
socket and then bind-mounting that into a known path in the plugin
container.

Note there has been similar work in the past (and ultimately punted at
the time) for consistent access to the Docker API from within a
container.

Why not add metrics to the Docker API and just provide a plugin with
access to the Docker API? Certainly this can be useful, but gives a lot
of control/access to a plugin that may only need the metrics. We can
look at supporting API plugins separately for this reason.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0e8e8f0f318656be80e34db9b5e390ffeef3fd0d
Component: engine
2017-05-12 00:30:09 -04:00
887d3ac7d1 Merge pull request #33108 from justincormack/revert-seccomp-sockets
Revert "Block obsolete socket families in the default seccomp profile"
Upstream-commit: 33ebf32cb0d0b865d002e8afd0c35b6474f04eb6
Component: engine
2017-05-12 00:30:08 +02:00
cb58c9e54e Merge pull request #32336 from aaronlehmann/configs
Configuration files for services
Upstream-commit: 69c35dad8e7ec21de32d42b9dd606d3416ae1566
Component: engine
2017-05-11 13:25:40 -07:00
8d785cac10 Merge pull request #32587 from dmcgowan/trust-key-config
Expose trust key path in config
Upstream-commit: 577168700200e8e993b2692ef87e05a67783a08c
Component: engine
2017-05-11 21:03:47 +02:00
4b2490c791 Add API test to rotate the swarm CA certificate
Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: 376c75d13cedd22c578197a140ffc10e27e84d01
Component: engine
2017-05-11 11:13:14 -07:00
53e0ae35b8 Add integration test coverage for configs
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: d2c5b6ee9f5240e23aa9fa0f374b89a9726d2200
Component: engine
2017-05-11 10:18:44 -07:00
2c6473821e Merge pull request #33054 from dnephin/refactor-builder-named-contexts-interface
[Builder] Expose GetImage interface for builder
Upstream-commit: 974cec945b80bc0004f3917ec318c15e9c038e4a
Component: engine
2017-05-11 11:03:30 -04:00
cfa3cb0b21 Merge pull request #32906 from fcrisciani/init_race_cond
Race condition fix for swarm join/leave
Upstream-commit: 77d5a0996f0e007330424ea4740e908fd887cf37
Component: engine
2017-05-11 05:18:40 -07:00
eaff058a53 Fix race condition between swarm and libnetwork
This commit in conjunction with a libnetwork side commit,
cleans up the libnetwork SetClusterProvider logic interaction.
The previous code was inducing libnetwork to spawn several go
routines that were racing between each other during the agent
init and close.

A test got added to verify that back to back swarm init and leave
are properly processed and not raise crashes

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: e2ec006797fa14f59bcf7b9c23505ccdf1d3ded3
Component: engine
2017-05-10 21:16:52 -07:00
3bffce1905 fix tests after CLI update
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 73e2f55543346b285585f350e53f82ae419f8849
Component: engine
2017-05-10 20:09:50 -04:00
c1ba295763 Merge pull request #32875 from cyli/root-ca-info-in-api
Propagate TLS Info in swarm info and node info REST endpoints
Upstream-commit: f02a5b50c407bdb087388e18e1ac619f2788dd8d
Component: engine
2017-05-11 00:35:46 +02:00
01b4a22798 Refactor interaction between dispatcher.from and dispatchState
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: ab3a037a5b77220d0524ce2b17105e1daae39425
Component: engine
2017-05-10 17:58:57 -04:00
6481987490 Expose trust key path in config
Allows storing key under any directory. In the case where the
"/etc/docker" directory is not preserved, this file can be
specified to a location where it will be preserved to ensure
the ID does not change across restarts.

Note this key is currently only used today to generate the ID
used in Docker info and for manifest schema v1 pushes. The key
signature and finger on these manifests are not checked or
used any longer for security, deprecated by notary.

Removes old key migration from a pre-release of Docker which put
the key under the home directory and was used to preserve ID used
for swarm v1 after the file moved.

closes #32135

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: e428c824c35e85a02fffee592b79ab7db1a0c4d2
Component: engine
2017-05-10 14:16:27 -07:00
2bc4204935 Propagate the swarm cluster and node TLS info provided by the swarm
objects into the REST API responses.  In the CLI, display only
whether the nodes' TLS info matches the cluster's TLS info, or
whether the node needs cert rotation.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: 64cccedbce86542fc9289ad9cca1dd758f2f21c2
Component: engine
2017-05-10 11:29:17 -07:00
68f498df11 Extend test coverage of secrets
Actually look inside the container to see if the secret data is present
and correct. Test absolute paths, relative paths, and just a basename.
Test the scenario where a service references the same secret under
different targets.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 0da7bd0314a61919428fe036660b822b0bf22d35
Component: engine
2017-05-10 10:23:10 -07:00
4764bfe1f6 support custom paths for secrets
This adds support to specify custom container paths for secrets.

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 67d282a5c95ca1d25cd4e9c688e89191f662d448
Component: engine
2017-05-10 10:23:07 -07:00
25ad1db09f Merge pull request #32909 from cpuguy83/32907_volume_unmount_on_cp
Add refcount for MountPoint
Upstream-commit: 09ff5ce29c82b6c97123b24855e1ef11e860b47a
Component: engine
2017-05-09 20:15:41 +02:00
c7bf74a6ab Revert "Block obsolete socket families in the default seccomp profile"
This reverts commit 7e3a596a63fd8d0ab958132901b6ded81f8b44c0.

Unfortunately, it was pointed out in https://github.com/moby/moby/pull/29076#commitcomment-21831387
that the `socketcall` syscall takes a pointer to a struct so it is not possible to
use seccomp profiles to filter it. This means these cannot be blocked as you can
use `socketcall` to call them regardless, as we currently allow 32 bit syscalls.

Users who wish to block these should use a seccomp profile that blocks all
32 bit syscalls and then just block the non socketcall versions.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: dcf2632945b87acedeea989a5aa36c084a20ae88
Component: engine
2017-05-09 14:26:00 +01:00
53d1a4eb83 Merge pull request #33007 from crosbymichael/containerd-rc5
Update moby to containerd and runc 1.0 final rc
Upstream-commit: 7238cca42c3d024adfa030306ad3e3ec4232baed
Component: engine
2017-05-08 09:23:07 -07:00
440d8b67e7 Merge pull request #33006 from dperny/service-logs-fix-hanging-logs-removed-containers-no-wait
Fix an issue with service logs hanging
Upstream-commit: 7ca86796c94c7ae0c62680ac664f97ab5f35ebec
Component: engine
2017-05-05 15:16:13 -07:00
ce61a3d4f2 Update moby to runc and oci 1.0 runtime final rc
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 005506d36c1c9308a05592d7596f3d484359c426
Component: engine
2017-05-05 13:45:45 -07:00
d0052ddc0d fix expected output in tests
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f47a61c42957c0a98944a0723b3807aa4d07ed8e
Component: engine
2017-05-05 12:14:30 -07:00
a8b3ac7249 Remove cmd/docker and other directories in cli/ in accordance with the new Moby project scope
Starting with this commit, integration tests should no longer rely on
the docker cli, they should be API tests instead. For the existing tests
the scripts will use a frozen version of the docker cli with a
DOCKER_API_VERSION frozen to 1.30, which should ensure that the CI remains
green at all times.

To help contributors develop and test manually with a modified docker
cli, this commit also adds a DOCKER_CLI_PATH environment variable to the
Makefile. This allows to set the path of a custom cli that will be
available inside the development container and used to run the
integration tests.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 32915b1d0a315598edb737785d0357b5a1b8aa11
Component: engine
2017-05-05 12:14:29 -07:00
bd17f42bef Add docker build --iidfile=FILE
This is synonymous with `docker run --cidfile=FILE` and writes the digest of
the newly built image to the named file. This is intended to be used by build
systems which want to avoid tagging (perhaps because they are in CI or
otherwise want to avoid fixed names which can clash) by enabling e.g. Makefile
constructs like:

    image.id: Dockerfile
    	docker build --iidfile=image.id .

    do-some-more-stuff: image.id
    	do-stuff-with <image.id

Currently the only way to achieve this is to use `docker build -q` and capture
the stdout, but at the expense of losing the build output.

In non-silent mode (without `-q`) with API >= v1.29 the caller will now see a
`JSONMessage` with the `Aux` field containing a `types.BuildResult` in the
output stream for each image/layer produced during the build, with the final
one being the end product.  Having all of the intermediate images might be
interesting in some cases.

In silent mode (with `-q`) there is no change, on success the only output will
be the resulting image digest as it was previosuly.

There was no wrapper to just output an Aux section without enclosing it in a
Progress, so add one here.

Added some tests to integration cli tests.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Upstream-commit: 5894bc1abf8186802d360d20739b57bfffed51df
Component: engine
2017-05-05 16:35:54 +01:00
06646a47aa Fix an issue with service logs hanging
Fixed an issue where service logs would hang if the container backing a
task was deleted by not waiting for containers to be ready if we're not
following logs.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 80c3ec027d9fd4f7ea2080adc08fc741f8909b2e
Component: engine
2017-05-04 12:13:14 -07:00
d3da06632a Fix run with entrypoint in base image
Update a test to use a base image with entrypoint to that the linux build
has at least one test that behaves like all the windows tests.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d9371ee80764d0eecf7b8a562121f0a6234167a3
Component: engine
2017-05-03 10:59:38 -04:00
8e846811d4 Remove ContainerUpdateCmdOnBuild, it does nothing.
Set a blank entrypoint to preserve the old behaviour.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 97f860716497f6f75236b72e4af90e01afad832c
Component: engine
2017-05-03 10:59:38 -04:00
dbcc3f98b6 Cleanup all the mutate + defer revert of b.runConfig in the builder
Instead of mutating and reverting, just create a copy and pass the copy
around.

Add a unit test for builder dispatcher.run

Fix two test failures

Fix image history by adding a CreatedBy to commit options. Previously the
createdBy field was being created by modifying a reference to the runConfig that
was held from when the container was created.

Fix a test that expected a trailing slash. Previously the runConfig was being
modified by container create. Now that we're creating a copy of runConfig
instead of sharing a reference the runConfig retains the trailing slash.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9f738cc574d50d0a2accdf6f6deb30405c24a80c
Component: engine
2017-05-01 18:36:53 -04:00
ce01ee60c2 Add refcount for MountPoint
This makes sure that multiple users of MountPoint pointer can
mount/unmount without affecting each other.

Before this PR, if you run a container (stay running), then do `docker
cp`, when the `docker cp` is done the MountPoint is mutated such that
when the container stops the volume driver will not get an Unmount
request. Effectively there would be two mounts with only one unmount.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: df0d317a64e4a74433359e826bc1d606e050a5ed
Component: engine
2017-04-28 16:01:25 -04:00
5d06c101d8 Fix cache miss when builtin build args are used.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 721e1736ae31914902d2c2196aed5f92e1a0982d
Component: engine
2017-04-28 12:49:50 -04:00
8a2cc25685 Merge pull request #32828 from cyli/external-ca-cert
Add the `CACert` parameter to the `ExternalCA` object
Upstream-commit: 25058d9b0c1414a0c7fa1aef5dd1766aaf2e1c30
Component: engine
2017-04-28 10:30:57 -04:00
9f6af10310 Merge pull request #32763 from dave-tucker/fix-32744
builder: Make builtin arg pruning work with > 1 arg
Upstream-commit: 9f0ebea33579b1c6cec8ae445ac3b21655aa3bcd
Component: engine
2017-04-28 10:24:13 -04:00
b5c88cd04e Merge pull request #32504 from dongluochen/healthcheck_duration
do not allow duration less than 1 ms in healthcheck parameters
Upstream-commit: a7519152d9be7a0dd6941d529ea4b83cf4b7f1d4
Component: engine
2017-04-27 23:54:00 -04:00
1824504fe7 Ensure unmount before removing local volume.
When there is an error unmounting a local volume, it is still possible
to call `Remove()` on the volume causing removal of the mounted
resources which is generally not desirable.

This ensures that resources are unmounted before attempting removal.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: db3576f8a08ca70287bd3fdf9b21e162537f9d3a
Component: engine
2017-04-27 16:41:03 -04:00
0fd96c2554 Merge pull request #32717 from fcrisciani/data_path
Data path traffic separation option in swarm mode
Upstream-commit: 0307fe1a0bcdc02583a24add41eb783c117bad8c
Component: engine
2017-04-27 13:00:55 -04:00
3b753edcdd Merge pull request #31984 from tonistiigi/remote-context
builder: Refactor remote context
Upstream-commit: ae0f8c7ba16362e869894e0121cf3052069d7fe4
Component: engine
2017-04-27 11:50:18 -04:00
e7900cc574 Merge pull request #31557 from ripcurld0/add_stack_ls
Add the format option to the docker stack ls command
Upstream-commit: 6559abaf477352dc03725a70c85d0ea9c8d5974e
Component: engine
2017-04-26 19:13:33 -07:00
17438d5f4c Inroduce SWARM --data-path-addr flag
This new flag will allow the configuration of an interface that
can be used for data path traffic to be isolated from control
plane traffic. This flag is simply percolated down to libnetwork
and will be used by all the global scope drivers (today overlay)

Negative test added for invalid flag arguments

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 8dc8cd4719f165c01c98e7d3ce1d6cea6a8f60b8
Component: engine
2017-04-26 15:33:15 -07:00
bffd287a59 Add the CACert parameter to the ExternalCA object in order to match
swarmkit's API type.  Make sure this parameter gets propagated to
swarmkit, and also add an extra option to the CLI when providing
external CAs to parse the CA cert from a file.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: b0401a71f7479a52b2670346e0d1e97cb68089a4
Component: engine
2017-04-26 10:45:12 -07:00
59446e4411 Merge pull request #32824 from aaronlehmann/raftquorum-test-bug
Fix incorrect assumption in TestAPISwarmRaftQuorum
Upstream-commit: 4480e0417eb01caf29ae285880ec51a0180faf7f
Component: engine
2017-04-26 15:14:50 +02:00
619e402989 builder: Make builtin arg pruning work with > 1 arg
The previous implementation would error out with "Unexpected EOF" which
was caused by an underlying "array index out-of-bounds" error.
The root cause was deleting items from the same array that was being
iterated over. The iteration was unaware that the array size had
changed, resulting in an error.

The new implementation builds a new array instead of mutating a copy of
the old one.

Fixes: #32744

Signed-off-by: Dave Tucker <dt@docker.com>
Upstream-commit: 1076ab58ec92637a1a157d8dfbb7625d7bba6c40
Component: engine
2017-04-26 10:24:58 +01:00
580f2ecac8 Merge pull request #32540 from cpuguy83/add_logdrivers_to_info
Add logdrivers to /info
Upstream-commit: e8abe0a69d0d6838412a63d7170b9b92877ec3a2
Component: engine
2017-04-25 23:25:30 -05:00
aadacb3d07 Refactor remote context parsing
Redefine a better interface for remote context dependency.

Separate Dockerfile build instruction from remote context.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: d1faf3df27207af111daf4bd0191478c374dbc55
Component: engine
2017-04-25 14:35:31 -07:00
e245f3021a Fix incorrect assumption in TestAPISwarmRaftQuorum
This test shuts down two out of three managers and then asserts that the
swarm has a leader. A swarm that lost quorum won't necessarily have a
leader, and in this case only has one because the old leader is still
around. Soon SwarmKit will be changed so the leader gives up leadership
when quorum is lost. This will avoid confusing situations, like
read-only APIs succeeding, while ones that write to Raft hang.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: c27603238c5493909ec9b657b342b67b23e615e3
Component: engine
2017-04-25 12:10:12 -07:00
76d9eb02b7 Add format to docker stack ls
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 205ec49de9c4f4abb8023d1ad36fdbc92e7ec294
Component: engine
2017-04-25 16:45:30 +03:00
7e9b6e3ca4 Change builder.dispatchers to use a dispatchRequest object
This change starts the process of splitting up the Builder into logical
components. Remove builder.flags and move it to the new dispatchRequest
object.

Use runConfig from dispatchRequest instead of from the builder.

More progress removing things from the Builder struct.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e59327aaac338bd350746e0e6479489f21a0a1fa
Component: engine
2017-04-24 14:21:19 -04:00
87a3307749 Merge pull request #32740 from vdemeester/integration-trusted-cmd-cli
Use `cli` for trusted related command
Upstream-commit: 83ee902ecc3790c33c1e2d87334074436056bb49
Component: engine
2017-04-22 14:51:12 -07:00
f5ac07a8d7 [integration] Move fakegit to its own package in cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a582d9dc42abd96bd88197939e082a1ea3c938a7
Component: engine
2017-04-19 15:52:03 +02:00