Commit Graph

1904 Commits

Author SHA1 Message Date
a683195dbd Merge pull request #21726 from aaronlehmann/tarsum-filename-normalization
Fix build cache false positives when build context tar contains unnormalized paths
Upstream-commit: 1a14bbc61e35fd2ca412e07fa6c456095756f892
Component: engine
2016-04-15 09:45:26 -07:00
b1c3afb97e Fix build cache false positives when build context tar contains unnormalized paths
If a build context tar has path names of the form 'x/./y', they will be
stored in this unnormalized form internally by tarsum. When the builder
walks the untarred directory tree and queries hashes for each relative
path, it will query paths of the form 'x/y', and they will not be found.

To correct this, have tarsum normalize path names by calling Clean.

Add a test to detect this caching false positive.

Fixes #21715

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 8691a77e441996fef96019b94f299a11b7244080
Component: engine
2016-04-14 17:57:45 -07:00
f4871ac76e Fix panic on winsize syscall
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4d4ef98326f0b21bbb661321499e200a1412bc64
Component: engine
2016-04-13 17:08:00 -07:00
e1986078c7 Merge pull request #21897 from calavera/remove_authorization_refs_from_api
Move middleware to interfaces.
Upstream-commit: 9438572fc00f928ec83c884992d5492a7a68babb
Component: engine
2016-04-12 14:08:36 -07:00
b1684f92ee pkg: listeners: move Docker-specific semantics to docker/daemon*
Since there are other users of pkg/listeners, it doesn't make sense to
contain Docker-specific semantics and warnings inside it. To that end,
move the scary warning about -tlsverify and the libnetwork port
allocation code to CmdDaemon (where they belong). This helps massively
reduce the dependency tree for users of pkg/listeners.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 5ee0a94101c30a4ac22379fdab50c0faad2d12c9
Component: engine
2016-04-12 12:50:43 +10:00
8194e834c4 Move middleware to interfaces.
This makes separating middlewares from the core api easier.
As an example, the authorization middleware is moved to
it's own package.

Initialize all static middlewares when the server is created, reducing
allocations every time a route is wrapper with the middlewares.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 8d3467626ee26cad48ad84f2181552dce7afccb6
Component: engine
2016-04-11 09:19:27 -07:00
6009e3b566 Merge pull request #21906 from allencloud/fix-typos-pkg
fix typos in pkg
Upstream-commit: 417fce0b77d21d8481c6e8b0cad6cb25c6da7bb8
Component: engine
2016-04-09 18:50:42 +02:00
f4582c23f4 fix typos in pkg
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: aef02273d9cdf8144b95c9c9a8d1e119d24b2d9d
Component: engine
2016-04-09 21:18:15 +08:00
1946302b86 fix typo in comment
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 76122f95e9173c1182b8dd44e1aa236a045d4e6a
Component: engine
2016-04-08 00:05:31 -07:00
ffc19b3fb1 pkg/archive: use more narrow interface for CompressStream
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 9b2c3aa8946eee15e5938f03c2202b16a7f22875
Component: engine
2016-04-07 13:21:05 -07:00
a30f33e6a5 Merge pull request #21840 from tonistiigi/fix-closing-attach-streams
Fix closing attach streams on lost tcp connection
Upstream-commit: 4f8a6f3e02135ade04d31b493ed08af4b308b9e0
Component: engine
2016-04-07 12:02:33 -04:00
82647f4d8c Merge pull request #21820 from estesp/lazy-init-useradd
Lazy init useradd and remove init()
Upstream-commit: d5dfc4e5262a56181b2203c3fb6474ebe3a4ae92
Component: engine
2016-04-07 10:09:02 +02:00
4b68403613 Fix closing attach streams on lost tcp connection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a47cd639158ee9cfd228c0ae8257301b8510f3ad
Component: engine
2016-04-06 21:27:47 -07:00
3ff2903f19 Lazy init useradd and remove init()
This should not have been in init() as it causes these lookups to happen
in all reexecs of the Docker binary. The only time it needs to be
resolved is when a user is added, which is extremely rare.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: c6f45fd2eef00d6dcdcf319400c0c6cd891e9d2a
Component: engine
2016-04-06 17:53:45 -04:00
9f10b4351a Windows: Remove TP4 support from main code
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 331c8a86d489e573fcbf1df3c4f813bbc3168624
Component: engine
2016-04-06 12:12:20 -07:00
5c35f01162 Merge pull request #21272 from Microsoft/jstarks/manifest_updates
Add os_version and os_features to Image
Upstream-commit: fc9912fd00f5e12a6f0904f3c758275724ba3318
Component: engine
2016-04-05 16:16:25 -07:00
9344bce56a Merge pull request #21755 from cpuguy83/bytespipe_allocs
Improve performance/reduce allocs of bytespipe
Upstream-commit: 806a8e22b96900bc1db5541d316c1cd91c493bea
Component: engine
2016-04-05 14:43:57 -07:00
933477cfba Improve performance/reduce allocs of bytespipe
Creates a `fixedBuffer` type that is used to encapsulate functionality
for reading/writing from the underlying byte slices.

Uses lazily-loaded set of sync.Pools for storing buffers that are no
longer needed so they can be re-used.

```
benchmark                     old ns/op     new ns/op     delta
BenchmarkBytesPipeWrite-8     138469        48985         -64.62%
BenchmarkBytesPipeRead-8      130922        56601         -56.77%

benchmark                     old allocs     new allocs     delta
BenchmarkBytesPipeWrite-8     18             8              -55.56%
BenchmarkBytesPipeRead-8      0              0              +0.00%

benchmark                     old bytes     new bytes     delta
BenchmarkBytesPipeWrite-8     66903         1649          -97.54%
BenchmarkBytesPipeRead-8      0             1             +Inf%
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9a25b1d942da88439ec04797ff6f1c33c3b5562d
Component: engine
2016-04-05 13:06:04 -04:00
a1bd3ee5e1 Fix spelling error in names-generator.go
Signed-off-by: Lars Butler <Lars.Butler@gmail.com>
Upstream-commit: 0cad90911f8b9fab9b9acc940b5759ee1939306e
Component: engine
2016-04-05 12:34:52 +02:00
4815437b5f Add os_version and os_features to Image
These fields are needed to specify the exact version of Windows that an
image can run on. They may be useful for other platforms in the future.

This also changes image.store.Create to validate that the loaded image is
supported on the current machine. This change affects Linux as well, since
it now validates the architecture and OS fields.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 194eaa5c0f843257e66b68bd735786308a9d93b2
Component: engine
2016-04-04 13:14:57 -07:00
afcd43b3c8 pkg: listeners: clean up to act like a library
Now that listeners is no longer an internal of the client, make it less
Docker-specific (despite there still being some open questions as how to
deal with some of the warnings that listeners has to emit). We should
move as much of the Docker-specific stuff (especially the port
allocation) to docker/ where it belongs (or maybe pass a check function).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 619bf56778c55813c7c9dc81052ee4a277bfd22a
Component: engine
2016-04-02 01:09:29 +11:00
7a120b5566 pkg: listeners: separate out the listeners package
This code will be used in containerd and is quite useful in general to
people who want a nice way of creating listeners from proto://address
arguments (even supporting socket activation). Separate it out from
docker/ so people can use it much more easily.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: e3a8c8388f8c6f1f67204cdd16b7b685fadda6c3
Component: engine
2016-04-02 01:09:29 +11:00
b3c7f3a3f2 Merge pull request #21694 from LK4D4/remove_unused_pkg
pkg: cleanup some unused code
Upstream-commit: ad4750cf3a1c89f0b9d2ccebdc4f61b7be33109f
Component: engine
2016-03-31 15:06:35 -07:00
7c3f3d665e pkg: cleanup some unused code
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 07b568cb5342789839aabba0ee6d41e7275099e8
Component: engine
2016-03-31 11:39:59 -07:00
ebeaecd7ff Merge pull request #21356 from cpuguy83/stdcopy_allocs
Optimizations for StdWriter
Upstream-commit: 2d18ed7e4b911ae61131fa7f3dedb0fae1d1ae3b
Component: engine
2016-03-31 10:54:45 -07:00
7ad3abac63 Merge pull request #21251 from cyphar/refactor-copyonbuild
pkg: archive: don't fail Untar if xattrs are not supported
Upstream-commit: 553edd1d19193a1413515fdf3807a6136c4fc0a6
Component: engine
2016-03-28 16:15:18 -07:00
e155de707d Fix misspellings
Signed-off-by: Dmitri Logvinenko <dmitri.logvinenko@gmail.com>
Upstream-commit: 6dede879fd8e0c5f599631d125753d360ead3bc0
Component: engine
2016-03-28 16:21:02 +03:00
8a8affba81 Optimizations for StdWriter
Avoids allocations and copying by using a buffer pool for intermediate
writes.

```
benchmark            old ns/op     new ns/op     delta
BenchmarkWrite-8     996           175           -82.43%

benchmark            old MB/s     new MB/s     speedup
BenchmarkWrite-8     4414.48      25069.46     5.68x

benchmark            old allocs     new allocs     delta
BenchmarkWrite-8     2              0              -100.00%

benchmark            old bytes     new bytes     delta
BenchmarkWrite-8     4616          0             -100.00%
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 2f3b6022858aab2d70e380d126e6dcec227c0d38
Component: engine
2016-03-25 22:14:27 -04:00
3ff2e53880 Windows: Native console disableNewlineAutoReturn
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: c162cdb15fb08786c85d76fb438f003e72857f5c
Component: engine
2016-03-24 15:37:47 -07:00
3420db4b5e Fix panic in loading plugins
When a plugin is first found, it is loaded into the available plugins
even though it's not activated yet.
If activation fails it is taken out of the list.
While it is in the list, other callers may see it and try to check it's
manifest. If it is not fully activated yet, the manifest will be nil and
cause a panic.

This is especially problematic for drivers that are down and have not
been activated yet.

We could just not load the plugin into the available list until it's
fully active, however that will just cause multiple of the same plugin
to attemp to be loaded.

We could check if the manifest is nil and return early (instead of
panicing on a nil manifest), but this will cause a 2nd caller to receive
a response while the first caller is still waiting, which can be
awkward.

This change uses a condition variable to handle activation (instead of
sync.Once). If the plugin is not activated, callers will all wait until
it is activated and receive a broadcast from the condition variable
signaling that it's ok to proceed, in which case we'll check if their
was an error in activation and proceed accordingly.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: baac2f48674d42863f9fdca5ef3056b4c6ed707e
Component: engine
2016-03-23 15:34:15 -04:00
c6a8dec47c pkg: archive: don't fail Untar if xattrs are not supported
Since certain filesystems don't support extended attributes, ignore
errors produced (emitting a warning) when attempting to apply extended
attributes to file.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 75a271603c761c18c7deb186d08943dcf85b739d
Component: engine
2016-03-24 02:05:36 +11:00
4ffd819c8f Windows: Fix mountinfo
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: bb68b666c51eb145a4376c239878d1d985afe01e
Component: engine
2016-03-21 22:03:24 -07:00
5fe3bfd34f Merge pull request #21333 from cpuguy83/sigpipe
Don't forward SIGPIPE from client to container
Upstream-commit: 5008a34072e55f7df87774a5e7beca979718c3c2
Component: engine
2016-03-21 15:09:13 +01:00
20351391ce Merge pull request #21274 from jfrazelle/fix-variables-that-werent-being-used
fix variables that werent being called
Upstream-commit: b77573f48e4022c7b8b829c4a33c6963fe08e18a
Component: engine
2016-03-18 18:03:15 -07:00
b070967d75 Merge pull request #21325 from frenkel/openbsd-support
Support OpenBSD build
Upstream-commit: 131c59193f16d1f752103f97302546ec819cb6f7
Component: engine
2016-03-18 20:53:17 -04:00
c955c9e289 Don't forward SIGPIPE from client to container
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 81707de23ff6d0b03bd8d5cda87efac7939d9d46
Component: engine
2016-03-18 16:50:18 -04:00
8ba16d91c8 Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 9c4570a958df42d1ad19364b1a8da55b891d850a
Component: engine
2016-03-18 13:38:32 -07:00
8d2c6b65a8 Cli binary can now be build on OpenBSD
Signed-off-by: Frank Groeneveld <frank@frankgroeneveld.nl>
Upstream-commit: 719a43ca3530c424c3875d8c066f7ab09195dfdc
Component: engine
2016-03-18 14:56:21 +01:00
ae0977f1d1 fix variables that werent being called
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 0e025b4bb16c0d4cc6b3f0c040713d061b9b051a
Component: engine
2016-03-17 13:19:55 -07:00
4d8c3b87c5 Merge pull request #21266 from estesp/dockremap-system-user
Change subordinate range-owning user to be a system user
Upstream-commit: 41c1c6501e53698961cfdcab47eb5ab37ede667b
Component: engine
2016-03-17 11:42:15 -07:00
24be9013fa pkg: truncindex: provide more info in error
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: ae1002219bc5d602c552ba952bc45e440cf3aae7
Component: engine
2016-03-17 15:53:12 +01:00
218e901de7 Change subordinate range-owning user to be a system user
Change user/group creation to use flags to adduser/useradd to enforce it
being a system user. Use system user defaults that auto-create a
matching group. These changes allow us to remove all group creation
code, and in doing so we also removed the code that finds available uid,
gid integers and use post-creation query to gather the system-generated
uid and gid.

The only added complexity is that today distros don't auto-create
subordinate ID ranges for a new ID if it is a system ID, so we now need
to handle finding a free range and then calling the `usermod` tool to
add the ranges for that ID. Note that this requires the distro supports
the `-v` and `-w` flags on `usermod` for subordinate ID range additions.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: c18e7f3a0419e35aeab4eefa51f3c17fbd72381f
Component: engine
2016-03-16 18:44:10 -04:00
195d725261 *: fix response body leaks
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: f0d83c4cdb49adb53fdaf4216a4395c23d5cc8e9
Component: engine
2016-03-16 17:15:42 +01:00
6f209e48d5 Remove flush(stdout) in pkg/chrootarchive/diff_unix.go and improve error reporting of flush() to fix #21103
pkg/chrootarchive/diff_unix.go erroneously calls flush on stdout, which tries to read from stdout returning an error.
This has been fixed by removing the call and by modifying flush to return errors and checking for these errors on calls to flush.

Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
Upstream-commit: a9c61691389ed373ada399d25f55a9d10405b4ea
Component: engine
2016-03-15 10:29:51 -07:00
8a5b6da14b Merge pull request #21162 from estesp/copyastar-dir-create
Fix CopyWithTar creation of new destination dir as remapped root
Upstream-commit: 6f2d8b411eaaa6b4ea2a46e5164325450259573b
Component: engine
2016-03-15 10:26:30 -07:00
fab87296b0 Fix flaky test TestJSONFormatProgress (#21124)
In TestJSONFormatProgress, the progress string was used for comparison.
However, the progress string (progress.String()) uses time.Now().UTC()
to generate the timeLeftBox which is not a fixed value and cannot be
compared reliably.

This PR fixes the issue by stripping the timeLeftBox field before doing
the comparison.

This PR fixes #21124.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d17bb23ae6efba6e76e7a56b856705400e26a61b
Component: engine
2016-03-14 16:00:12 +00:00
96d657135e Fix CopyWithTar creation of new destination dir as remapped root
If the destination does not exist, it needs to be created with ownership
mapping to the remapped uid/gid ranges if user namespaces are enabled.
This fixes ADD operations, similar to the prior fixes for COPY and WORKDIR.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 06d95003b3ddd22d26121280d645e48582a4f931
Component: engine
2016-03-12 23:05:45 -05:00
1585d5df26 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: bbeb859b6490a03d7c4265762711b551c22e914d
Component: engine
2016-03-11 23:22:16 +08:00
de84e87a00 pids limit support
update bash commpletion for pids limit

update check config for kernel

add docs for pids limit

add pids stats

add stats to docker client

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 69cf03700fed7bf5eb7fe00c9214737e21478e49
Component: engine
2016-03-08 07:55:01 -08:00
a3ffabb772 Merge pull request #20843 from calavera/plugin_any_transport
Call plugins with custom transports.
Upstream-commit: c08b674d56c37782fc26382f4b756e0518e394cf
Component: engine
2016-03-04 11:59:32 -05:00