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:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/pkg/errors"
|
||||
@@ -49,6 +50,15 @@ func init() {
|
||||
if err := os.Setenv("PATH", fmt.Sprintf("%s:%s", bin, os.Getenv("PATH"))); err != nil {
|
||||
return nil, errors.Wrapf(err, "set binary image directory in path %s", bin)
|
||||
}
|
||||
if runtime.GOOS != "windows" {
|
||||
lib := filepath.Join(path, "lib")
|
||||
if err := os.MkdirAll(lib, 0711); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := os.Setenv("LD_LIBRARY_PATH", fmt.Sprintf("%s:%s", os.Getenv("LD_LIBRARY_PATH"), lib)); err != nil {
|
||||
return nil, errors.Wrapf(err, "set binary lib directory in path %s", lib)
|
||||
}
|
||||
}
|
||||
return &manager{}, nil
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user