Skip to content

Commit 1d02b7e

Browse files
feat: variabilize docker build platforms (#81)
1 parent e9b92bc commit 1d02b7e

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.github/workflows/docker-build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ on:
3939
description: "Enable Hadolint"
4040
default: true
4141
type: boolean
42+
platforms:
43+
description: "Build platforms"
44+
default: "linux/amd64,linux/arm64"
45+
type: string
4246
secrets:
4347
username:
4448
required: false
@@ -71,7 +75,7 @@ jobs:
7175
with:
7276
context: ${{ inputs.context }}
7377
file: ${{ inputs.dockerfile }}
74-
platforms: linux/amd64,linux/arm64
78+
platforms: ${{ inputs.platforms }}
7579
push: ${{ inputs.push }}
7680
tags: ${{ inputs.image-name }}:${{ inputs.image-tag }}
7781

docker-build/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ This reusable GitHub Actions workflow automates the process of building and push
1717

1818
## ⚙️ Inputs
1919

20-
| Name | Description | Required | Default |
21-
| ----------------- | ---------------------------------------------------------------------------------- | -------- | -------------- |
22-
| `image-name` | Name of Docker Image (e.g., 'myimage', 'myorg/myimage') | true | - |
23-
| `image-tag` | Tag to apply to the built image (e.g., 'latest', 'v1.2.3') | No | `"latest"` |
24-
| `dockerfile` | Path to the Dockerfile to build (e.g., './Dockerfile', './docker/Dockerfile') | No | `"Dockerfile"` |
25-
| `context` | Path to Docker Build Context | No | `"."` |
26-
| `registry` | Docker Registry | No | `"docker.io"` |
27-
| `push` | Push Docker Image to Registry | No | `false` |
28-
| `security-scan` | Enable Trivy Security Scan | No | `true` |
29-
| `security-report` | Security Report Mode (`"sarif"` \| `"comment"`; ignored if `security-scan: false`) | No | `"sarif"` |
30-
| `hadolint` | Enable Hadolint | No | `true` |
20+
| Name | Description | Required | Default |
21+
| ----------------- | ---------------------------------------------------------------------------------- | -------- | --------------------------- |
22+
| `image-name` | Name of Docker Image (e.g., 'myimage', 'myorg/myimage') | true | - |
23+
| `image-tag` | Tag to apply to the built image (e.g., 'latest', 'v1.2.3') | No | `"latest"` |
24+
| `dockerfile` | Path to the Dockerfile to build (e.g., './Dockerfile', './docker/Dockerfile') | No | `"Dockerfile"` |
25+
| `context` | Path to Docker Build Context | No | `"."` |
26+
| `platforms` | Indicates which platforms the image should be built for | No | `"linux/amd64,linux/arm64"` |
27+
| `registry` | Docker Registry | No | `"docker.io"` |
28+
| `push` | Push Docker Image to Registry | No | `false` |
29+
| `security-scan` | Enable Trivy Security Scan | No | `true` |
30+
| `security-report` | Security Report Mode (`"sarif"` \| `"comment"`; ignored if `security-scan: false`) | No | `"sarif"` |
31+
| `hadolint` | Enable Hadolint | No | `true` |
3132

3233
## 🔐 Secrets
3334

0 commit comments

Comments
 (0)