Files
s3-cli/Dockerfile
zeekay e67172bbf6 Fix Dockerfile to build from local source
Build s3 binary from local Go source instead of fetching
minio/mc@latest. Uses Go 1.24, outputs binary as 's3'.
2026-02-23 12:46:12 -08:00

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"]