Commit Graph

178 Commits

Author SHA1 Message Date
c2eb21415c gofmt: 5 files
gofmt from go1.8.3

hg locate '*.go' |xargs ~/go/bin/gofmt -s -w

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6284cf5e9a4bc121b73422c454cdbf8dc18f42f3
Component: engine
2017-07-03 10:32:47 -07:00
8ae901a8e8 Merge pull request #33647 from johnstep/improve-load-error
Stop trying to load images on an incompatible OS
Upstream-commit: 5fbc82128b42871734f35b468d410ba182ada917
Component: engine
2017-06-29 16:12:32 +02:00
08b4e324e5 Merge pull request #33826 from Microsoft/jjh/lcownits
LCOW: Fix nits from 33241
Upstream-commit: 950d472c9ce4180b80e28030f7de68ffc3254f97
Component: engine
2017-06-27 22:56:38 -07:00
9a5747b3f9 LCOW: Fix nits from 33241
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4ec9766a27ffb964cec6b8b2745725965b2644aa
Component: engine
2017-06-27 11:59:49 -07:00
836d4632cb Stop trying to load images on an incompatible OS
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: b9255e4a531d2ad0239481eba2a635f7d48718fb
Component: engine
2017-06-26 15:11:24 -07:00
f5f8240661 Set a LastUpdated time in image metadata when an image tag is updated.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 016eea004ba0109d7cd965eab242ed17e4f0f36c
Component: engine
2017-06-26 12:16:26 -07:00
ad62bca460 Merge pull request #33241 from Microsoft/jjh/multi-layerstore
LCOW: Support most operations excluding remote filesystem
Upstream-commit: 930e6896685f614d8f15ed10207596b1a151cbc8
Component: engine
2017-06-21 15:45:23 -07:00
4dc3e08e78 Merge pull request #33755 from aaronlehmann/imagestore-locking
image: Improve store locking
Upstream-commit: e64c2d7122158d7d8583ff6967c3e4a833042c25
Component: engine
2017-06-21 10:01:19 -07:00
30a1a8646e LCOW: Store integrity checks
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 87abf34a3d7bb63e3948eb1d801ac43b379d779e
Component: engine
2017-06-20 19:49:53 -07:00
0e82890827 LCOW: commit to use image platform, not host
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 8f5378069444fba89e43b95e95d5ac630b33d90b
Component: engine
2017-06-20 19:49:52 -07:00
5ce127c469 LCOW: Add platform to image store
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6c336849876c2117381618b577f1b24f1fb85571
Component: engine
2017-06-20 19:49:51 -07:00
60028ea97d image: Improve store locking
This showed up in a recent profile.

Search doesn't need to take a lock on the store, because digestset has
its own locking.

Some other methods can get by with a read lock instead of an exclusive
lock.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 44e67adae5695e3e2c3b450453ab0fe6119eb80d
Component: engine
2017-06-20 18:31:29 -07:00
8508f49b3f LCOW: Pass platform through into layer store
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 42c5c1a9ec14f00d5a5367131493cbd6de7d72b0
Component: engine
2017-06-20 09:21:37 -07:00
13d2adae3f Fix copy when used with scratch and images with empty RootFS
Commit the rwLayer to get the correct DiffID
Refacator copy in thebuilder
move more code into exportImage
cleanup some windows tests
Release the newly commited layer.
Set the imageID on the buildStage after exporting a new image.
Move archiver to BuildManager.
Have ReleaseableLayer.Commit return a layer
and store the Image from exportImage in the local imageSources cache
Remove NewChild from image interface.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 51360965206b0db49cc0365dabb590063a17a9df
Component: engine
2017-06-08 15:07:16 -04:00
932c771fa1 Remove CopyOnBuild from the daemon.
Add CreateImage() to the daemon
Refactor daemon.Comit() and expose a Image.NewChild()
Update copy to use IDMappings.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: bd5f92d2631df7c932b93e72e45b39cba19f2f3b
Component: engine
2017-06-08 15:06:54 -04:00
a9c76c4bc8 Merge pull request #32293 from moypray/save_delete
Fix delete a image while saving it, delete successfully but failed to save it
Upstream-commit: c8141a1fb1ff33b2bfab85a40e5da9a282f36cdc
Component: engine
2017-06-05 09:55:56 -04:00
52c11cb152 Fix delete a image while saving it, delete successfully but failed to save it
Issue Description:
 * 1. Saving more than one images, `docker save -o a.tar aaa bbb`
 * 2. Delete the last image which in saving progress.  `docker rmi bbb`

Espected:
 Saving images operation shouldn't be disturbed. But the real result is that failed to
save image and get an error as below:
  `Error response from daemon: open
/var/lib/docker/image/devicemapper/imagedb/content/sha256/7c24e4d533a76e801662ad1b7e6e06bc1204f80110b5623e96ba2877c51479a1:
no such file or directory`

Analysis:
  1. While saving more than one images, it will get all the image info from reference/imagestore,
     and then using the `cached data` to save the images to a tar file.
  2. But this process doesn't have a resource lock, if a deletion operation comes, the image will be deleted,
     so saving operation will fail.

Solution:
 When begin to save an image, `Get` all the layers first. then the
deletion operation won't delete the layers.

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
Upstream-commit: 4a014e6b0d7e2d310ee1ba442128a6802559a63a
Component: engine
2017-06-01 18:13:20 +08:00
0046c26e1e Merge pull request #32949 from dnephin/refactor-streamformatter-and-progress
Refacator pkg/streamformatter
Upstream-commit: 08d7fad45dce832dc03934e9f4fc904899220c96
Component: engine
2017-05-03 09:05:26 -07:00
755f9321e1 Refacator pkg/streamformatter
StreamFormatter suffered was two distinct structs mixed into a single struct
without any overlap.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c87d67b0ad788a6a80d1af89488e2d1f22726c34
Component: engine
2017-05-02 17:38:12 -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
f0510caf2e image/spec: tags are 128 characters
Mostly, they always have been. Most regular expressions were implemented
as `[\w][\w.-]{0,127]`, which actually allows 128 characters, since we
start with a character in the first expression.

This "fact" has been backported to the existing specifications where
length is mentioned. For the most part, no ill-effects should come of
this, unless someone has optimized to hold the length of a tag in a 7
bit integer.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: c9beb417f46a3a0d06a89c67b134cd399a7b948b
Component: engine
2017-04-24 15:23:34 -07:00
142883d5b3 Remove pkg/testutil/assert in favor of testify
I noticed that we're using a homegrown package for assertions. The
functions are extremely similar to testify, but with enough slight
differences to be confusing (for example, Equal takes its arguments in a
different order). We already vendor testify, and it's used in a few
places by tests.

I also found some problems with pkg/testutil/assert. For example, the
NotNil function seems to be broken. It checks the argument against
"nil", which only works for an interface. If you pass in a nil map or
slice, the equality check will fail.

In the interest of avoiding NIH, I'm proposing replacing
pkg/testutil/assert with testify. The test code looks almost the same,
but we avoid the confusion of having two similar but slightly different
assertion packages, and having to maintain our own package instead of
using a commonly-used one.

In the process, I found a few places where the tests should halt if an
assertion fails, so I've made those cases (that I noticed) use "require"
instead of "assert", and I've vendored the "require" package from
testify alongside the already-present "assert" package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 6052f2b3969feadb01662d8e2f30337d9c7f61af
Component: engine
2017-04-14 12:03:21 -07:00
a2c22efea2 Fixing a typo in spelling
Wrong tense used in a sentence

Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
Upstream-commit: 5e1349e0839000f0a6620e139b434c1c60c733a3
Component: engine
2017-03-30 14:31:45 +05:30
d25a95c0e2 Wrap errors in digest package so they are consistent between platforms.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7abeb08a8cc10d4bc9b218d14f79d9ee27ff62ff
Component: engine
2017-03-08 11:48:46 -05:00
490ab536f0 Use assertions in image package unit tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 69d7362058530d7dd97af29dc43fc4d55e73e776
Component: engine
2017-03-08 11:46:10 -05:00
2f3cef62de image/cache: fix isValidParent logic
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 1cf4b2b8bd92562ffe8d7cce8a705efb3ef32ba7
Component: engine
2017-02-21 19:32:04 +01:00
2260389fe6 Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3a1279393faf78632bf169619d407e584da84b66
Component: engine
2017-02-07 11:08:37 -08:00
f765025408 some grammatical errors
Signed-off-by: Xinbo Weng <xihuanbo_0521@zju.edu.cn>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5b258f6ac24a4eff83561be8a9707d7762b32ade
Component: engine
2017-01-31 19:33:12 -08:00
adee679878 Merge pull request #29851 from vdemeester/daemon-extract-image-cache
Extract the daemon image cache to its own package
Upstream-commit: df5d909ac95556c861ef27560a141748c84fb5dd
Component: engine
2017-01-26 10:50:35 -08:00
c15d01d9ac Merge pull request #29830 from timthelion/issue29821
Docs: Be more clear when specifying valid formats for strings
Upstream-commit: effc91e7a54a44b50913e1c17a8d173656411847
Component: engine
2017-01-26 10:45:03 -08:00
b14161740b Follow #28926, fix docker save can't share layers in the tar archive.
After https://github.com/docker/docker/pull/28926, if saving multiple images
which have common layers at same time, the common layers can't share in the tar archive
because the hash ID changes because of the Create time. The Create time is used for
pre v1.9 which treat each layer as a image and make no sense for after v1.10.
To make the hash ID consistent and keep the image save from >1.10 working properly
on pre v1.9, using a constant Create time `time.Unix(0,0)`.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: ee5228e799ab82e7f81a9673dec9228469c86dfd
Component: engine
2017-01-17 05:40:59 -05:00
4e32e40a14 image: tarexport: do not quote integers in format string
Basically, prevents outputs like:
```
invalid manifest, layers length mismatch: expected '\x02', got '\x01'
```

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 675f4140e735c71d917241ddfa0d51092aa8bc56
Component: engine
2017-01-14 20:03:11 +01:00
775c5633ef *: use opencontainers/go-digest package
The `digest` data type, used throughout docker for image verification
and identity, has been broken out into `opencontainers/go-digest`. This
PR updates the dependencies and moves uses over to the new type.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 7a855799175b6b984886ef1cfa337d6df1d4c668
Component: engine
2017-01-06 18:48:41 -08:00
91215c83ce Docs: Be more clear when specifying valid formats for strings
- Use the word letter rather than character to refer to letters ;) when trying to specify that only letters and numbers can be used, and not ANY character...
- Small corrections

Fixes #29821

Signed-off-by: Timothy Hobbs <timothy@hobbs.cz>
Upstream-commit: b71b4e1fb9aac5215aff7ce87e1bbb4010054ecd
Component: engine
2017-01-03 21:40:50 +01:00
70eb9ee7f4 Extract the daemon image cache to its own package
ImageCache is now independent of `Daemon` and is located in
`image/cache` package.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: be1df1ee1302cffe9825a23c05b5ebde3c6da254
Component: engine
2017-01-03 19:19:27 +01:00
42b7611762 Move imageID validation to stringid pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 9f3046f9a03f1a710bdb7fcddd37ff50e71e31c3
Component: engine
2016-12-26 18:53:22 -08:00
37cbce62ca Merge pull request #29345 from yuexiao-wang/fix-err-info
Fix incorrect words and formats in image
Upstream-commit: ba1c20f8d64156eb687a2f2e0a140e0a8ef39f10
Component: engine
2016-12-21 21:50:11 +01:00
209ed6b4ef change minor mistake of spelling
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 7c3657065cc04af278a0f1cee99de8c2401ba0ef
Component: engine
2016-12-20 21:05:19 +08:00
d71866a5fc Fix incorrect info and format of error in image
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: b2ec509a3f9e50980fe3733500df56289c174252
Component: engine
2016-12-20 18:20:15 +08:00
d363742779 return directly without ifs in remaining packages
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 2c187a24e0003f2f0ab90b85876e668f2b6210d4
Component: engine
2016-12-14 23:28:27 +02:00
bbaccfa1ea Merge pull request #28926 from coolljt0725/fix_save
Fix docker save with empty timestamp of layer created time
Upstream-commit: dd20fa60b4cda5132fea68c585a5b4bf0fbc8d51
Component: engine
2016-11-30 11:23:19 -08:00
0a3180df6c tarexport: check symlink error when saving layer
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 8616b0690a3ac905fc6ee06ff7524c837fcb8c92
Component: engine
2016-11-29 13:08:24 -08:00
871bc896d1 Fix docker save with empty timestamp of layer created time
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: e0b2c0af4d08b76311d3d57a96f3f55d55f52388
Component: engine
2016-11-29 03:58:23 -05:00
593e5eb2d5 Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7c29f5beed19b55ac8f14880752d4825ba23eccf
Component: engine
2016-11-14 17:41:52 -08:00
34bac6f06e Fix bunch of typos
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: e6866492c4492db3bb9546afa2fbaed20f4c1883
Component: engine
2016-10-29 15:03:26 +08:00
00676d4d53 Generalize content addressable and reference storage
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 805223982ce7469af0fc42fc4a5115055f7b4843
Component: engine
2016-09-15 18:08:19 -07:00
057c226c2d Merge pull request #25806 from Microsoft/jjh-missingdigest
Don't fail daemon start on missing layer
Upstream-commit: b890d475f7ad128c70cfa49274d1a4cd3fe1109f
Component: engine
2016-09-07 16:35:27 -07:00
7549abdea0 Windows: Skip layers+base images
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 540c8e9b201cfcf46cf9d2c05d42c492edda4117
Component: engine
2016-09-07 12:16:45 -07:00
45ddc4bfcb Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 91e197d614547f0202e6ae9b8a24d88ee131d950
Component: engine
2016-09-07 11:05:58 -07:00
c689c5c3a7 fixes #25654
Signed-off-by: Wenkai Yin <yinw@vmware.com>
Upstream-commit: 8f37abd056db2fdd1d1b23bdfbcbb907f1511fc3
Component: engine
2016-08-31 15:37:52 +08:00