Commit Graph

151 Commits

Author SHA1 Message Date
e59b5a1439 Add support for COPY from previous rootfs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: f95f58283b2a69f4fd06d01de2281641e09b06bb
Component: engine
2017-03-23 15:12:15 -07:00
dbaf00790d Merge pull request #31669 from tonistiigi/files-filter
Fix inefficient file paths filter
Upstream-commit: 2422d5ad35345e0ab24d3f22b96c1271f7c1e07d
Component: engine
2017-03-20 17:43:47 +01:00
cf2a5afb08 pkg/archive/diff.go: avoid redundant options init
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 5957dc489958384c6fc8c997590967922ab9aefa
Component: engine
2017-03-15 18:03:33 +02:00
aec1003d24 Fix inefficient file paths filter
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: adeb3e36840c6d9d1912dd78f5300ae74d11c068
Component: engine
2017-03-08 18:59:25 -08:00
2db1bd6f28 fix typo
fix typo I found AMAP in integration-cli/*

fix typo mentioned by Allencloud

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: 40af5691648c5b9d07b1231e3ed3be29fd66521a
Component: engine
2017-01-19 15:52:28 +08:00
ec888ed9cd rectify function and variable referred in pkg/archive/changes_linux.go
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: e5ada578c3b0b554b5d996127ac6f5803cdb9431
Component: engine
2016-12-16 14:58:47 +08:00
f9eb0e420f pkg: return directly without ifs where possible
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 418e6123834def872edef06972c16d97b4cbc542
Component: engine
2016-12-13 22:10:11 +02:00
795fc21c8b Fix a bit typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 11454e1c97ed5495e77a06868a0c199d81aa96c3
Component: engine
2016-12-09 03:05:11 +08: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
6fb90ed484 Add functional support for Docker sub commands on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 934328d8ea650bf8a9c3c719999ce2a1f5dd5df6
Component: engine
2016-11-07 09:06:34 -08:00
fd88171dba Merge pull request #27705 from dmcgowan/fix-27298
Ensure opaque directory permissions respected
Upstream-commit: bcdce2a6b0d52a18b4eb4a2cb7710b248be88e51
Component: engine
2016-11-02 10:13:30 +01: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
1599ca6ae6 Ensure opaque directory permissions respected
When converting an opaque directory always keep the original
directory tar entry to ensure directory is created with correct
permissions on restore.

Closes #27298

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: daa70195171d798cdfb6c4033b33a06a8f7ebe6c
Component: engine
2016-10-28 13:13:10 -07: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
17191e6609 all: remove nil check for slices
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
Upstream-commit: ace53bbe65d1384893027d046a5d4eae83bd60af
Component: engine
2016-10-13 13:55:38 -07:00
e0f35ce34e pkg/archive/changes_posix_test.go: un-comment code line "defer os.RemoveAll(src)"
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 6514299fa9b716adbb04e67be583a335cd123398
Component: engine
2016-10-10 05:23:24 -04:00
5f25d3f4ea Fix error reporting in CopyFileWithTar
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 57e12037ac8f8eb48cc05979c3030853d011dfea
Component: engine
2016-09-30 11:46:37 -07:00
a658a7684d fix racy tests in pkg/archive
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 62cbd2589fb92c71711a323953f2713ab529e801
Component: engine
2016-09-14 04:17:23 +00:00
cc5b6aa3dd Don't create devices if in a user namespace
If we are running in a user namespace, don't try to mknod as
it won't be allowed.  libcontainer will bind-mount the host's
devices over files in the container anyway, so it's not needed.

The chrootarchive package does a chroot (without mounting /proc) before
its work, so we cannot check /proc/self/uid_map when we need to.  So
compute it in advance and pass it along with the tar options.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Upstream-commit: 617c352e9225b1d598e893aa5f89a8863808e4f2
Component: engine
2016-08-12 16:26:58 -04: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
5b655758f7 Fix files in subdirectories creating bad whiteout
Closes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 1c0f6653ba82c933885719478e90c13f8d7e32b7
Component: engine
2016-07-26 12:03:55 -07:00
1c3431e16a fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 4e959ef2f7f063803d04e06166f459257eb94b5c
Component: engine
2016-07-23 11:32:23 +08:00
6af42f8c0d Merge pull request #23912 from dmcgowan/fix-overlay2-whiteout-exclusion
Fix overlay2 ignoring whiteout files
Upstream-commit: 37fe4bdb59cae499cefb0d8bce8c28b894cd6f98
Component: engine
2016-06-24 01:06:38 +02:00
066b0582fe Fix overlay2 ignoring whiteout files
Currently when overlay creates a whiteout file then the overlay2 layer is archived,
the correct tar header will be created for the whiteout file, but the tar logic will then attempt to open the file causing a failure.
When tar encounters such failures the file is skipped and excluded for the archive, causing the whiteout to be ignored.
By skipping the copy of empty files, no open attempt will be made on whiteout files.

Fixes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: bd13c53f8dc1504c9e681dfabef2afc1685ccec7
Component: engine
2016-06-23 13:34:38 -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
7bec8a2e7d Merge pull request #22126 from dmcgowan/overlay-native-diff
Overlay multiple lower directory support
Upstream-commit: 8a2f9a249c28c0a80bac4b41eb318dfe68f63f0d
Component: engine
2016-06-13 13:15:39 -07:00
04ae4edf2f Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

This fix fixes #23459.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a72b45dbec3caeb3237d1af5aedd04adeb083571
Component: engine
2016-06-11 13:16:55 -07:00
a37552bd58 pkg: archive: only ignore ENOTSUP when xattr fails
There might be other (valid) reasons for setxattr(2) to fail, so only
ignore it when it's a not supported error (ENOTSUP). Otherwise, bail.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: e6d856df43ac2877ebbcff26e9f3ee755f52bce9
Component: engine
2016-06-10 00:56:40 +10:00
2f84275837 Update archive package to support overlay whiteouts
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 8222c86360b3f63174e1dbd9b35e27a3d01298bc
Component: engine
2016-06-08 00:10:16 -07:00
5798927ced aufs compatibility
Signed-off-by: Viktor Stanchev <me@viktorstanchev.com>
Upstream-commit: b03d3232d19db476077b845cbfc796f4ae3ec7b6
Component: engine
2016-06-08 00:10:16 -07:00
35c5774373 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: c1be45fa38e82054dcad606d71446a662524f2d5
Component: engine
2016-06-02 17:17:22 +08:00
fe5c78bee9 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 3f77baf2ce3a607fd1eb8fbe6e9dd9da44a8db49
Component: engine
2016-05-06 18:23:11 +08:00
ffc19b3fb1 pkg/archive: use more narrow interface for CompressStream
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 9b2c3aa8946eee15e5938f03c2202b16a7f22875
Component: engine
2016-04-07 13:21:05 -07:00
7ad3abac63 Merge pull request #21251 from cyphar/refactor-copyonbuild
pkg: archive: don't fail Untar if xattrs are not supported
Upstream-commit: 553edd1d19193a1413515fdf3807a6136c4fc0a6
Component: engine
2016-03-28 16:15:18 -07:00
e155de707d Fix misspellings
Signed-off-by: Dmitri Logvinenko <dmitri.logvinenko@gmail.com>
Upstream-commit: 6dede879fd8e0c5f599631d125753d360ead3bc0
Component: engine
2016-03-28 16:21:02 +03:00
c6a8dec47c pkg: archive: don't fail Untar if xattrs are not supported
Since certain filesystems don't support extended attributes, ignore
errors produced (emitting a warning) when attempting to apply extended
attributes to file.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 75a271603c761c18c7deb186d08943dcf85b739d
Component: engine
2016-03-24 02:05:36 +11:00
96d657135e Fix CopyWithTar creation of new destination dir as remapped root
If the destination does not exist, it needs to be created with ownership
mapping to the remapped uid/gid ranges if user namespaces are enabled.
This fixes ADD operations, similar to the prior fixes for COPY and WORKDIR.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 06d95003b3ddd22d26121280d645e48582a4f931
Component: engine
2016-03-12 23:05:45 -05:00
684bf382b9 Merge pull request #20872 from duglin/Issue20470
Optimize .dockerignore when there are exclusions
Upstream-commit: 9bc62e6031350d1db24e37cfa4983f719ab5e33b
Component: engine
2016-03-04 09:45:19 +01:00
d784a76fa2 Optimize .dockerignore when there are exclusions
Closes #20470

Before this PR we used to scan the entire build context when there were
exclusions in the .dockerignore file (paths that started with !). Now we
only traverse into subdirs when one of the exclusions starts with that dir
path.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 842b8d8784b132279003580eedd0e9c12b885815
Component: engine
2016-03-03 05:46:24 -08:00
fe36785c66 Windows CI: Unit Tests stop running failing archive test
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: f9cfc4c38779ea8f443c79eeb8cc1b81e8e8a5e1
Component: engine
2016-03-01 13:27:44 -08:00
6a88816da7 Merge pull request #20782 from estesp/new-parent-dir-ownership
Fix ownership of non-existing parent dir
Upstream-commit: 67b16c73818726d9818d0229fa6cdda3e5f698b0
Component: engine
2016-03-01 01:45:38 +01:00
848fd14888 Fix ownership of non-existing parent dir
During "COPY" or other tar unpack operations, a target/destination
parent dir might not exist and should be created with ownership of the
root in the right context (including remapped root when user namespaces
are enabled)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 7a61b9ae425e5c100da2bb32b929031c6302b3fb
Component: engine
2016-02-29 09:14:23 -05:00
b1aa8c8912 Clean redundant error message for export
When execute `docker export -o path xxx` and path is a directory docker
has no privilege to write to, daemon will print lots of error logs that
most of them are duplicated and redundant.

This will remove unnecessary error logs and print only once.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 439433099e261d504561d834839fcb936fb7ea95
Component: engine
2016-02-19 18:50:11 +08:00
f5a55660d5 Windows CI: test-unit on pkg\archive part 2
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d6b7819185b003a1e61f9b80cc6123e30143f9c8
Component: engine
2016-02-12 15:40:41 -08:00
9115c5f1b0 Windows CI: test-unit pkg\archive step 1
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1a714e76a2cb9008cd19609059e9988ff1660b78
Component: engine
2016-02-12 10:13:44 -08:00
0b639e2753 Fixing 'docker save' on Windows.
Save was failing file integrity checksums due to bugs in both
Windows and Docker. This commit includes fixes to file time handling
in tarexport and system.chtimes that are necessary along with
the Windows platform fixes to correctly support save. With this
change, sysfile_backups for windowsfilter driver are no longer
needed, so that code is removed.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: 041a9510c671ecf4724bf15388fdb9de549b04ed
Component: engine
2016-02-08 18:08:49 -08:00
3c4fcf6b7a Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: 927b334ebfc786276a039e45ec097e71bf9a104c
Component: engine
2015-12-13 18:04:12 +02:00
439d751051 Skip aufs whiteout files on userns translation to container
aufs kernel module creates whiteout files on upper layer delete (and
other situations) and those files already are 'translated' regarding
ownership in host terms (e.g. they are already "0:0" owned), so when
these layers are copied around with pkg/archive we don't want to try and
translate these files regarding ownership.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 1626c9dae0f285185e3ef4c1e2be55a807e8c0ed
Component: engine
2015-12-09 10:11:32 -05:00
1af1c81aab Merge pull request #18123 from aidanhs/aphs-fail-on-broken-tar
Ensure adding a broken tar doesn't silently fail
Upstream-commit: 1f8efc687cdf8ba98a7332cf9d4401afb8108be6
Component: engine
2015-12-07 14:38:21 +01:00
a047f4a27c Fix for zero-sized layers
Moved a defer up to a better spot.

Fixed TestUntarPathWithInvalidDest to actually fail for the right reason

Closes #18170

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 7bb9fc415ac50abf5f754005264bfe152eeca7d6
Component: engine
2015-11-25 18:02:03 -08:00