Skip to content

Commit

Permalink
Fixing out of memory with Usage:
Browse files Browse the repository at this point in the history
  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 <[email protected]>
  • Loading branch information
jjbustamante committed Sep 6, 2023
1 parent 549e7b8 commit 241739e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/buildpack/buildpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,9 @@ func toNLayerTar(origID, origVersion string, firstHeader *tar.Header, tr *tar.Re
return fmt.Errorf("failed to write header for '%s': %w", header.Name, err)
}

buf, err := io.ReadAll(tr)
_, err = io.Copy(mt.writer, tr)
if err != nil {
return fmt.Errorf("failed to read contents of '%s': %w", header.Name, err)
}

_, err = mt.writer.Write(buf)
if err != nil {
return fmt.Errorf("failed to write contents to '%s': %w", header.Name, err)
return errors.Wrapf(err, "failed to write contents to '%s'", header.Name)
}
}
}
Expand Down

0 comments on commit 241739e

Please sign in to comment.