From 2ad4d949955cde550d6fe6c71bb078bd18c5432c Mon Sep 17 00:00:00 2001 From: Ce Gao Date: Wed, 27 Apr 2022 09:22:00 +0800 Subject: [PATCH] fix: Use docker-container as the buildkitd socket (#72) Signed-off-by: Ce Gao --- cmd/midi/build.go | 5 ++--- cmd/midi/up.go | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/midi/build.go b/cmd/midi/build.go index 810e60967..237a66bbd 100644 --- a/cmd/midi/build.go +++ b/cmd/midi/build.go @@ -62,8 +62,7 @@ func build(clicontext *cli.Context) error { tag := clicontext.String("tag") - builder := builder.New( - fmt.Sprintf("docker-container://%s", viper.GetString(flag.FlagBuildkitdContainer)), - config, path, tag) + builder := builder.New(fmt.Sprintf("docker-container://%s", + viper.GetString(flag.FlagBuildkitdContainer)), config, path, tag) return builder.Build(clicontext.Context) } diff --git a/cmd/midi/up.go b/cmd/midi/up.go index a497ec590..813af5739 100644 --- a/cmd/midi/up.go +++ b/cmd/midi/up.go @@ -15,14 +15,17 @@ package main import ( + "fmt" "path/filepath" "github.com/cockroachdb/errors" "github.com/sirupsen/logrus" + "github.com/spf13/viper" cli "github.com/urfave/cli/v2" "github.com/tensorchord/MIDI/pkg/builder" "github.com/tensorchord/MIDI/pkg/docker" + "github.com/tensorchord/MIDI/pkg/flag" "github.com/tensorchord/MIDI/pkg/home" "github.com/tensorchord/MIDI/pkg/ssh" ) @@ -68,7 +71,8 @@ func up(clicontext *cli.Context) error { tag := clicontext.String("tag") - builder := builder.New("unix:///run/buildkit/buildkitd.sock", config, path, tag) + builder := builder.New(fmt.Sprintf("docker-container://%s", + viper.GetString(flag.FlagBuildkitdContainer)), config, path, tag) if err := builder.Build(clicontext.Context); err != nil { return err }