Skip to content

Commit

Permalink
dockerfile: allow ssh git urls for named contexts
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed May 13, 2022
1 parent 55f0ecf commit 3b04769
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/dockerfile/builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,10 @@ func contextByName(ctx context.Context, c client.Client, name string, platform *
if len(vv) != 2 {
return nil, nil, nil, errors.Errorf("invalid context specifier %s for %s", v, name)
}
// allow git@ without protocol for SSH URLs for backwards compatibility
if strings.HasPrefix(vv[0], "git@") {
vv[0] = "git"
}
switch vv[0] {
case "docker-image":
ref := strings.TrimPrefix(vv[1], "//")
Expand Down

0 comments on commit 3b04769

Please sign in to comment.