-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
FROM golang:1.19-alpine as gobuild | ||
# Golang can cross-compile | ||
FROM --platform=$BUILDPLATFORM golang:1.19-alpine as gobuild | ||
|
||
WORKDIR /build | ||
ADD go.mod go.sum /build/ | ||
RUN go mod download -x | ||
ADD cmd /build/cmd | ||
ADD pkg /build/pkg | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./s3driver ./cmd/s3driver | ||
|
||
FROM alpine:3.17 AS downloader | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -a -ldflags '-extldflags "-static"' -o ./s3driver ./cmd/s3driver | ||
|
||
FROM --platform=$BUILDPLATFORM alpine:3.17 AS downloader | ||
|
||
WORKDIR /work | ||
|
||
RUN apk add --no-cache curl | ||
|
||
ARG TARGETPLATFORM | ||
RUN ARCH=$(echo $TARGETPLATFORM | sed -e 's/^linux\///g') && \ | ||
curl https://github.com/yandex-cloud/geesefs/releases/latest/download/geesefs-linux-$ARCH -LfSso /work/geesefs | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
RUN curl https://github.com/yandex-cloud/geesefs/releases/latest/download/geesefs-$TARGETOS-$TARGETARCH -LfSso /work/geesefs | ||
|
||
FROM alpine:3.17 | ||
LABEL maintainers="Vitaliy Filippov <[email protected]>" | ||
|