diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index eb90d98..3d0b5b1 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -39,6 +39,10 @@ on: description: "Enable Hadolint" default: true type: boolean + platforms: + description: "Build platforms" + default: "linux/amd64,linux/arm64" + type: string secrets: username: required: false @@ -71,7 +75,7 @@ jobs: with: context: ${{ inputs.context }} file: ${{ inputs.dockerfile }} - platforms: linux/amd64,linux/arm64 + platforms: ${{ inputs.platforms }} push: ${{ inputs.push }} tags: ${{ inputs.image-name }}:${{ inputs.image-tag }} diff --git a/docker-build/README.md b/docker-build/README.md index 2f09c92..9c56fd8 100644 --- a/docker-build/README.md +++ b/docker-build/README.md @@ -17,17 +17,18 @@ This reusable GitHub Actions workflow automates the process of building and push ## ⚙️ Inputs -| Name | Description | Required | Default | -| ----------------- | ---------------------------------------------------------------------------------- | -------- | -------------- | -| `image-name` | Name of Docker Image (e.g., 'myimage', 'myorg/myimage') | true | - | -| `image-tag` | Tag to apply to the built image (e.g., 'latest', 'v1.2.3') | No | `"latest"` | -| `dockerfile` | Path to the Dockerfile to build (e.g., './Dockerfile', './docker/Dockerfile') | No | `"Dockerfile"` | -| `context` | Path to Docker Build Context | No | `"."` | -| `registry` | Docker Registry | No | `"docker.io"` | -| `push` | Push Docker Image to Registry | No | `false` | -| `security-scan` | Enable Trivy Security Scan | No | `true` | -| `security-report` | Security Report Mode (`"sarif"` \| `"comment"`; ignored if `security-scan: false`) | No | `"sarif"` | -| `hadolint` | Enable Hadolint | No | `true` | +| Name | Description | Required | Default | +| ----------------- | ---------------------------------------------------------------------------------- | -------- | --------------------------- | +| `image-name` | Name of Docker Image (e.g., 'myimage', 'myorg/myimage') | true | - | +| `image-tag` | Tag to apply to the built image (e.g., 'latest', 'v1.2.3') | No | `"latest"` | +| `dockerfile` | Path to the Dockerfile to build (e.g., './Dockerfile', './docker/Dockerfile') | No | `"Dockerfile"` | +| `context` | Path to Docker Build Context | No | `"."` | +| `platforms` | Indicates which platforms the image should be built for | No | `"linux/amd64,linux/arm64"` | +| `registry` | Docker Registry | No | `"docker.io"` | +| `push` | Push Docker Image to Registry | No | `false` | +| `security-scan` | Enable Trivy Security Scan | No | `true` | +| `security-report` | Security Report Mode (`"sarif"` \| `"comment"`; ignored if `security-scan: false`) | No | `"sarif"` | +| `hadolint` | Enable Hadolint | No | `true` | ## 🔐 Secrets