Skip to content

Commit

Permalink
Merge pull request #242 from depot/remove-cwd-prefix
Browse files Browse the repository at this point in the history
Strip cwd:// prefix from incoming files
  • Loading branch information
jacobwgillespie authored Jan 26, 2024
2 parents 6bd3f2c + ac6b4d3 commit 6ca1c82
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/buildx/commands/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"fmt"
"os"
"strings"
"sync"

"github.com/containerd/containerd/platforms"
Expand Down Expand Up @@ -223,6 +224,13 @@ func BakeCmd(dockerCli command.Cli) *cobra.Command {
Aliases: []string{"f"},
Short: "Build from a file",
RunE: func(cmd *cobra.Command, args []string) error {
// TODO: remove when upgrading to buildx 0.12
for idx, file := range options.files {
if strings.HasPrefix(file, "cwd://") {
options.files[idx] = strings.TrimPrefix(file, "cwd://")
}
}

if options.printOnly {
if isRemoteTarget(args) {
return errors.New("cannot use remote target with --print")
Expand Down

0 comments on commit 6ca1c82

Please sign in to comment.