docker / build-push-action

GitHub Action to build and push Docker images with Buildx

Home Page:https://github.com/marketplace/actions/build-and-push-docker-images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing high-level features from v1 in v2 like `tag_with_ref` and `add_git_labels`

garethr opened this issue · comments

The utility in using the action to me, over just running the docker commands manually, was in the high-level interface offered by helpers in v1 like:

  • add_git_labels
  • tag_with_sha
  • tag_with_ref

These all appear to have disappeared in v2. Are these planned to be brought back?

Doing:

-  name: Build and push
   uses: docker/build-push-action@v2
   with:
     push: true
     tags: user/app:latest

Doesn't provide a huge benefit over:

- name: Build and push
  run: |
     docker buildx build --push user/app:latest .

Compared to implementing any of the following which requires lots of logic and loops.

  • add_git_labels
  • tag_with_sha
  • tag_with_ref

Ideally, this would be done in buildkit level moby/buildkit#1569 when building from git instead of a hack in the action so all the build cases can use them.

@tonistiigi that would be great from an implementation point of view, I'd love to be able to use that in other places too.

It doesn't look like #119 will address add_git_labels, which has been a very helpful feature to reverse lookup the git revision from any particular image a user has pulled.

Does anyone have a workaround for add_git_labels?

I'm sorry, somehow I missed that labels was already a supported field of the v2 action.

@itzg Available inputs can be found in the README.

Edit: Complete workflow has been updated.

I published a tag_with_sha and tag_with_ref like action :)

https://github.com/marketplace/actions/generate-smart-tag-for-docker-images