-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·45 lines (35 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
executable file
·45 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# ---- Build Stage ----
FROM golang:1.24-alpine AS builder
ARG RELEASE=latest
RUN apk add --no-cache git bash
WORKDIR /src
# Detect architecture and set GOARCH
RUN ARCH=$(case `uname -m` in \
x86_64) echo amd64 ;; \
armv7l) echo arm ;; \
aarch64) echo arm64 ;; \
ppc64le) echo ppc64le ;; \
s390x) echo s390x ;; \
*) echo "unsupported arch"; exit 1 ;; \
esac) && \
echo "Building for ARCH=$ARCH" && \
export GOOS=linux && \
export GOARCH=$ARCH && \
# Build MinIO using official go install
if [ "$RELEASE" = "latest" ]; then \
go install github.com/minio/minio@latest ; \
else \
go install github.com/minio/minio@${RELEASE} ; \
fi
# ---- Runtime Stage ----
FROM alpine:3.20
RUN apk add --no-cache ca-certificates && \
addgroup -S minio && adduser -S minio -G minio
# Copy the binary from builder
COPY --from=builder /go/bin/minio /usr/local/bin/minio
USER minio
WORKDIR /home/minio
EXPOSE 9000 9001
VOLUME ["/data"]
ENTRYPOINT ["minio"]
CMD ["server", "/data", "--console-address", ":9001"]