Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Implement multi tag for build #771

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

ulyssessouza
Copy link
Contributor

Add multitag support for build

Note that with this implementation, building multiple times with different tags and building just one with multiple tags doesn't produce the same output. Check this:
asciicast

- What I did
Added the option to use multiple tags to an app image

- How I did it
By turning the tag option into a list

- How to verify it

$ docker app build -t hello:v1 -t hello:v2 example/hello-world

- Description for the changelog
Add multitag support for build

- A picture of a cute animal (not mandatory)
twin-goats

@silvin-lubecki
Copy link
Contributor

You have different IDs as we now insert the build time into the bundle.json... So the digest will differ each time you build.

@ulyssessouza
Copy link
Contributor Author

@silvin-lubecki Yep! And I think that's strange/inconsistent.
Makes me feel that this kind of info would be better outside of the bundle.json.

internal/commands/build/build.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 28, 2019

Codecov Report

Merging #771 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #771   +/-   ##
======================================
  Coverage    71.1%   71.1%           
======================================
  Files          67      67           
  Lines        3835    3835           
======================================
  Hits         2727    2727           
  Misses        756     756           
  Partials      352     352

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d198096...09d931a. Read the comment docs.

Copy link
Contributor

@zappy-shu zappy-shu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return nil, err
}
once.Do(func() {
fmt.Fprintf(out, "Successfully built app %s\n", id.String())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text changed, is that ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something I would like to discuss.
The SHA that this message shows is not an image, but a bundle. This is exactly the same message shown by the "normal builder" and docker-compose to show the SHA of a docker image.
IMO, that's confusing to have this message building another thing and saying the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, actually it's an image... Not a container image but still :)
Any opinion @ndeloof as you first wrote this log I guess?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"app image" is the recommended name for this (se naming doc)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason to show status this way is to "mimic the docker CLI" as our UX mantra :P

Copy link
Contributor Author

@ulyssessouza ulyssessouza Dec 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm... Looks like now we have 3 alternatives:

  • "Successfully built"
  • "Successfully built app"
  • "Successfully built app image"

What do you think @chris-crone @zappy-shu @aiordache ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With BuildKit the final line is:

=> => writing image sha256:6f71466d421e3ab378cf91c03bfd4d00ecfc1ba7dc3a37ccb69c02b2ef0a2f6b

Without, it's:

Successfully built 965ea09ff2eb

I would say that we should use option 3 to make sure that it's clear.

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are also missing a test here 😸

internal/commands/build/build.go Show resolved Hide resolved
return nil, err
}
once.Do(func() {
fmt.Fprintf(out, "Successfully built app %s\n", id.String())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason to show status this way is to "mimic the docker CLI" as our UX mantra :P

Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silvin-lubecki silvin-lubecki merged commit c51fa99 into docker:master Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants