Commit Graph

61 Commits

Author SHA1 Message Date
38849b2667 Moves graphdriver plugn docs out of experimental
Also updates some of the structures being sent so plugins are getting
all the new options.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 677fa03654886ee776ff478c30681d5376cfc196
Component: engine
2016-12-22 15:30:25 -05:00
bdb282b28d Fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: c8c7a3ff2112a1b17a06fc02633ed7b49a8aebf3
Component: engine
2016-11-30 03:01:32 +08:00
98fb763827 Move CreateRWLayer() parameters in a struct
Move some of the optional parameters of CreateRWLayer() in a struct
called CreateRWLayerOpts. This will make it easy to add more options
arguments without having to change signature of CreateRWLayer().

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: f7f3d34210fd8d25a929c6b9048e74e7ee40a558
Component: engine
2016-11-16 16:31:23 -05:00
459e915b2e Pass all graphdriver create() parameters in a struct
This allows for easy extension of adding more parameters to existing
parameters list. Otherwise adding a single parameter changes code
at so many places.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: b937aa8e6968d805527d163e6f477d496ceb88d7
Component: engine
2016-11-09 15:59:58 -05:00
fb8fd8dbba Merge pull request #28006 from dmcgowan/clean-overlay2-layerstore
Cleanup invalid code in overlay2 and layer store
Upstream-commit: 1f4137857f6eb8edcbefe591e1abe04d83da3416
Component: engine
2016-11-02 23:16:38 -07:00
94f5e97be8 Cleanup invalid code in overlay2 and layer store
The overlay2 change ensures that the correct path is used to resolve the
symlink. The current code will not fail since the symlinks are always given
a value of "../id/diff" which ends up ignoring the incorrect "link" value.
Fix this code so it doesn't cause unexpected errors in the future if the
symlink changes.

The layerstore cleanup ensures that the empty layer returns a tar stream if
the provided parent is empty. Any value other than empty still returns an
error since the empty layer has no parent. Currently empty layer is not
used anywhere that TarStreamFrom is used but could break in the future if
this function is called.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 6622cc970e27a7bf2798d751ed276265a3a2d404
Component: engine
2016-11-02 16:13:53 -07:00
4bfee6fd15 Remove TarStreamFrom from RWLayer interface
RWLayers do not implement the tar stream from, moved the
definition to Layer instead of TarStreamer

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 8625d25351df680a0571c906ea0b59bf8092e0c6
Component: engine
2016-11-01 14:44:27 -07:00
c7c95dc226 Adds ability to squash image after build
Allow built images to be squash to scratch.
Squashing does not destroy any images or layers, and preserves the
build cache.

Introduce a new CLI argument --squash to docker build
Introduce a new param to the build API endpoint `squash`

Once the build is complete, docker creates a new image loading the diffs
from each layer into a single new layer and references all the parent's
layers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 362369b4bbea38881402d281ee2015d16e8b10ce
Component: engine
2016-11-01 13:41:59 -04:00
fe1dce6a91 pkg/archive: remove unnecessary Archive and Reader type
The `archive` package defines aliases for `io.ReadCloser` and
`io.Reader`. These don't seem to provide an benefit other than type
decoration. Per this change, several unnecessary type cases were
removed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: aa2cc18745cbe0231c33782f0fa764f657e3fb88
Component: engine
2016-10-20 19:31:24 -07:00
effa6f4094 Update plugingetter import path in docker/docker.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: a98be0344b24d71235c17a87ff425f3d602e48e8
Component: engine
2016-10-11 11:24:18 -07:00
c643e4b3fd Add Map() method to LayerStore interface
This method return a map associating a chain ID to its layer object

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 148aef9199ef0af6d03ea53e616c9fbd23b7c5ec
Component: engine
2016-09-29 07:42:53 -07:00
952f960124 layer_store: Use CreateReadWrite() for -init layer instead of Create()
init layer is read/write layer and not read only layer. Following commit
introduced new graph driver method CreateReadWrite.

ef5bfad Adding readOnly parameter to graphdriver Create method

So far only windows seem to be differentiating between above two methods.
Making this change to make sure -init layer calls right method so that
we don't have surprises in future.

Windows does not need init layer. This patch also gets rid of creation of
init layer on windows.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 2508ca000e79dfe1a956b0078a0d196dd6b66dab
Component: engine
2016-09-21 14:45:25 -04:00
f07146ebf8 Make graphdrivers work with pluginv2.
As part of making graphdrivers support pluginv2, a PluginGetter
interface was necessary for cleaner separation and avoiding import
cycles.

This commit creates a PluginGetter interface and makes pluginStore
implement it. Then the pluginStore object is created in the daemon
(rather than by the plugin manager) and passed to plugin init as
well as to the different subsystems (eg. graphdrivers, volumedrivers).
A side effect of this change was that some code was moved out of
experimental. This is good, since plugin support will be stable soon.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: fefea805e930a67fb6327f8e59415932861358cb
Component: engine
2016-09-20 08:49:48 -07:00
3b1269cdeb Merge pull request #25523 from dmcgowan/fsync-layer-filestore
Update layer store to sync transaction files before committing
Upstream-commit: bc06542a1715273acc087dadd8179a88386dd6fb
Component: engine
2016-09-08 10:03:12 -07:00
1c502571ef add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0ead624473b6bddc232b46bc7c76ab4f9c743ff5
Component: engine
2016-08-10 08:36:09 +08:00
2f8f4c65f9 Update layer store to sync transaction files before committing
Fixes case where shutdown occurs before content is synced to disked
on layer creation. This case can leave the layer store in an bad
state and require manual recovery. This change ensures all files
are synced to disk before a layer is committed. Any shutdown that
occurs will only cause the layer to not show up but will allow it to
be repulled or recreated without error.

Added generic io logic to ioutils package to abstract it out of
the layer store package.


Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: c37bd10f8cfc4cb6df5513881eed53e6c5f0be09
Component: engine
2016-08-09 11:55:17 -07:00
923b4bd8ef fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
Upstream-commit: 950073aabb305db6156709ea8509b1f72ff06f3b
Component: engine
2016-06-21 15:29:25 +08:00
1e36058e8c Use describable interfaces
Replace use of foreign sources with descriptors and describable

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 2c60430a3d1431e0879aa1c66ca23143de987b35
Component: engine
2016-06-06 17:49:34 -07:00
3ff13f560e Merge pull request #22866 from jstarks/foreign_layers
Support layers from external URLs
Upstream-commit: 7d08f3a5ad16446952b9b461feb0895a5c73ea58
Component: engine
2016-06-07 00:27:40 +00:00
770153eec3 Support layers from external URLs
This is used to support downloading Windows base images from Microsoft
servers.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 05bd04350b8348b3c3bbe3156420257313e4e804
Component: engine
2016-05-25 19:23:02 -07:00
12513175c8 Merge pull request #22091 from amitkris/build_solaris
Get the Docker Engine to build clean on Solaris
Upstream-commit: 86a7632d63bdddb95aaf1472648056a4fb737d38
Component: engine
2016-05-24 21:41:36 +02:00
2736991181 Remove mountedLayer Mount and Unmount
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 8bb4d31b10e4c3abee9ca92535461859bbf25d46
Component: engine
2016-05-23 16:52:58 -07:00
3a35464d9d Get the Docker Engine to build clean on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
Upstream-commit: 86d8758e2bb5e9d21d454ceda90b33feb8e74771
Component: engine
2016-05-23 16:37:12 -07:00
49f1314f0b Remove ref counting from layer store
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: e19499710e3728433cdc8348e985f9a825cb2336
Component: engine
2016-05-23 15:57:23 -07:00
d4ec9845eb Adding readOnly parameter to graphdriver Create method
Since the layer store was introduced, the level above the graphdriver
now differentiates between read/write and read-only layers.  This
distinction is useful for graphdrivers that need to take special steps
when creating a layer based on whether it is read-only or not.
Adding this parameter allows the graphdrivers to differentiate, which
in the case of the Windows graphdriver, removes our dependence on parsing
the id of the parent for "-init" in order to infer this information.

This will also set the stage for unblocking some of the layer store
unit tests in the next preview build of Windows.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: ef5bfad3210a9e9c8b761f2c11c0c6289490ebff
Component: engine
2016-04-06 13:52:53 -07:00
7401f52d5d Merge pull request #21677 from aaronlehmann/layer-store-locking
Fix layer store Get locking
Upstream-commit: 156c5db889b29e28e0176019b1996af4a5465a77
Component: engine
2016-03-31 11:35:02 +02:00
2a5d48b968 Merge pull request #21372 from anusha-ragunathan/ctrd-rebase
Update mount state of live containers after a daemon crash.
Upstream-commit: ffee5588cd9be4c67c73476998af1ecbc61250b6
Component: engine
2016-03-30 23:10:04 -07:00
c005ab5e62 Fix layer store Get locking
Get was calling getReference without layerL held. This meant writes to
the references map could race. Such races are dangerous because they can
corrupt the map and crash the process.

Fixes #21616
Fixes #21674

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 0538981c31a714a4183e846a4b512deb7879cc29
Component: engine
2016-03-30 19:34:51 -07:00
ad9621a58c Update mount state of live containers after a daemon crash.
Fix unmount issues in the daemon crash and restart lifecycle, w.r.t
graph drivers. This change sets a live container RWLayer's activity
count to 1, so that the RWLayer is aware of the mount. Note that
containerd has experimental support for restore live containers.

Added/updated corresponding tests.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 511a70583fbb901f57acb44d501cca8e6dcbce2c
Component: engine
2016-03-29 14:42:43 -07:00
9ab7e4327f CLI flag for docker create(run) to change block device size.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: b16decfccfdb0749c490be9272cb7b4789be87b4
Component: engine
2016-03-28 10:05:18 -04:00
778611a207 Move layer mount refcounts to mountedLayer
Instead of implementing refcounts at each graphdriver, implement this in
the layer package which is what the engine actually interacts with now.
This means interacting directly with the graphdriver is no longer
explicitly safe with regard to Get/Put calls being refcounted.

In addition, with the containerd, layers may still be mounted after
a daemon restart since we will no longer explicitly kill containers when
we shutdown or startup engine.
Because of this ref counts would need to be repopulated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 65d79e3e5e537039b244afd7eda29e721a93d84f
Component: engine
2016-03-23 14:42:52 -07:00
fba90c19ef Revert "Move layer mount refcounts to mountedLayer"
This reverts commit 563d0711f83952e561a0d7d5c48fef9810b4f010.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e91de9fb9d175541acc95834de486d33feef552a
Component: engine
2016-03-23 00:33:02 -07:00
44acd43622 Move layer mount refcounts to mountedLayer
Instead of implementing refcounts at each graphdriver, implement this in
the layer package which is what the engine actually interacts with now.
This means interacting directly with the graphdriver is no longer
explicitly safe with regard to Get/Put calls being refcounted.

In addition, with the containerd, layers may still be mounted after
a daemon restart since we will no longer explicitly kill containers when
we shutdown or startup engine.
Because of this ref counts would need to be repopulated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 563d0711f83952e561a0d7d5c48fef9810b4f010
Component: engine
2016-03-22 11:36:28 -04: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
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
4e53d3095a *: remove unused stuff
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 59648fc1e9d99cae7f4c5f692fe25a73d0651a71
Component: engine
2016-03-14 18:41:30 +01: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
2d730b8156 Merge pull request #20475 from Microsoft/jstarks/filegetter
graphdriver: Replace DiffPath with DiffGetter
Upstream-commit: 8f109829e294371cbae1eebfc771eda96d92187f
Component: engine
2016-03-02 08:36:36 -08:00
395ec16335 graphdriver: Replace DiffPath with DiffGetter
This allows a graph driver to provide a custom FileGetter for tar-split
to use. Windows will use this to provide a more efficient implementation
in a follow-up change.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 58bec40d16265362fd4e41dbd652e6fba903794d
Component: engine
2016-03-01 10:25:33 -08:00
4c31288f7a Windows CI Unit Test: Docker layer turn off failing tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e17cb9b721ec10d5be36f380c23ee2d448bd135a
Component: engine
2016-02-28 20:16:10 -08:00
baea9d79b2 Fix releasing reference on deletion error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 64530c8e47ec663827cceb28fc64b12da5e56147
Component: engine
2016-02-19 10:42:29 -08:00
c9fee8a605 Merge pull request #20458 from aaronlehmann/migration-close-gzip-writer
Close tarsplit gzip writer when creating tar-split.json.gz files during layer migration
Upstream-commit: 70687226781545499c45414286a5b864bfc4eecd
Component: engine
2016-02-18 16:48:50 -08:00
076a9b5f8a Close tarsplit gzip writer when creating tar-split.json.gz files during layer migration
There is a missing call to Close on the gzip.Writer that is used to
compress newly created tar-split files during layer migration. This can
result in corrupt tar-split files that later cause docker push and
docker save to fail. The Close call is necessary to flush buffered data
to the stream.

Fixes: #20104

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 1c05c65f6fbb5ea35608da259dfe4a6d211dbf82
Component: engine
2016-02-18 10:55:38 -08:00
ea1de57ceb Don’t stop daemon on migration hard failure
Also changes missing storage layer for container
RWLayer to a soft failure.

Fixes #20147

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 2798d7a6a681aee8995e87c9b68128e54876d2b5)
Upstream-commit: 55080fc03bed4dba85d5c5760363b92851ff728f
Component: engine
2016-02-17 14:26:30 -05:00
30e0c42e90 Verify layer tarstream
This adds verification for getting layer data out
of layerstore. These failures should only be possible
if layer metadata files have been manually changed
of if something is wrong with tar-split algorithm.

Failing early makes sure we don’t upload invalid data
to the registries where it would fail after someone
tries to pull it.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit e29e580f7fe628e936925681a4885d0b655bb151)
Upstream-commit: 50a498ea1c49cc3caa81bb9fb1417de387117e89
Component: engine
2016-02-17 14:26:16 -05:00
2e29d70d4a Windows CI UnitTest TestLayerSize-->Unix
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 298d28014323a02b49614d2b91cd2adf0baa6ae1
Component: engine
2016-02-10 13:57:26 -08:00
2c24be81fc Add more robust error handling on layer store creation
Add continue when layer fails on store creation
Trim whitespace from layerstore files to keep trailing space from failing a layer load

Fixes #19449

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: caef48f4e25eb56ae9d63aa58bea588891bed944
Component: engine
2016-01-19 11:17:08 -08:00
fbe586aef3 Update code to compile against new manifest interface
Also, digest.FromBytes no longer returns an error.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: c168a0059f56507731e59c0264d96b5a74f93507
Component: engine
2016-01-08 17:24:20 -08:00
b5e71315d4 Parallel migration and optimizations
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a8f88ef4036d22aa1feb1de8e86d92371bcd5b67
Component: engine
2016-01-04 09:48:52 -08:00