Commit Graph

19 Commits

Author SHA1 Message Date
e3db7f47ed Use a more defensive vendored archive/tar import path to make it clear this isn't upstream's released archive/tar
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: 2ca4e0ea60851ff8e9c0a05dc13fa23436c529b6
Component: engine
2014-02-27 09:43:44 -07:00
e821f31734 archive: Handle aufs plink hardlinks in ApplyLayer
Files in the .wh..wh.plnk directory are ignored, but other files
inside the tarfile can be hardlinks to these files. This is not
something that normally happens, as on aufs unmount such files are
supposed to be dropped via the "auplink" too, yet images on the index
(such as shipyard/shipyard, e.g. layer
f73c835af6d58b6fc827b400569f79a8f28e54f5bb732be063e1aacefbc374d0)
contains such files.

We handle these by extracting these files to a temporary directory
and resolve such hardlinks via the temporary files.

This fixes https://github.com/dotcloud/docker/issues/3884

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 6889cd9f9cfa3a6439b7702d73f27ab3fac3d3ef
Component: engine
2014-02-17 20:46:32 +01:00
fc1f23f527 Add vendored archive/tar that includes xattrs patch
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: b762d3a7391dd526826a0a1f1c983ea5e54852f5
Component: engine
2014-02-17 08:20:21 -07:00
e12f62e6df Properly close archives
All archive that are created from somewhere generally have to be closed, because
at some point there is a file or a pipe or something that backs them. So, we
make archive.Archive a ReadCloser. However, code consuming archives does not
typically close them so we add an archive.ArchiveReader and use that when we're
only reading.

We then change all the Tar/Archive places to create ReadClosers, and to properly
close them everywhere.

As an added bonus we can use ReadCloserWrapper rather than EofReader in several places,
which is good as EofReader doesn't always work right. For instance, many compression
schemes like gzip knows it is EOF before having read the EOF from the stream, so the
EofCloser never sees an EOF.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: f198ee525ad6862dce3940e08c72e0a092380a7b
Component: engine
2014-02-14 13:46:17 +01:00
f97f40c214 archive: Extract createTarFile() from ApplyLayer
This way we can reuse it for Untar()

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 710d5a48fb751623fbf77a51b89f2dfbf0edac68
Component: engine
2014-01-14 11:21:07 +01:00
044c307631 small batch of edits/corrections to comments
Upstream-commit: 0fccf0f68655fd01973e4c00bbb063fad1bce56c
Component: engine
2013-12-24 16:40:14 -08:00
c725c9d310 Handle compressed tars in ApplyLayer
When pulling from a registry we get a compressed tar archive, so
we need to wrap the stream in the right kind of compress reader.

Unfortunately go doesn't have an Xz decompression method, but I
don't think any docker layers use that atm anyway.
Upstream-commit: a96a26c62f6333e61134759256db43a7f5946631
Component: engine
2013-12-17 14:19:48 +01:00
692e7bb3bd ApplyLayer: Fix TestLookupImage
The TestLookupImage test seems to use a layer that contains
/etc/postgres/postgres.conf, but not e.g. /etc/postgres.

To handle this we ensure that the parent directory always
exists, and if not we create it.
Upstream-commit: 78c22c24b353d77fdab3e1616d9986a8ae95a7c2
Component: engine
2013-12-16 14:35:43 +01:00
e5d96fb523 archive: Implement ApplyLayer directly
Rather than calling out to tar we use the golang tar parser
to directly extract the tar files. This has two major advantages:

1) We're able to replace an existing directory with a file in the
   new layer. This currently breaks with the external tar, since
   it refuses to recursively remove the destination directory in
   this case, and there are no options to make it do that.

2) We avoid extracting the whiteout files just to later remove them.
Upstream-commit: 818c249bae8d29842834bf765299c86c09e6913e
Component: engine
2013-12-13 15:43:50 +01:00
3f2a763338 Move syscall.Stats logic to os specific file.
related to #2909.
Upstream-commit: 8b2a7e35c35f894dca0795a4fde9ec0cfe04ce43
Component: engine
2013-11-28 00:22:47 -02:00
04ef2191af Ensure same atime, mtime after applying whiteouts
Upstream-commit: 3edb4af663079ad79672bc98fcd20790f8fb2589
Component: engine
2013-11-19 00:35:03 -08:00
39e4a0bc9e ApplyLayer() use RemoveAll to handle removing directories
rmTargetPath can be a directory, so we have to use RemoveAll() or we
will fail to whiteout non-empty directories.
Upstream-commit: 006e2a600ce689770ba2c49805bc4f634976f365
Component: engine
2013-11-14 22:56:18 +01:00
88636cc70a Merge pull request #17 from alexlarsson/dm-plugin-whiteout-directory
archive.ApplyLayer() - handle directory whiteouts
Upstream-commit: 50d80a89381366001d2e888b822a139cd8eb2025
Component: engine
2013-11-12 12:16:30 -08:00
82914826a6 archive.ApplyLayer() - handle directory whiteouts
When directories are white-outed we can get called with the previously
removed directories. Handle this with os.IsNotExist(error).
Upstream-commit: 6f3c32eb18f0a604ba2638b6a9f19f8824412fd1
Component: engine
2013-11-12 21:14:54 +01:00
084cb15f1a Allow drivers to implement ApplyDiff in Differ interface
Upstream-commit: 5d9723002bc764e2c768e5184994d7949f55fc49
Component: engine
2013-11-11 19:09:57 -08:00
22263cd931 Merge pull request #6 from alexlarsson/fix-ApplyLayer-remove
archive.ApplyLayer() remove files recursively
Upstream-commit: 78ef0bd9985d899dda6fdfc8c35d9ab47f7f07d7
Component: engine
2013-11-08 11:46:55 -08:00
783f801512 gofmt
Upstream-commit: f1127b9308fbb4d4e21c3c5567ace9fdda82559d
Component: engine
2013-11-07 23:58:03 +00:00
65b7bbeca7 archive.ApplyLayer() remove files recursively
Some aufs metadata are directories, and whiteouts can be for
directories, so use os.RemoveAll() for these.
Upstream-commit: 484804abffda2692492e295d4691f90564d05eb2
Component: engine
2013-11-07 22:46:44 +01:00
6fb0ff4f9a archive.ApplyLayer(): parse a tar archive as a standard aufs-compatible diff, and apply it on a directory
Upstream-commit: 318dd33fb778282c3012ee06d892d6375e98cd6b
Component: engine
2013-11-01 05:06:35 +00:00