diff --git a/internal/volume/volume.go b/internal/volume/volume.go index 617ff410..865e2adb 100644 --- a/internal/volume/volume.go +++ b/internal/volume/volume.go @@ -65,6 +65,11 @@ func Mount(workDirHost string, cacheDirHost string) (Volume, error) { if err != nil { return Volume{}, err } + } else { + workDirHost, err = filepath.Abs(workDirHost) + if err != nil { + return Volume{}, fmt.Errorf("could not make the root directory %s an absolute path: %w", workDirHost, err) + } } if cacheDirHost == "" { @@ -72,6 +77,11 @@ func Mount(workDirHost string, cacheDirHost string) (Volume, error) { if err != nil { return Volume{}, err } + } else { + cacheDirHost, err = filepath.Abs(cacheDirHost) + if err != nil { + return Volume{}, fmt.Errorf("could not make the cache directory %s an absolute path: %w", cacheDirHost, err) + } } l := Volume{