diff --git a/pkg/helpers/docker/docker.go b/pkg/helpers/docker/docker.go index bef008f9..90222a7e 100644 --- a/pkg/helpers/docker/docker.go +++ b/pkg/helpers/docker/docker.go @@ -23,6 +23,7 @@ import ( "strings" "github.com/containerd/containerd/images" + fileHelper "github.com/mudler/luet/pkg/helpers/file" "github.com/mudler/luet/pkg/helpers/imgworker" continerdarchive "github.com/containerd/containerd/archive" @@ -204,6 +205,12 @@ func DownloadAndExtractDockerImage(temp, image, dest string, auth *types.AuthCon return privilegedExtractImage(temp, image, dest, auth, verify) } + if !fileHelper.Exists(dest) { + if err := os.MkdirAll(dest, os.ModePerm); err != nil { + return nil, errors.Wrapf(err, "cannot create destination directory") + } + } + ref, err := name.ParseReference(image) if err != nil { return nil, err