Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent adding latest tag #161

Closed
nodesocket opened this issue Jan 18, 2022 · 2 comments
Closed

Prevent adding latest tag #161

nodesocket opened this issue Jan 18, 2022 · 2 comments

Comments

@nodesocket
Copy link

nodesocket commented Jan 18, 2022

It seems the tag latest is automatically being applied when running this action. How can I prevent adding the latest tag?

      - name: Extract metadata (tags, labels) for Docker image
        id: metadata
        uses: docker/metadata-action@v3
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

      - name: Build and push Docker image
        uses: docker/build-push-action@v2
        with:
          context: .
          push: true
          tags: ${{ steps.metadata.outputs.tags }}
          labels: ${{ steps.metadata.outputs.labels }}
@crazy-max crazy-max transferred this issue from docker/build-push-action Jan 18, 2022
@crazy-max
Copy link
Member

crazy-max commented Jan 18, 2022

@nodesocket If you don't want the latest tag to be automatically generated, set latest=false for the flavor input:

      - name: Extract metadata (tags, labels) for Docker image
        uses: docker/metadata-action@v3
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          flavor: |
            latest=false

@nodesocket
Copy link
Author

@crazy-max that worked. Thanks for the help. 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants