Skip to content

Labels key does not apply labels to images #747

@pentago

Description

@pentago

Behaviour

Steps to reproduce this issue

  1. Setup regular, simple image build/tag/push workflow containing labels key:
- name: Build Docker Image
  id: build_api
  uses: docker/[email protected]
  with:
    context: .
    file: ./Dockerfile
    labels: |
      "commit=${{ env.SHA_SHORT }}"
      "commit_url=${{ env.COMMIT_URL }}/${{ env.SHA_SHORT }}"
    tags: |
      something:latest
    cache-to: type=gha,mode=max
    cache-from: type=gha
    push: true

Expected behaviour

Using docker image inspect should list above labels in JSON output.

Actual behaviour

No labels were shown in the JSON output as they likely aren't applied in the first place.

Logs

Build logs actually show that propper strings are being used, I just don't see those applied to the image when doing inspect:
build logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions