mirror of
https://github.com/hanzoai/s3-cli.git
synced 2026-10-30 18:23:12 +00:00
Build s3 binary from local Go source instead of fetching minio/mc@latest. Uses Go 1.24, outputs binary as 's3'.
24 lines
472 B
Docker
24 lines
472 B
Docker
FROM golang:1.24-alpine AS build
|
|
|
|
LABEL maintainer="Hanzo AI, Inc. <[email protected]>"
|
|
|
|
ENV GOPATH /go
|
|
ENV CGO_ENABLED 0
|
|
|
|
RUN apk add -U --no-cache ca-certificates git
|
|
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN go build -v -ldflags "-s -w" -o /go/bin/s3 .
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=build /go/bin/s3 /usr/bin/s3
|
|
COPY --from=build /src/LICENSE /licenses/LICENSE
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
ENTRYPOINT ["s3"]
|