Skip to content

Commit

Permalink
Merge pull request docker#752 from tonistiigi/v0.6-mount-path-fix
Browse files Browse the repository at this point in the history
[v0.6] container-driver: fix volume destination for cache
  • Loading branch information
tonistiigi authored Aug 28, 2021
2 parents de7dfb9 + 0b320fa commit 266c0ea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
push:
branches:
- 'master'
- 'v[0-9]*'
tags:
- 'v*'
pull_request:
branches:
- 'master'
- 'v[0-9]*'

env:
REPO_SLUG: "docker/buildx-bin"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
push:
branches:
- 'master'
- 'v[0-9]*'
tags:
- 'v*'
pull_request:
branches:
- 'master'
- 'v[0-9]*'

env:
REPO_SLUG_ORIGIN: "moby/buildkit:master"
Expand Down
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 266c0ea

Please sign in to comment.