Skip to content

Commit

Permalink
fix(): Enable multi arch builds
Browse files Browse the repository at this point in the history
Signed-off-by: Bharath Horatti <[email protected]>
  • Loading branch information
bharath-avesha committed Sep 17, 2024
1 parent b3f4787 commit 97310c0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@
#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.

# Git is required for fetching the dependencies.

RUN apk update && apk add --no-cache git make build-base

ARG TARGETPLATFORM
ARG TARGETARCH

# Set the Go source path

WORKDIR /
Expand All @@ -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

Expand All @@ -60,4 +63,4 @@ EXPOSE 8080

# Or could be CMD

ENTRYPOINT ["./kubeslice-gateway-edge"]
ENTRYPOINT ["./kubeslice-gateway-edge"]

0 comments on commit 97310c0

Please sign in to comment.