Avoid disk usage explosion when copying busybox
When running runc tests with temp directory with size 500M copying busybox without preserving hardlinks causes the folder to inflate to roughly 330M. Copying busybox twice in certain tests causes the /tmp directory to overfill. Using `-a` preserves links which busybox uses to implement its choice of binary to run. Signed-off-by: Tom Godkin <tgodkin@pivotal.io>
This commit is contained in:
parent
9a1186d128
commit
fdbb9e3e55
|
@ -109,7 +109,7 @@ func remove(dir string) {
|
|||
// copyBusybox copies the rootfs for a busybox container created for the test image
|
||||
// into the new directory for the specific test
|
||||
func copyBusybox(dest string) error {
|
||||
out, err := exec.Command("sh", "-c", fmt.Sprintf("cp -R /busybox/* %s/", dest)).CombinedOutput()
|
||||
out, err := exec.Command("sh", "-c", fmt.Sprintf("cp -a /busybox/* %s/", dest)).CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("copy error %q: %q", err, out)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue