Skip to content

Commit a233de0

Browse files
authored
Release 2.0.0 (#63)
Update docs for release
1 parent a39f38f commit a233de0

File tree

2 files changed

+35
-74
lines changed

2 files changed

+35
-74
lines changed

README.md

Lines changed: 34 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
# Docker Image Update Checker Action
22

3+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/lucacome/docker-image-update-checker/badge)](https://scorecard.dev/viewer/?uri=github.com/lucacome/docker-image-update-checker)
34
[![Test](https://github.com/lucacome/docker-image-update-checker/actions/workflows/test.yml/badge.svg)](https://github.com/lucacome/docker-image-update-checker/actions/workflows/test.yml)
45
[![GitHub release badge](https://badgen.net/github/release/lucacome/docker-image-update-checker/stable)](https://github.com/lucacome/docker-image-update-checker/releases/latest)
56
[![GitHub license badge](https://badgen.net/github/license/lucacome/docker-image-update-checker)](https://github.com/lucacome/docker-image-update-checker/blob/main/LICENSE)
67
[![GitHub Workflows badge](https://badgen.net/runkit/lucacome/lucacome-workflow)](https://github.com/search?q=docker-image-update-checker+path%3A.github%2Fworkflows%2F+language%3AYAML&type=Code)
78

8-
Action to check if the base image was updated and your image (published on DockerHub) needs to be rebuilt. This action will use Docker's API to compare the base layers of your image with the `base-image`, without the need to pull the images.
9+
This action checks if a Docker image needs to be updated based on the base image it uses (e.g. `FROM nginx:1.21.0`). By default it checks for all platforms, but you can specify the platforms to check.
910

1011
## Inputs
1112

12-
| Name | Type | Description |
13-
|---------------------|----------|------------------------------------|
14-
| `base-image` | String | Base Docker Image |
15-
| `image` | String | Your image based on `base-image` |
16-
| `platforms` | String | Platforms to check |
13+
| Name | Type | Description |
14+
|--------------|--------|----------------------------------------------------------------------------|
15+
| `base-image` | String | Base Docker Image. This is the image you have as `FROM` in your Dockerfile |
16+
| `image` | String | Your image based on `base-image` |
17+
| `platforms` | String | Platforms to check (default `all`), e.g. `linux/amd64,linux/arm64` |
1718

1819
## Output
1920

20-
| Name | Type | Description |
21-
|-----------------|---------|-----------------------------------------------------------|
22-
| `needs-updating`| String | 'true' or 'false' if the image needs to be updated or not |
21+
| Name | Type | Description |
22+
|------------------|--------|---------------------------------------------------------------------------------------|
23+
| `needs-updating` | String | 'true' or 'false' if the image needs to be updated or not |
24+
| `diff-images` | String | List of images (platforms) that need to be updated |
25+
| `diff-json` | String | JSON output of the images (platforms) that need to be updated with the list of layers |
2326

2427
## Examples
2528

@@ -29,7 +32,7 @@ Action to check if the base image was updated and your image (published on Docke
2932

3033
### Minimal
3134

32-
Check if the image `user/app:latest`, that has `nginx` has a base image, needs to be updated:
35+
Check if the image `user/app:latest`, that has `nginx` as a base image, needs to be updated:
3336

3437
```yaml
3538
name: Check docker image
@@ -44,7 +47,7 @@ jobs:
4447
steps:
4548
- name: Check if update available
4649
id: check
47-
uses: lucacome/docker-image-update-checker@v1
50+
uses: lucacome/docker-image-update-checker@v2.0.0
4851
with:
4952
base-image: nginx:1.21.0
5053
image: user/app:latest
@@ -56,7 +59,7 @@ jobs:
5659

5760
### Single platform
5861

59-
Check if the image `user/app:latest`, that has `nginx` has a base image, needs to be updated:
62+
Check if the image `user/app:latest`, that has `nginx` has a base image, needs to be updated and build and push the image if needed:
6063

6164
```yaml
6265
name: Check docker image
@@ -70,28 +73,25 @@ jobs:
7073
runs-on: ubuntu-latest
7174
steps:
7275
- name: Checkout
73-
uses: actions/checkout@v3
76+
uses: actions/checkout@v4.2.1
7477

7578
- name: Check if update available
7679
id: check
77-
uses: lucacome/docker-image-update-checker@v1
80+
uses: lucacome/docker-image-update-checker@v2.0.0
7881
with:
7982
base-image: nginx:1.21.0
8083
image: user/app:latest
84+
platforms: linux/amd64
8185

8286
- name: Build and push
83-
uses: docker/build-push-action@v3
87+
uses: docker/build-push-action@v6.9.0
8488
with:
8589
context: .
8690
push: true
8791
tags: user/app:latest
8892
if: steps.check.outputs.needs-updating == 'true'
8993
```
9094
91-
> **Note**
92-
>
93-
> The `platforms` input is optional and defaults to `linux/amd64`.
94-
9595
### Multiple platforms
9696
9797
Check if the image `user/app:latest`, that has `nginx` has a base image, needs to be updated for `linux/amd64` and `linux/arm64`:
@@ -109,9 +109,15 @@ jobs:
109109
outputs:
110110
needs-updating: ${{ steps.check.outputs.needs-updating }}
111111
steps:
112+
- name: Login to Docker Registry
113+
uses: docker/[email protected]
114+
with:
115+
username: ${{ secrets.DOCKER_USERNAME }}
116+
password: ${{ secrets.DOCKER_PASSWORD }}
117+
112118
- name: Check if update available
113119
id: check
114-
uses: lucacome/docker-image-update-checker@v1
120+
uses: lucacome/docker-image-update-checker@v2.0.0
115121
with:
116122
base-image: nginx:1.21.0
117123
image: user/app:latest
@@ -123,18 +129,18 @@ jobs:
123129
if: needs.check.outputs.needs-updating == 'true'
124130
steps:
125131
- name: Checkout
126-
uses: actions/checkout@v3
132+
uses: actions/checkout@v4.2.1
127133
128134
- name: Setup QEMU
129-
uses: docker/setup-qemu-action@v2
135+
uses: docker/setup-qemu-action@v3.2.0
130136
with:
131137
platforms: arm64
132138
133139
- name: Docker Buildx
134-
uses: docker/setup-buildx-action@v2
140+
uses: docker/setup-buildx-action@v3.7.1
135141
136142
- name: Build and push
137-
uses: docker/build-push-action@v3
143+
uses: docker/build-push-action@v6.9.0
138144
with:
139145
context: .
140146
push: true
@@ -144,55 +150,10 @@ jobs:
144150

145151
> **Note**
146152
>
147-
> If any of the platforms is not present in either the base-image or the image, the action will exit with an error.
153+
> The `platforms` input is optional and defaults to `all`.
148154

149155
## Debugging
150156

151-
To debug the action, you can set the `DEBUG` environment variable to `true` in the workflow file. The variable can be set at any level.
152-
153-
```yaml
154-
name: Check docker image
155-
156-
on:
157-
schedule:
158-
- cron: '0 4 * * *'
159-
160-
jobs:
161-
docker:
162-
runs-on: ubuntu-latest
163-
steps:
164-
- name: Check if update available
165-
id: check
166-
uses: lucacome/docker-image-update-checker@v1
167-
with:
168-
base-image: nginx:1.21.0
169-
image: user/app:latest
170-
env:
171-
DEBUG: true
172-
```
173-
174-
To make it more convenient, you can use `${{ secrets.ACTIONS_STEP_DEBUG }}` to enable debugging only when needed.
175-
176-
```yaml
177-
name: Check docker image
178-
179-
on:
180-
schedule:
181-
- cron: '0 4 * * *'
182-
183-
jobs:
184-
docker:
185-
runs-on: ubuntu-latest
186-
steps:
187-
- name: Check if update available
188-
id: check
189-
uses: lucacome/docker-image-update-checker@v1
190-
with:
191-
base-image: nginx:1.21.0
192-
image: user/app:latest
193-
env:
194-
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
195-
```
196-
197-
This works even when re-running the action with the `Re-run job` button and the `Enable debug logging` checkbox checked.
198-
To read more about debugging actions, see [Debugging actions](https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging#enabling-step-debug-logging).
157+
If something is not working as expected, you can enable debug logging to get more information (a lot more information).
158+
You can re-run the action with the `Enable debug logging` checkbox checked for a single run or set the `ACTIONS_STEP_DEBUG` secret to `true` in the repository's secrets.
159+
For more information on debugging actions, see [Enabling debug logging](https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging).

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ It is strongly recommended to always use the most recent version of the software
66

77
## Reporting a Vulnerability
88

9-
To report a vulnerability, please use https://github.com/lucacome/docker-image-update-checker/security/advisories/new
9+
To report a vulnerability, please use <https://github.com/lucacome/docker-image-update-checker/security/advisories/new>

0 commit comments

Comments
 (0)