Skip to content

Commit

Permalink
Remove target root prefix path from library path
Browse files Browse the repository at this point in the history
When using the TargetRoot option where libraries must be added to the image,
the entire host path was used in the image. This change removes the TargetRoot
path from the host library path to create the correct path for the image.
  • Loading branch information
sanderssj committed Aug 8, 2021
1 parent 842992f commit 7a36f81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func (m *Manifest) AddFileTo(dir map[string]interface{}, filepath string, hostpa

// AddLibrary to add a dependent library
func (m *Manifest) AddLibrary(path string) {
parts := strings.FieldsFunc(path, func(c rune) bool { return c == '/' })
parts := strings.FieldsFunc(strings.TrimPrefix(path, m.targetRoot), func(c rune) bool { return c == '/' })
node := m.rootDir()
for i := 0; i < len(parts)-1; i++ {
node = mkDir(node, parts[i])
Expand Down

0 comments on commit 7a36f81

Please sign in to comment.