Skip to content

Commit 51999d7

Browse files
authored
Merge pull request #13 from achoimet/main
Docker multi platform build and go mod update
2 parents 660be01 + 1b716dd commit 51999d7

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

.github/workflows/pre-release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,32 @@ jobs:
2424
- name: Checkout repository
2525
uses: actions/checkout@v4
2626

27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v3
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
2732
- name: Log in to the Container registry
28-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
33+
uses: docker/login-action@v3
2934
with:
3035
registry: ${{ env.REGISTRY }}
3136
username: ${{ github.actor }}
3237
password: ${{ secrets.GITHUB_TOKEN }}
3338

3439
- name: Extract metadata (tags, labels) for Docker
3540
id: meta
36-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
41+
uses: docker/metadata-action@v5
3742
with:
3843
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3944

4045
- name: Build and push Docker image
4146
id: push
42-
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
47+
uses: docker/build-push-action@v6
4348
with:
4449
context: .
4550
push: true
51+
platforms: linux/amd64,linux/arm64
52+
provenance: false
4653
tags: ${{ steps.meta.outputs.tags }}
4754
labels: ${{ steps.meta.outputs.labels }}
4855

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,34 @@ jobs:
2424
- name: Checkout repository
2525
uses: actions/checkout@v4
2626

27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v3
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
2732
- name: Log in to the Container registry
28-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
33+
uses: docker/login-action@v3
2934
with:
3035
registry: ${{ env.REGISTRY }}
3136
username: ${{ github.actor }}
3237
password: ${{ secrets.GITHUB_TOKEN }}
3338

3439
- name: Extract metadata (tags, labels) for Docker
3540
id: meta
36-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
41+
uses: docker/metadata-action@v5
3742
with:
3843
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3944

4045
- name: Build and push Docker image
4146
id: push
42-
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
47+
uses: docker/build-push-action@v6
4348
with:
4449
context: .
4550
push: true
4651
tags: ${{ steps.meta.outputs.tags }}
4752
labels: ${{ steps.meta.outputs.labels }}
53+
platforms: linux/amd64,linux/arm64
54+
provenance: false
4855

4956
- name: Generate artifact attestation
5057
uses: actions/attest-build-provenance@v1

Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
FROM golang:1.24-alpine3.22 as builder
1+
FROM golang:1.25-alpine3.22 AS builder
2+
ARG TARGETOS TARGETARCH TARGETVARIANT
23
WORKDIR /app
34
COPY . .
4-
RUN
5-
RUN go build -ldflags "-s -w" -o main main.go
5+
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w" -o main main.go
66

77
FROM alpine:3.22
8-
RUN apk update
9-
RUN apk upgrade --no-cache libcrypto3 libssl3 openssl
10-
RUN apk --no-cache add ca-certificates
8+
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 openssl && apk --no-cache add ca-certificates
119
RUN addgroup -S app && adduser -S app -G app
1210
WORKDIR /app
1311
COPY --from=builder /app/main .

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/csepulveda/trivy-webhook-aws-security-hub
22

3-
go 1.24.4
4-
5-
toolchain go1.24.5
3+
go 1.25.4
64

75
require (
86
github.com/aquasecurity/trivy-operator v0.27.2

0 commit comments

Comments
 (0)