From 97310c07793e421b3eaf5ae4fde750e404df45de Mon Sep 17 00:00:00 2001 From: Bharath Horatti Date: Tue, 17 Sep 2024 21:33:19 +0530 Subject: [PATCH 1/2] fix(): Enable multi arch builds Signed-off-by: Bharath Horatti --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b50250f..63c5562 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ #limitations under the License. ########################################################## -FROM amd64/golang:1.22.5-alpine3.20 AS gobuilder +FROM golang:1.22.5-alpine3.20 AS gobuilder # Install git. @@ -25,6 +25,9 @@ FROM amd64/golang:1.22.5-alpine3.20 AS gobuilder RUN apk update && apk add --no-cache git make build-base +ARG TARGETPLATFORM +ARG TARGETARCH + # Set the Go source path WORKDIR / @@ -35,12 +38,12 @@ COPY . . RUN go mod download &&\ go env -w GOPRIVATE=github.com/kubeslice && \ - CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o bin/kubeslice-gateway-edge main.go + CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o bin/kubeslice-gateway-edge main.go # Build reduced image from base alpine -FROM amd64/alpine:3.20.1 +FROM alpine:3.20.1 # tc - is needed for traffic control and shaping on the sidecar. it is part of the iproute2 @@ -60,4 +63,4 @@ EXPOSE 8080 # Or could be CMD -ENTRYPOINT ["./kubeslice-gateway-edge"] \ No newline at end of file +ENTRYPOINT ["./kubeslice-gateway-edge"] From 84d627f999d15474d693915eb843634aea75d9cb Mon Sep 17 00:00:00 2001 From: Richie Sebastian <104349170+richiesebastian@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:42:24 +0530 Subject: [PATCH 2/2] fix(): Update Jenkinsfile --- Jenkinsfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f86d8bd..73a79c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,10 @@ -@Library('jenkins-library@opensource-helm-pipeline-release') _ -dockerbuildtestPipeline( +@Library('jenkins-library@opensource-release-multiarch') _ +dockerImagePipeline( script: this, - service: 'slicegw-edge', - buildArguments: [PLATFORM:"amd64"], - run_unit_tests: 'false' - + services: ['slicegw-edge'], + dockerfiles: ['Dockerfile'], + pushed: true, + buildArgumentsList: [ + [ENV: 'production', PLATFORM: 'linux/arm64,linux/amd64'] +] ) -