Skip to content

Commit

Permalink
tag image after build, if name is supplied, and reuse it properly
Browse files Browse the repository at this point in the history
  • Loading branch information
oclaussen committed Jun 11, 2018
1 parent 89d99ce commit 8d6d711
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/image/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ func build(ctx context.Context, options Options) (string, error) {
return "", err
}

var tags []string
if options.Name != "" {
tags = append(tags, options.Name)
}

response, err := options.Client.ImageBuild(
ctx,
buildContext,
types.ImageBuildOptions{
Tags: tags,
SuppressOutput: false,
NoCache: options.NoCache,
Remove: true,
Expand Down

0 comments on commit 8d6d711

Please sign in to comment.