mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-08-05 16:53:48 +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:
parent
e3a7739f42
commit
6395e339b9
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user