加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile.release 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
EdmondFrank 提交于 2024-07-16 11:09 . Trim image.
FROM dockerproxy.cn/golang:1.21-alpine as build
ARG TARGETARCH=amd64
ARG RELEASE
ENV GOPATH /go
ENV CGO_ENABLED 0
WORKDIR /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
# Install curl and minisign
RUN apk add -U --no-cache ca-certificates && \
apk add -U --no-cache curl
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn \
GOSUMDB=off \
GOARCH="${TARGETARCH}"
COPY dockerscripts/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
COPY . .
RUN go mod download -x
RUN go mod tidy
RUN mkdir -p /opt/bin && chmod -R 777 /opt/bin
RUN go build -trimpath -tags kqueue -o /opt/bin
FROM dockerproxy.cn/alpine
LABEL name="MinIO" \
vendor="MinIO Inc <dev@min.io>" \
maintainer="MinIO Inc <dev@min.io>" \
version="${RELEASE}" \
release="${RELEASE}" \
summary="MinIO is a High Performance Object Storage, API compatible with Amazon S3 cloud storage service." \
description="MinIO object storage is fundamentally different. Designed for performance and the S3 API, it is 100% open-source. MinIO is ideal for large, private cloud environments with stringent security requirements and delivers mission-critical availability across a diverse range of workloads."
ENV MINIO_ACCESS_KEY_FILE=access_key \
MINIO_SECRET_KEY_FILE=secret_key \
MINIO_ROOT_USER_FILE=access_key \
MINIO_ROOT_PASSWORD_FILE=secret_key \
MINIO_KMS_SECRET_KEY_FILE=kms_master_key \
MINIO_UPDATE_MINISIGN_PUBKEY="RWTx5Zr1tiHQLwG9keckT0c45M3AGeHD6IvimQHpyRywVWGbP1aVSGav" \
MINIO_CONFIG_ENV_FILE=config.env \
PATH=$PATH:/opt/bin
RUN mkdir -p /opt/bin && chmod -R 777 /opt/bin
COPY --from=build /usr/bin/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
COPY --from=build /opt/bin/minio /opt/bin/minio
RUN chmod +x /usr/bin/docker-entrypoint.sh
EXPOSE 9000
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
VOLUME ["/data"]
CMD ["minio"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化