Add lib support as an option

Some images like `criu` will have extra libs that it requires.  This
adds lib support via LD_LIBRARY_PATH and InstallOpts

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-08-01 15:49:39 -04:00
parent 1537f31381
commit 5a47c5ec1d
9 changed files with 101 additions and 11 deletions

View File

@@ -158,7 +158,11 @@ func applyNaive(ctx context.Context, root string, tr *tar.Reader, options ApplyO
// Normalize name, for safety and for a simple is-root check
hdr.Name = filepath.Clean(hdr.Name)
if !options.Filter(hdr) {
accept, err := options.Filter(hdr)
if err != nil {
return 0, err
}
if !accept {
continue
}

View File

@@ -22,11 +22,11 @@ import "archive/tar"
type ApplyOpt func(options *ApplyOptions) error
// Filter specific files from the archive
type Filter func(*tar.Header) bool
type Filter func(*tar.Header) (bool, error)
// all allows all files
func all(_ *tar.Header) bool {
return true
func all(_ *tar.Header) (bool, error) {
return true, nil
}
// WithFilter uses the filter to select which files are to be extracted.