File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 1- FROM golang:1.19-alpine as gobuild
1+ # Golang can cross-compile
2+ FROM --platform=$BUILDPLATFORM golang:1.19-alpine as gobuild
23
34WORKDIR /build
45ADD go.mod go.sum /build/
56RUN go mod download -x
67ADD cmd /build/cmd
78ADD pkg /build/pkg
8- RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./s3driver ./cmd/s3driver
99
10- FROM alpine:3.17 AS downloader
10+ ARG TARGETOS
11+ ARG TARGETARCH
12+ RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -a -ldflags '-extldflags "-static"' -o ./s3driver ./cmd/s3driver
13+
14+ FROM --platform=$BUILDPLATFORM alpine:3.17 AS downloader
1115
1216WORKDIR /work
1317
1418RUN apk add --no-cache curl
1519
16- ARG TARGETPLATFORM
17- RUN ARCH=$(echo $TARGETPLATFORM | sed -e 's/^linux \/ //g' ) && \
18- curl https://github.com/yandex-cloud/geesefs/releases/latest/download/geesefs-linux-$ARCH -LfSso /work/geesefs
20+ ARG TARGETOS
21+ ARG TARGETARCH
22+ RUN curl https://github.com/yandex-cloud/geesefs/releases/latest/download/geesefs-$TARGETOS-$TARGETARCH -LfSso /work/geesefs
1923
2024FROM alpine:3.17
2125LABEL maintainers="Vitaliy Filippov <vitalif@yourcmc.ru>"
You can’t perform that action at this time.
0 commit comments