diff --git a/file/file.go b/file/file.go index 9f9cdc9..9f9625e 100644 --- a/file/file.go +++ b/file/file.go @@ -364,7 +364,11 @@ func (d *Dapperfile) tag() string { } tag = re.ReplaceAllLiteralString(tag, "-") - return fmt.Sprintf("%s:%s", cwd, tag) + cwd = strings.TrimSpace(cwd) + reg := regexp.MustCompile(`[\W|_]{1,}`) + img := reg.ReplaceAllString(cwd, "-") + + return fmt.Sprintf("%s:%s", img, tag) } func (d *Dapperfile) run(args ...string) error {