An open API service indexing awesome lists of open source software.

https://github.com/flownative/action-docker-get-label

Github action which inspects a given Docker image and returns the value of a specified label
https://github.com/flownative/action-docker-get-label

build-automation docker github-action

Last synced: about 2 months ago
JSON representation

Github action which inspects a given Docker image and returns the value of a specified label

Awesome Lists containing this project

README

        

# "Get Docker Image Label" Github Action

This Github action inspects a given Docker image and returns the value
of a specified label.

Consider a Docker image tagged as "flownative/php:7.4". This image
contains a label "org.label-schema.version" in its metadata which tells
the full PHP version number "7.4.4". Using this action, you can retrieve
this version number for further processing in your workflow.

## Example workflow

````yaml
# …
jobs:
build:
runs-on: ubuntu-latest
steps:
# …
- name: Determine latest version
id: latest_php_version
uses: flownative/action-docker-get-label@v1
with:
image: flownative/php:7.4
label: org.label-schema.version
registry_username: github
registry_password: ${{ secrets.GITHUB_BOT_TOKEN }}
registry_endpoint: https://docker.pkg.github.com/v2/

- name: Build Docker image
uses: flownative/action-docker-build@v1
env:
PHP_VERSION: ${{ steps.latest_php_version.outputs.value }}
with:
# …
````