mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-03 05:11:37 +00:00
Do not error if cache/config directory not specified
Just use the default. Easier to use as an external library. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
@@ -142,7 +142,7 @@ func outputImage(image *Image, section string, prefix string, m Moby, idMap map[
|
||||
// Build performs the actual build process
|
||||
func Build(m Moby, w io.Writer, pull bool, tp string) error {
|
||||
if MobyDir == "" {
|
||||
return fmt.Errorf("MobyDir for temporary storage not set")
|
||||
MobyDir = defaultMobyConfigDir()
|
||||
}
|
||||
|
||||
iw := tar.NewWriter(w)
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
package moby
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var (
|
||||
// MobyDir is the location of the cache directory which should be set by the caller
|
||||
// MobyDir is the location of the cache directory, defaults to ~/.moby
|
||||
MobyDir string
|
||||
)
|
||||
|
||||
func defaultMobyConfigDir() string {
|
||||
mobyDefaultDir := ".moby"
|
||||
home := homeDir()
|
||||
return filepath.Join(home, mobyDefaultDir)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user