Skip to content

Commit

Permalink
feat(build, docker): use buildkit by default (#6401)
Browse files Browse the repository at this point in the history
Signed-off-by: Yaroslav Pershin <62902094+iapershin@users.noreply.github.com>
  • Loading branch information
iapershin authored Nov 12, 2024
1 parent 56ad6ab commit fc7eb8a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,6 @@ require (

replace (
github.com/deislabs/oras => github.com/werf/3p-oras v0.9.1-0.20240115121544-03962ecbd40a // upstream not maintained
github.com/docker/buildx => github.com/werf/3p-docker-buildx v0.13.0-rc2.0.20241024135542-5227009077a4 // upstream not maintained
github.com/docker/buildx => github.com/werf/3p-docker-buildx v0.13.0-rc2.0.20241111114615-d77c2e1444ad // upstream not maintained
github.com/jaguilar/vt100 => github.com/tonistiigi/vt100 v0.0.0-20190402012908-ad4c4a574305 // upstream not maintained
)
7 changes: 2 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,6 @@ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66D
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
github.com/go-git/go-git v4.7.0+incompatible h1:+W9rgGY4DOKKdX2x6HxSR7HNeTxqiKrOvKnuittYVdA=
github.com/go-git/go-git v4.7.0+incompatible/go.mod h1:6+421e08gnZWn30y26Vchf7efgYLe4dl5OQbBSUXShE=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys=
Expand Down Expand Up @@ -1388,8 +1386,8 @@ github.com/weppos/publicsuffix-go v0.13.1-0.20210123135404-5fd73613514e/go.mod h
github.com/weppos/publicsuffix-go v0.15.1-0.20210511084619-b1f36a2d6c0b/go.mod h1:HYux0V0Zi04bHNwOHy4cXJVz/TQjYonnF6aoYhj+3QE=
github.com/weppos/publicsuffix-go v0.30.2-0.20240219083929-48f3a5ae027a h1:s0Yp4S5jdEQFTJE1blGE5o+n7T0uI386YHXzocLKLR4=
github.com/weppos/publicsuffix-go v0.30.2-0.20240219083929-48f3a5ae027a/go.mod h1:v7j8MuFp1CIYgAd2n7xEUctTbsreRd1vPmOwyzmGFiE=
github.com/werf/3p-docker-buildx v0.13.0-rc2.0.20241024135542-5227009077a4 h1:J6qNuakRzaeXg5tLgUfowm2Kh2/S5XAzuEzpc3f1IuM=
github.com/werf/3p-docker-buildx v0.13.0-rc2.0.20241024135542-5227009077a4/go.mod h1:Q3gtkv8D3sdaa5LJXbzMooYR/A5vBiEB2yQ56wywohM=
github.com/werf/3p-docker-buildx v0.13.0-rc2.0.20241111114615-d77c2e1444ad h1:FBDNACfjjpDBwXhALF5LgvEiu08HpUurb/2G323SVsQ=
github.com/werf/3p-docker-buildx v0.13.0-rc2.0.20241111114615-d77c2e1444ad/go.mod h1:Q3gtkv8D3sdaa5LJXbzMooYR/A5vBiEB2yQ56wywohM=
github.com/werf/3p-helm v0.0.0-20240806141915-3137f4cc1557 h1:TCC9i3qb4Db+7Z6jgbLwWCWyV/kKvdTezmGUqLtdF54=
github.com/werf/3p-helm v0.0.0-20240806141915-3137f4cc1557/go.mod h1:YJhOllAD8LqSnsocDhkwqOxaqOoxSnVbXwhcbqptkZg=
github.com/werf/3p-oras v0.9.1-0.20240115121544-03962ecbd40a h1:PsU9szHZlIH+CjcuIuPXRLc5dsdoaFldvYjS6YHI7YQ=
Expand Down Expand Up @@ -2067,7 +2065,6 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1/go.mod h1:WbjuEoo1oadwzQ4apSDU+JTvmllEHtsNHS6y7vFc7iw=
gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2 h1:tczPZjdz6soV2thcuq1IFOuNLrBUGonFyUXBbIWXWis=
gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2/go.mod h1:c7Wo0IjB7JL9B9Avv0UZKorYJCUhiergpj3u1WtGT1E=
gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg=
gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98=
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
Expand Down
1 change: 1 addition & 0 deletions pkg/build/build_phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (phase *BuildPhase) AfterImages(ctx context.Context) error {
imagesPairs := phase.Conveyor.imagesTree.GetImagesByName(false)
if err := parallel.DoTasks(ctx, len(imagesPairs), parallel.DoTasksOptions{
MaxNumberOfWorkers: int(phase.Conveyor.ParallelTasksLimit),
LiveOutput: true,
}, func(ctx context.Context, taskId int) error {
pair := imagesPairs[taskId]

Expand Down
8 changes: 3 additions & 5 deletions pkg/docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ func Init(ctx context.Context, opts InitOptions) error {
}
}

if v := os.Getenv("DOCKER_BUILDKIT"); v == "1" || v == "true" {
if err := os.Setenv("DOCKER_BUILDKIT", "0"); err != nil {
return fmt.Errorf("unable to set env var: %w", err)
}
useBuildx = true
useBuildx = true // use buildKit by default
if v := os.Getenv("DOCKER_BUILDKIT"); v == "0" || v == "false" {
useBuildx = false
}

return nil
Expand Down

0 comments on commit fc7eb8a

Please sign in to comment.