Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup multiarch using cross arch builds. #66

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
FROM golang:1.20-bullseye AS build-plugin
FROM --platform=$BUILDPLATFORM golang:1.22-bullseye AS build-plugin
ENV GOPROXY=https://proxy.golang.org
ENV PROJECTPATH=/go/src/github.com/replicatedhq/local-volume-provider/local-volume-fileserver
ARG TARGETARCH
ARG BUILDPLATFORM
WORKDIR $PROJECTPATH
COPY Makefile ./
COPY go.mod ./
COPY go.sum ./
COPY cmd ./cmd
COPY pkg ./pkg
ARG VERSION=main
RUN CGO_ENABLED=0 go build -ldflags=" -X github.com/replicatedhq/local-volume-provider/pkg/version.version=$VERSION " -o /go/bin/local-volume-provider ./cmd/local-volume-provider
RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} go build -ldflags=" -X github.com/replicatedhq/local-volume-provider/pkg/version.version=$VERSION " -o /go/bin/local-volume-provider ./cmd/local-volume-provider

FROM golang:1.20-bullseye as build-fileserver
FROM --platform=$BUILDPLATFORM golang:1.22-bullseye AS build-fileserver
ENV GOPROXY=https://proxy.golang.org
ENV PROJECTPATH=/go/src/github.com/replicatedhq/local-volume-provider/local-volume-fileserver
WORKDIR $PROJECTPATH
Expand All @@ -20,7 +22,7 @@ COPY go.sum ./
COPY cmd ./cmd
COPY pkg ./pkg
ARG VERSION=main
RUN CGO_ENABLED=0 go build -ldflags=" -X github.com/replicatedhq/local-volume-provider/pkg/version.version=$VERSION " -o /go/bin/local-volume-fileserver ./cmd/local-volume-fileserver
RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} go build -ldflags=" -X github.com/replicatedhq/local-volume-provider/pkg/version.version=$VERSION " -o /go/bin/local-volume-fileserver ./cmd/local-volume-fileserver

FROM debian:bullseye-slim
RUN mkdir /plugins
Expand Down