Skip to content

Commit de14739

Browse files
authored
Merge pull request #38 from nesv/fix.entrypoint-path-in-tarchive
internal/oci: Strip leading slashes from tar header
2 parents e772e91 + 5c45dfa commit de14739

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: internal/oci/build.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"io"
2323
"os"
2424
"path/filepath"
25+
"strings"
2526

2627
v1 "github.com/google/go-containerregistry/pkg/v1"
2728
"github.com/google/go-containerregistry/pkg/v1/mutate"
@@ -106,7 +107,7 @@ func tarGoBin(goBinPath, entrypoint string) ([]byte, error) {
106107

107108
err = tw.WriteHeader(&tar.Header{
108109
Mode: 0555,
109-
Name: entrypoint,
110+
Name: strings.TrimPrefix(entrypoint, "/"),
110111
Size: stat.Size(),
111112
Typeflag: tar.TypeReg,
112113
})

0 commit comments

Comments
 (0)