Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
anchor

GitHub Action

Docker Image Update Checker

v1.1.0

Docker Image Update Checker

anchor

Docker Image Update Checker

GitHub Action to check if the base Docker image that your image is based on was updated and your image needs to be updated

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Docker Image Update Checker

uses: lucacome/docker-image-update-checker@v1.1.0

Learn more about this action in lucacome/docker-image-update-checker

Choose a version

Docker Image Update Checker Action

Action to check if the base image was updated and your image (published on DockerHub) needs to be rebuilt

Inputs

Name Type Description
base-image String Base Docker Image
image String Your image based on base-image

Note: the base-image needs to have the full path. For example for official images like nginx, the full path is library/nginx.

Output

Name Type Description
needs-updating String 'true' or 'false' if the image needs to be updated or not

Example

name: check docker images

on:
  schedule:
    - cron:  '0 4 * * *'

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Check if update available
        id: check
        uses: lucacome/docker-image-update-checker@v1
        with:
          base-image: library/nginx:1.21.0
          image: user/app:latest
      -
        name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          push: true
          tags: user/app:latest
        if: steps.check.outputs.needs-updating == 'true'