Skip to content

Commit

Permalink
Merge pull request moby#1273 from thaJeztah/fix_invalid_stagename_error
Browse files Browse the repository at this point in the history
frontend/dockerfile: show original stagename in error-message
  • Loading branch information
tonistiigi authored Nov 26, 2019
2 parents adfc3dd + 2105de3 commit b1f8375
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/dockerfile/instructions/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func parseBuildStageName(args []string) (string, error) {
case len(args) == 3 && strings.EqualFold(args[1], "as"):
stageName = strings.ToLower(args[2])
if ok, _ := regexp.MatchString("^[a-z][a-z0-9-_\\.]*$", stageName); !ok {
return "", errors.Errorf("invalid name for build stage: %q, name can't start with a number or contain symbols", stageName)
return "", errors.Errorf("invalid name for build stage: %q, name can't start with a number or contain symbols", args[2])
}
case len(args) != 1:
return "", errors.New("FROM requires either one or three arguments")
Expand Down

0 comments on commit b1f8375

Please sign in to comment.