Commit Graph

100 Commits

Author SHA1 Message Date
b4a009578f allow overwrite in untar
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: 5a3d774e5651da772a065282a1fb1a31e19e911c
Component: engine
2014-06-27 17:03:51 -04:00
bb2e21109b fix rebase
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 8162dc031246c55e34530d2b35ff7087f143d1c2
Component: engine
2014-06-26 22:51:47 +00:00
47f54ad882 abort on error and fix debug
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 0098360726e3df99e8f76dce9221a85dd89c2065
Component: engine
2014-06-26 22:49:08 +00:00
d4f4419563 Change misnamed TarFilter to TarWithOptions
Docker-DCO-1.1-Signed-off-by: Travis Cline <travis.cline@gmail.com> (github: tmc)
Upstream-commit: 111ab125b954c8d28503e1922e742eb271cc5d04
Component: engine
2014-06-26 22:49:08 +00:00
bb9a141a59 improve untar when using files instead of directories. Specifies behavior on non-existant targets.
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: 1c8d3106df0bd2aba304c7b3863949ca11c2b133
Component: engine
2014-06-25 09:35:26 -04:00
794a8c5ccb api/client/build: allow tar as context for docker build -
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: edcb41451aa388abe03d4f837ab5ee316a53a030
Component: engine
2014-06-23 13:34:09 -07:00
5d2f394b9a Merge pull request #6493 from vieux/fix_cp_mac_os
allow utimes on mac os, only lutimes isn't supported
Upstream-commit: abda245ddc38200b6ad24f79d194e6f4125a0100
Component: engine
2014-06-19 14:00:59 -07:00
2784f63639 discard ErrNotSupportedPlatform
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b132e7b36d30a116fa50eb5035c85cc895cc3d5b
Component: engine
2014-06-18 23:42:22 +00:00
172faefd3c Fix go vet errors
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f08cd445b0d2e44a4977a3bd0dca0a1cd4e76d2f
Component: engine
2014-06-18 17:39:57 +00:00
3acef7fcd0 reuse timestamp, don't call time.Now() 3 times
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: b64209f7b6818337a90d2f04627664b5964a29ce
Component: engine
2014-05-31 03:03:51 +03:00
786a16cf57 ignore lchown error on docker cp
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 9e51b7abaea3fb30dc994a1d004cd79f2e100c1a
Component: engine
2014-05-21 00:23:17 +00:00
bc32176ca2 Add readme file for the archive directory
See issue #5873

Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
Upstream-commit: 28fc387cf0c933128d0adad6d633c8f4a719d8ee
Component: engine
2014-05-17 17:48:07 +00:00
4d36898842 Merge pull request #5851 from proppy/archive-simple-detect
archive: simplify DetectCompression
Upstream-commit: 6f651ec62bdb7b00dc286414c1807a4ae4216058
Component: engine
2014-05-16 16:32:55 -07:00
add055e2b6 Merge pull request #5822 from creack/update_vendors
Update archive/tar vendored
Upstream-commit: eb61a1f73a979cc12e5ec1e6f451ec4dc4e37817
Component: engine
2014-05-16 16:31:37 -07:00
25b0a0131e archive: add missing bytes package
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: 4a3aefbb5232433098c9d27423a10031eb17ff93
Component: engine
2014-05-16 16:26:28 -07:00
1976c1713a archive: fix panic if len(source) < len(m)
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: 67ce59a806007cd28d96fd11208c4a113d1b92e0
Component: engine
2014-05-16 16:25:56 -07:00
c1c5dca31c archive: simplify DetectCompression
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: 3118952e0a63b42b830fc846a56b891d14902976
Component: engine
2014-05-16 16:25:56 -07:00
4dfcc75b6e Merge pull request #5853 from proppy/update-tarfilter-comment
archive: update TarFilter comments
Upstream-commit: 1adc2fa533ad86be3ff3e122feaa3d798f130a2e
Component: engine
2014-05-16 13:06:12 -07:00
3f955b3cac archive: update TarFilter comments
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: 311614952ea64315075d827c880debbdfb503640
Component: engine
2014-05-16 12:44:42 -07:00
e6ed9607f5 Merge pull request #5454 from kzys/utime-omit
UTIME_OMIT is only available on Linux
Upstream-commit: 4353ee78e8614779012b2f24d79a46fa352739b8
Component: engine
2014-05-15 17:18:37 -07:00
30441260af Add test for invalid tarball read
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: aedcb76adc2b2468565b311b67f4079a128b37cd
Component: engine
2014-05-15 15:45:40 -07:00
e8ae384f46 archive: use bufio for compression detection
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: 77c2b76e44f77eee2ca89ff551ac64f8c6b8bd23
Component: engine
2014-05-15 11:41:07 -07:00
4f88a0b2f2 process directories in parallel in ChangesDirs
This commit lowers the total time spent in ChangesDirs to half during a
commit.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 359f8aca29bf0e7fca757fa73e1d5565ed2d16f7
Component: engine
2014-05-15 00:03:33 +03:00
1f5f83d095 Change owner only on copied content
Fixes #5110
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: 91b7d8ebd31dba64b551de85e70786c568cb402a
Component: engine
2014-05-07 20:40:22 +04:00
0bb49ae030 UTIME_OMIT is only available on Linux
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: 21b42dfcfd15ee6757bcba57acb511d5ce60a3ba
Component: engine
2014-04-29 09:08:33 +09:00
dbcd3000c9 This permission should be interpreted as octal, not decimal
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: e1e512e2da5f642ded2eba6baa851f52bae0b05c
Component: engine
2014-04-17 00:48:27 +09:00
0834ef63f2 Merge pull request #5039 from kzys/freebsd-timestamp
Don't assume the file system has sub-second precision timestamp
Upstream-commit: 73a22fc6b31ad17ea5f1f51d54c445473e43655a
Component: engine
2014-04-07 10:28:22 -07:00
c723ea81f4 Don't assume the file system has sub-second precision timestamp
For example, FreeBSD doesn't have that
(see http://lists.freebsd.org/pipermail/freebsd-fs/2012-February/013677.html).

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: 794b5de749fceea906222917e90bbc19e131ecc3
Component: engine
2014-04-05 10:30:37 +09:00
53fdad7724 Remove archive/stat_unsupported.go because it is not used
LUtimesNano and all other functions were implemented on pkg/system after
d6114c0da0e844199e3d23c60a04434566fb5392.

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: da8aa712d28cb7177b0fe5b4cc9d7de33ea1da60
Component: engine
2014-04-05 10:09:04 +09:00
9788027867 images: assurance and debug info on image layers
when pushing or saving layers, report sizes for validation. And ensure
that the files written are sync'ed.

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 367a679b9270dd9ec6bd647998b6ffe594cfa6ab
Component: engine
2014-03-19 14:34:12 -04:00
193c19b4a6 Merge pull request #4440 from infoxchange/aufs-permissions-4068
Create directories for tar files with relaxed permissions
Upstream-commit: ca3369dc8d5032e29452b354f1bcc9e10e39b917
Component: engine
2014-03-10 16:50:17 -07:00
519289ece2 Update bsd specs
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 6ccfb7fb9af207a9999c60e57d1c9486ca949a5e
Component: engine
2014-03-10 15:19:08 -07:00
66069773bc Merge branch 'master' into add_freebsd_support
Conflicts:
	archive/archive.go
	archive/start_unsupported.go
Upstream-commit: bb43761940848650c1eab3c097d826892bd5b140
Component: engine
2014-03-10 13:20:49 -07:00
42b0cd2529 Create pkg/system and move stuff there from archive
This is a package for generic system calls etc that for some reason
is not yet supported by "syscall", or where it is different enough
for the different ports to need portability wrappers.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: d6114c0da0e844199e3d23c60a04434566fb5392
Component: engine
2014-03-05 14:05:32 +01:00
2107371cbd Create directories for tar files with relaxed permissions
Docker-DCO-1.1-Signed-off-by: Alexey Kotlyarov <alexey@infoxchange.net.au> (github: koterpillar)
Upstream-commit: 2aeccdd3bb98760ab10e834c6c134bb76f664910
Component: engine
2014-03-04 16:15:52 +11:00
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
7d5d3a982f archive: Handle capabilities in tar files
If a file has a security.capability set, we push this to the tar file.
This is important to handle in e.g. layer files or when copying files
to containers, as some distros (e.g. Fedora) use capability bits as
a more finegrained version of setuid bits, and thus if the capabilites
are stripped (and setuid is not set) the binaries will fail to work.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 3b9953903b12eaca76655311bd44533768f6f3da
Component: engine
2014-02-20 09:23:34 +01:00
8cd94e7ac6 archive: Detect file changes to capability bits
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 87ca750cdc3114a340af1c5bc9394cc5f6242677
Component: engine
2014-02-20 09:23:34 +01:00
91e61d4022 archive: extract xattrs from tarfiles
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: c8428d77fdde41786aa5c0c4e64e0e762f873676
Component: engine
2014-02-20 09:23:34 +01:00
3d478c1043 Archive: Add Add Lgetxattr and Lsetxattr implementations
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: d19e998e7a99d24122da3e98d9886e3b7b4b3501
Component: engine
2014-02-20 09:23:34 +01:00
f829291e78 archive: Fix the storing of setuid bits, etc
In commit 3dfc910d7774d57c533b067fbe59d6b24dd803cd we changed from
syscall.Chmod() to os.Chmod(), but these take a different form of the
Mode argument. The sycall one takes the raw linux form, wheras
os.Chmod takes the os.FileMode form, and they differ for the higher
bits (setuid, setgid, etc). The raw tar header uses a form which
is compatible with the syscalls, but not the go calls.

We fix this by using hdr.FileInfo() which properly converts the mode
to what go expects.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 5ba24629610c27f08b54ff4c1f000ad6d787c156
Component: engine
2014-02-18 09:53:30 +01: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
0f43c3eb05 Refactor utility MkBuildContext to the more generic archive.Generate
This facilitates refactoring commands.go.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 9b56da78e0b1e4e1da9b2bacc44a22143745a2b0
Component: engine
2014-02-15 14:52:08 -08: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
12b909af88 archive.TarFilter() - properly close readers
CompressStream() now always returns a stream that is closable, and it never
closes the underlying writer. TarFilter() makes sure the decompressed stream
is closed at the and, as well as the PipeWriter.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 804690bd07dcc1da6d0707d081e40ec9a189a3b6
Component: engine
2014-02-14 12:56:55 +01:00
77b539f03c archive: Close decompressed streams
Various kinds of decompressed streams are really ReadClosers. For instance
gzip.NewReader() is, and the one returned from CmdStream is changed to be
because it returns a PipeReader which is a ReadCloser.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 0d9213f859e00459e9efee2c5164417c94d66d2f
Component: engine
2014-02-14 12:56:55 +01:00
de9b1efd2f Remove linux specific calls
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 3dfc910d7774d57c533b067fbe59d6b24dd803cd
Component: engine
2014-02-09 04:23:57 -08:00
0060932995 Remove linux specific calls
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: e8740685ceb3ad8637532e7ddffb84ea55d4fc27
Component: engine
2014-02-06 14:13:03 -08:00
31578849e3 Merge pull request #3868 from 1uptalent/3867-allow-pax-global-extended-headers-to-passthrough
FIX 3867 allow pax global extended headers to passthrough
Upstream-commit: f9b4146ad48f992d17ca8aa530ab5bef75400c31
Component: engine
2014-01-31 17:54:08 -08:00