Skip to content

Commit f5b9076

Browse files
committed
Fixing out of memory with Usage:
pack builder create <image-name> --config <builder-config-path> [flags] Examples: pack builder create my-builder:bionic --config ./builder.toml Flags: -R, --buildpack-registry string Buildpack Registry by name -c, --config string Path to builder TOML file (required) --depth int Max depth to flatten each composite buildpack. Omission of this flag or values < 0 will flatten the entire tree. (default -1) --flatten Flatten each composite buildpack into a single layer -e, --flatten-exclude strings Buildpacks to exclude from flattening, in the form of '<buildpack-id>@<buildpack-version>' -h, --help Help for 'create' --publish Publish to registry --pull-policy string Pull policy to use. Accepted values are always, never, and if-not-present. The default is always Global Flags: --no-color Disable color output -q, --quiet Show less output --timestamps Enable timestamps in output -v, --verbose Show more output using pack 0.30 Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
1 parent b0d4f27 commit f5b9076

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

pkg/buildpack/buildpack.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,9 @@ func toNLayerTar(origID, origVersion string, firstHeader *tar.Header, tr *tar.Re
446446
return fmt.Errorf("failed to write header for '%s': %w", header.Name, err)
447447
}
448448

449-
buf, err := io.ReadAll(tr)
449+
_, err = io.Copy(mt.writer, tr)
450450
if err != nil {
451-
return fmt.Errorf("failed to read contents of '%s': %w", header.Name, err)
452-
}
453-
454-
_, err = mt.writer.Write(buf)
455-
if err != nil {
456-
return fmt.Errorf("failed to write contents to '%s': %w", header.Name, err)
451+
return errors.Wrapf(err, "failed to write contents to '%s'", header.Name)
457452
}
458453
}
459454
}

0 commit comments

Comments
 (0)