Add optional install path
This allows users to consume the install functionality but also install to other areas instead of the managed `/opt` dir. ```bash > ctr install --path /usr/local ``` Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -25,6 +25,8 @@ type InstallConfig struct {
|
||||
Libs bool
|
||||
// Replace will overwrite existing binaries or libs in the opt directory
|
||||
Replace bool
|
||||
// Path to install libs and binaries to
|
||||
Path string
|
||||
}
|
||||
|
||||
// WithInstallLibs installs libs from the image
|
||||
@@ -36,3 +38,10 @@ func WithInstallLibs(c *InstallConfig) {
|
||||
func WithInstallReplace(c *InstallConfig) {
|
||||
c.Replace = true
|
||||
}
|
||||
|
||||
// WithInstallPath sets the optional install path
|
||||
func WithInstallPath(path string) InstallOpts {
|
||||
return func(c *InstallConfig) {
|
||||
c.Path = path
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user