Commit Graph

442 Commits

Author SHA1 Message Date
Michael Crosby 0d2ea52f03 Merge pull request #18030 from Microsoft/sjw/pull_id_hack
[TP4] Windows: hacking around content addressable IDs for temporary fix.
2015-11-18 11:08:13 -08:00
Alexander Morozov c00c64c20e Merge pull request #18047 from aaronlehmann/push-fix
Correct parent chain in v2 push when v1Compatibility files on the disk are inconsistent
2015-11-17 17:03:13 -08:00
Alexander Morozov e2417e3e92 Merge pull request #17617 from askb/17168_pull_error_fix
Fix for #17168 issue
2015-11-17 16:10:44 -08:00
Aaron Lehmann 0ab6b1d922 Correct parent chain in v2 push when v1Compatibility files on the disk are inconsistent
This fixes an issue where two images with the same filesystem contents
and configuration but different remote IDs could share a v1Compatibility
file, resulting in corrupted manifests.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-11-17 16:05:09 -08:00
Stefan J. Wernli d860ff79a0 Windows: hacking around content addressable IDs for temporary fix.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-11-17 14:03:36 -08:00
Michael Crosby e58b0bba7f Merge pull request #18024 from LK4D4/simple_byparent
graph/graph.go: simplify appending to slice in map in byParent
2015-11-17 11:45:24 -08:00
Alexander Morozov 4dda67b801 Merge pull request #16452 from rhatdan/btrfs-selinux
Relabel BTRFS Content on container Creation
2015-11-17 11:03:40 -08:00
Alexander Morozov 25b37e2f04 graph/graph.go: simplify appending to slice in map in byParent
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-16 12:02:35 -08:00
John Howard 7e5e29e415 Windows [TP4] Fix push to not kill daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-15 08:43:23 -08:00
Tibor Vass 59fe485f0d Merge pull request #17945 from tonistiigi/fix-windows-pull
Fix docker pull on windows
2015-11-15 12:32:25 +01:00
Anil Belur 31cdc63419 Fix for #17168 misleading pull error
This fix avoids overwritting the previous error messages, ensures the client gets the correct error messages and not just the most recent message during the pull request.
For this `var lastErr` replaced with a slice which acts as a temp place holder for the list of returned error messages for every attempt.
The slice is later joined and returned to the caller function after searching for the image with diffirent versions(v2,v1,v0).

Updated the code with check for no space left on device error occurance and prevent the
daemon on falling back to v1,v0.

Incorporated the comments from @calavera, @RichardScothern, @cpuguy83

Signed-off-by: Anil Belur <askb23@gmail.com>
2015-11-14 16:24:45 +05:30
Alexander Morozov 9b307fe369 Merge pull request #17503 from mikebrow/fix-for-rmi-id-old-local-repositories
putting in support for rmi id for legacy docker.io/name images in loc…
2015-11-13 16:22:30 -08:00
Tonis Tiigi 18c7c34d4b Fix docker pull on windows
Exceptions for the windows base layer handling.
    
    
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-11-12 10:04:53 -08:00
Dan Walsh 1716d497a4 Relabel BTRFS Content on container Creation
This change will allow us to run SELinux in a container with
BTRFS back end.  We continue to work on fixing the kernel/BTRFS
but this change will allow SELinux Security separation on BTRFS.

It basically relabels the content on container creation.

Just relabling -init directory in BTRFS use case. Everything looks like it
works. I don't believe tar/achive stores the SELinux labels, so we are good
as far as docker commit.

Tested Speed on startup with BTRFS on top of loopback directory. BTRFS
not on loopback should get even better perfomance on startup time.  The
more inodes inside of the container image will increase the relabel time.

This patch will give people who care more about security the option of
runnin BTRFS with SELinux.  Those who don't want to take the slow down
can disable SELinux either in individual containers or for all containers
by continuing to disable SELinux in the daemon.

Without relabel:

> time docker run --security-opt label:disable fedora echo test
test

real    0m0.918s
user    0m0.009s
sys    0m0.026s

With Relabel

test

real    0m1.942s
user    0m0.007s
sys    0m0.030s

Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-11-11 14:49:27 -05:00
Aaron Lehmann 77cd22ea73 Correct import event logging
Importing an image currently logs an event with id:tag. This format is
strange and nonstandard - possibly a mistake. Just log the ID instead.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-11-10 13:34:53 -08:00
David Calavera 58b270c338 Merge pull request #17431 from vdemeester/hope-it-does-not-broke-everything-again
Another try at dockerversion placeholder for library import
2015-11-09 13:15:50 -08:00
Vincent Demeester 8054a30387 dockerversion placeholder for library import
- Add a *version* file placeholder.
- Update autogen and builds to use it and an autogen build flag

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-11-09 19:32:46 +01:00
Brian Goff d7a41325fa Un-export non-externally used functions
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-11-08 15:51:27 -05:00
Brian Goff 8c08002a10 Remove dead graph code
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-11-08 08:57:54 -05:00
Brian Goff 2764839ae1 Replace `imageMutex` with `Locker` pkg
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-11-07 21:23:12 -05:00
Jess Frazelle 9c1006c8bf Merge pull request #17673 from LK4D4/elim_str_comparison
Do not rely on string comparison in truncindex
2015-11-04 15:39:19 -08:00
Alexander Morozov d4a8d09d1a Do not rely on string comparison in truncindex
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-04 11:34:05 -08:00
Antonio Murdaca eaa4047792 graph: do not error out if images can't be restored
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-04 19:46:54 +01:00
Jess Frazelle e704182c9c Merge pull request #17614 from LK4D4/fix_golint
Update linting tools to latest versions
2015-11-03 15:32:12 -08:00
Tibor Vass 27c2368599 Do not stop daemon from booting if io.EOF on loading image
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-11-02 21:07:28 -05:00
Derek McGowan 6964f42350 Merge pull request #17557 from aaronlehmann/update-distribution
Vendor updated version of docker/distribution
2015-11-02 14:37:04 -08:00
Aaron Lehmann 257c59251b Vendor updated version of docker/distribution
This updates the vendored docker/distribution to the current master
branch.

Note the following changes:

- The manifest package was split into manifest/schema1. Most references
  to the manifest package in the engine needed to be updated to use
  schema1 instead.

- Validation functions in api/v2 were replaced by the
  distribution/reference package. The engine code has been updated to
  use the reference package for validation where necessary. A future PR
  will change the engine to use the types defined in
  distribution/reference more comprehensively.

- The reference package explicitly allows double _ characters in
  repository names. registry_test.go was updated for this.

- TestPullFailsWithAlteredManifest was corrupting the manifest JSON, now
  that the schema1 package unmarshals the correct payload. The test is
  being changed to modify the JSON without affecting its length, which
  allows the pull to succeed to the point where digest validation
  happens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-11-02 12:40:18 -08:00
Alexander Morozov 7aa28b6bdd Fix go vet warnings
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-02 08:28:34 -08:00
Alexander Morozov 270e8cf64d Fix golint warnings
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-02 08:02:25 -08:00
Antonio Murdaca f5fc832b6e graph: enhance err message on failed image restore
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-02 10:10:23 +01:00
Mike Brown b1da9fcc84 putting in support for rmi id for legacy docker.io/name images in local repositories
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2015-10-30 15:28:12 -05:00
Brian Goff b78ca243d9 Revert "dockerversion placeholder for library-import"
This reverts commit d5cd032a86.

Commit caused issues on systems with case-insensitive filesystems.
Revert for now

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-10-27 21:23:53 -04:00
Vincent Demeester d5cd032a86 dockerversion placeholder for library-import
- Move autogen/dockerversion to version
- Update autogen and "builds" to use this package and a build flag

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-10-27 20:36:07 +01:00
Lei Jitang 79804d271c Better log on docker load
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-24 06:33:15 -04:00
Tibor Vass f7bdcea529 Merge pull request #17291 from aaronlehmann/buffer-compression
Add a buffered Writer between layer compression and layer upload
2015-10-23 13:52:08 -04:00
Lei Jitang 45a8a3796f Remove unused parmeter of createRootFilesystemInDriver in graph/graph.go
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-23 03:07:06 -04:00
Aaron Lehmann bb69f10df9 Add a buffered Writer between layer compression and layer upload
Without this buffering, the compressor was outputting 64 bytes at a
time to the HTTP stream, which was resulting in absurdly small chunk
sizes and a lot of extra overhead. The buffering restores the chunk size
to 32768 bytes, which matches the behavior with 1.8.2.

Times pushing to a local registry:

1.8.2: 0m18.934s
master: 0m20.564s
master+this commit: 0m17.593s

Fixes: #17038

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-10-22 19:58:01 -07:00
Vincent Demeester f664f6e4b1 Use RepoTags & RepoDigest in inspect
To be coherent with /images/json (images command)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-10-22 23:00:59 +02:00
Jess Frazelle 697d4c9e72 Merge pull request #17203 from hopkings2008/auth_token
In NewV2Repository, check the suffix of endpoint.URL and append 'v2' …
2015-10-21 14:57:05 -07:00
Tibor Vass e319b122d3 Merge pull request #17227 from aaronlehmann/layer-compression
Fix layer compression regression
2015-10-21 17:32:58 -04:00
Tibor Vass 56ef47e881 Merge pull request #16890 from runcom/perf-boost
rmi and build cache miss performance improvements
2015-10-21 16:00:25 -04:00
Tibor Vass 10430fd334 Merge pull request #17179 from tonistiigi/17178-dont-overwrite-layer-checksum
Don’t overwrite layer checksum on push
2015-10-21 13:42:59 -04:00
Aaron Lehmann 4dce280d96 Fix layer compression regression
PR #15493 removed compression of layers when pushing them to a V2
registry. This this makes layer uploads larger than they should be.

This commit restores the compression. It uses an io.Pipe to turn the
gzip compressor output Writer into a Reader, so the ReadFrom method can
be used on the BlobWriter (which is very important for avoiding many
PATCH requests per layer).

Fixes #17209
Fixes #17038

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-10-21 09:21:14 -07:00
Antonio Murdaca f6577be1c9 graph: ensure _tmp dir is always removed
Also remove unused func `newTempFile` and prevent a possible deadlock
between pull_v2 `attemptIDReuse` and graph `register`

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-10-21 17:13:45 +02:00
Antonio Murdaca f9e81b40f4 daemon: faster image cache miss detection
Lookup the graph parent reference to detect a builder cache miss before
looping the whole graph image index to build a parent-children tree.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-10-21 17:13:45 +02:00
Antonio Murdaca 56f5e3459f graph: add parent img refcount for faster rmi
also fix a typo in pkg/truncindex package comment

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-10-21 17:13:45 +02:00
yuzou 5f59f52c14 In NewV2Repository, check the suffix of endpoint.URL and append 'v2' correctly.
Signed-off-by: yuzou <zouyu7@huawei.com>
2015-10-21 11:43:31 +08:00
Tibor Vass 1ab5ca2d5b Merge pull request #17116 from dmcgowan/increase-ping-timeout
Increase ping timeout for registries
2015-10-19 16:10:01 -04:00
Tonis Tiigi fb4a725692 Don’t overwrite layer checksum on push
After v1.8.3 layer checksum is used for image ID
validation. Rewriting the checksums on push would
mean that next pulls will get different image IDs
and pulls may fail if its detected that same
manifest digest can now point to new image ID.

Fixes #17178

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-10-19 11:44:16 -07:00
David Calavera c3f42b29a8 Merge pull request #17113 from mountkin/validate-filter
make sure the value of the dangling filter is correct
2015-10-16 16:32:11 -07:00