Skip to content

Commit 266c0ea

Browse files
authored
Merge pull request #752 from tonistiigi/v0.6-mount-path-fix
[v0.6] container-driver: fix volume destination for cache
2 parents de7dfb9 + 0b320fa commit 266c0ea

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ on:
55
push:
66
branches:
77
- 'master'
8+
- 'v[0-9]*'
89
tags:
910
- 'v*'
1011
pull_request:
1112
branches:
1213
- 'master'
14+
- 'v[0-9]*'
1315

1416
env:
1517
REPO_SLUG: "docker/buildx-bin"

.github/workflows/validate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ on:
55
push:
66
branches:
77
- 'master'
8+
- 'v[0-9]*'
89
tags:
910
- 'v*'
1011
pull_request:
1112
branches:
1213
- 'master'
14+
- 'v[0-9]*'
1315

1416
env:
1517
REPO_SLUG_ORIGIN: "moby/buildkit:master"

driver/docker-container/driver.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ import (
2222
dockerclient "github.com/docker/docker/client"
2323
"github.com/docker/docker/pkg/stdcopy"
2424
"github.com/moby/buildkit/client"
25-
"github.com/moby/buildkit/util/appdefaults"
2625
"github.com/moby/buildkit/util/tracing/detect"
2726
"github.com/pkg/errors"
2827
)
2928

30-
const volumeStateSuffix = "_state"
29+
const (
30+
volumeStateSuffix = "_state"
31+
32+
// containerStateDir is the location where buildkitd inside the container
33+
// stores its state. The container driver creates a Linux container, so
34+
// this should match the location for Linux, as defined in:
35+
// https://github.com/moby/buildkit/blob/v0.9.0/util/appdefaults/appdefaults_unix.go#L11-L15
36+
containerBuildKitRootDir = "/var/lib/buildkit"
37+
)
3138

3239
type Driver struct {
3340
driver.InitConfig
@@ -111,7 +118,7 @@ func (d *Driver) create(ctx context.Context, l progress.SubLogger) error {
111118
{
112119
Type: mount.TypeVolume,
113120
Source: d.Name + volumeStateSuffix,
114-
Target: appdefaults.Root,
121+
Target: containerBuildKitRootDir,
115122
},
116123
},
117124
}

0 commit comments

Comments
 (0)