Skip to content

Commit

Permalink
Merge pull request #751 from thaJeztah/fix_mount_path
Browse files Browse the repository at this point in the history
container-driver: fix volume destination for cache
  • Loading branch information
tonistiigi authored Aug 28, 2021
2 parents a8a3b17 + 93867d0 commit 7f322ca
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions driver/docker-container/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ import (
dockerclient "github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/util/appdefaults"
"github.com/moby/buildkit/util/tracing/detect"
"github.com/pkg/errors"
)

const volumeStateSuffix = "_state"
const (
volumeStateSuffix = "_state"

// containerStateDir is the location where buildkitd inside the container
// stores its state. The container driver creates a Linux container, so
// this should match the location for Linux, as defined in:
// https://github.com/moby/buildkit/blob/v0.9.0/util/appdefaults/appdefaults_unix.go#L11-L15
containerBuildKitRootDir = "/var/lib/buildkit"
)

type Driver struct {
driver.InitConfig
Expand Down Expand Up @@ -111,7 +118,7 @@ func (d *Driver) create(ctx context.Context, l progress.SubLogger) error {
{
Type: mount.TypeVolume,
Source: d.Name + volumeStateSuffix,
Target: appdefaults.Root,
Target: containerBuildKitRootDir,
},
},
}
Expand Down

0 comments on commit 7f322ca

Please sign in to comment.