Build MinIO server and mc images from upstream source release tags
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# MinIO server built from its AGPLv3 source at an upstream release tag. Upstream stopped publishing
|
||||
# pullable images (docker.io 404, quay.io auth-only), so we build and host them ourselves.
|
||||
# Drop-in for quay.io/minio/minio: same entrypoint behaviour, and bundles mc, curl and sh like upstream.
|
||||
ARG GO_VERSION=1.24
|
||||
FROM --platform=$BUILDPLATFORM docker.io/library/golang:${GO_VERSION} AS build
|
||||
ARG TARGETOS TARGETARCH
|
||||
ARG MINIO_REF
|
||||
ARG MC_REF
|
||||
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GOFLAGS=-trimpath MINIO_RELEASE=RELEASE MC_RELEASE=RELEASE
|
||||
WORKDIR /src
|
||||
RUN git clone -q --depth 1 --branch "$MINIO_REF" https://github.com/minio/minio.git minio \
|
||||
&& git clone -q --depth 1 --branch "$MC_REF" https://github.com/minio/mc.git mc
|
||||
RUN cd minio && GOOS= GOARCH= go run buildscripts/gen-ldflags.go "$(echo "${MINIO_REF#RELEASE.}" | sed -E 's/T([0-9]{2})-([0-9]{2})-([0-9]{2})Z/T\1:\2:\3Z/')" > /tmp/ld \
|
||||
&& go build -tags kqueue -ldflags "$(cat /tmp/ld)" -o /out/minio .
|
||||
RUN cd mc && GOOS= GOARCH= go run buildscripts/gen-ldflags.go "$(echo "${MC_REF#RELEASE.}" | sed -E 's/T([0-9]{2})-([0-9]{2})-([0-9]{2})Z/T\1:\2:\3Z/')" > /tmp/ld \
|
||||
&& go build -ldflags "$(cat /tmp/ld)" -o /out/mc .
|
||||
|
||||
FROM docker.io/library/alpine:3.20 AS minio
|
||||
ARG MINIO_REF
|
||||
LABEL org.opencontainers.image.source="https://github.com/minio/minio" \
|
||||
org.opencontainers.image.version="$MINIO_REF" \
|
||||
org.opencontainers.image.licenses="AGPL-3.0-or-later"
|
||||
RUN apk add --no-cache ca-certificates curl
|
||||
COPY --from=build /out/minio /out/mc /usr/bin/
|
||||
COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
|
||||
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="" \
|
||||
MINIO_CONFIG_ENV_FILE=config.env MC_CONFIG_DIR=/tmp/.mc
|
||||
EXPOSE 9000
|
||||
VOLUME ["/data"]
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
CMD ["minio"]
|
||||
|
||||
FROM docker.io/library/alpine:3.20 AS mc
|
||||
ARG MC_REF
|
||||
LABEL org.opencontainers.image.source="https://github.com/minio/mc" \
|
||||
org.opencontainers.image.version="$MC_REF" \
|
||||
org.opencontainers.image.licenses="AGPL-3.0-or-later"
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY --from=build /out/mc /usr/bin/mc
|
||||
ENTRYPOINT ["mc"]
|
||||
@@ -0,0 +1,38 @@
|
||||
# minio-build
|
||||
|
||||
MinIO server and `mc` client images, built from upstream's AGPLv3 source at release tags and
|
||||
published to `gitea.malogica.net/mirror`.
|
||||
|
||||
**Why:** upstream no longer publishes pullable images. `minio/minio` on Docker Hub returns 404,
|
||||
`quay.io/minio/minio` requires authentication, and the `dl.min.io` binary channel returns 410.
|
||||
Any fresh pull fails, which broke CI in MIND and OFFICE in September 2026. This is a stopgap until
|
||||
we pick a replacement S3-compatible store.
|
||||
|
||||
## Images
|
||||
|
||||
The `mirror` org is public, so pulls need no login.
|
||||
|
||||
| Image | Bundles `mc` | Used by |
|
||||
|---|---|---|
|
||||
| `gitea.malogica.net/mirror/minio:RELEASE.2024-01-16T16-07-38Z` | `RELEASE.2024-01-13T08-44-48Z` | OFFICE |
|
||||
| `gitea.malogica.net/mirror/minio:RELEASE.2025-04-22T22-12-26Z` | `RELEASE.2025-04-16T18-13-26Z` | EVCCFLEET |
|
||||
| `gitea.malogica.net/mirror/minio:RELEASE.2025-10-15T17-29-55Z` | `RELEASE.2025-08-13T08-35-41Z` | new work (last source release) |
|
||||
| `gitea.malogica.net/mirror/mc:<same mc tags>` | | compose init jobs |
|
||||
|
||||
Each is multi-arch (`linux/amd64`, `linux/arm64`). They are drop-ins for `quay.io/minio/minio`:
|
||||
|
||||
- `server /data` runs `minio server /data`.
|
||||
- `mc`, `curl` and `sh` are included (healthchecks and `--entrypoint=/bin/sh` init scripts work).
|
||||
- `MINIO_USERNAME`/`MINIO_GROUPNAME` drop privileges as upstream does.
|
||||
- `minio --version` reports the real release and upstream commit.
|
||||
|
||||
Testcontainers: `new MinIOContainer(DockerImageName.parse("gitea.malogica.net/mirror/minio:RELEASE.2025-10-15T17-29-55Z").asCompatibleSubstituteFor("minio/minio"))`.
|
||||
|
||||
## Build
|
||||
|
||||
```sh
|
||||
./build.sh local.test/mirror # host platform only, loaded locally for testing
|
||||
./build.sh gitea.malogica.net/mirror --push # amd64 + arm64, pushed (needs a write:package login)
|
||||
```
|
||||
|
||||
To add a release, append a line to the list in `build.sh`: minio tag, `mc` tag, Go toolchain.
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
# Usage: build.sh <registry-prefix> [--push] e.g. build.sh gitea.malogica.net/mirror --push
|
||||
# Without --push, builds the host platform only and loads it locally for testing.
|
||||
set -eu
|
||||
PREFIX=$1; MODE=${2:-}
|
||||
if [ "$MODE" = "--push" ]; then OUT="--platform linux/amd64,linux/arm64 --push"; else OUT="--load"; fi
|
||||
# minio release | mc release bundled | Go toolchain
|
||||
while read -r MINIO MC GO; do
|
||||
docker buildx build -f Containerfile $OUT --target minio --build-arg GO_VERSION="$GO" \
|
||||
--build-arg MINIO_REF="$MINIO" --build-arg MC_REF="$MC" -t "$PREFIX/minio:$MINIO" .
|
||||
docker buildx build -f Containerfile $OUT --target mc --build-arg GO_VERSION="$GO" \
|
||||
--build-arg MINIO_REF="$MINIO" --build-arg MC_REF="$MC" -t "$PREFIX/mc:$MC" .
|
||||
done <<'LIST'
|
||||
RELEASE.2024-01-16T16-07-38Z RELEASE.2024-01-13T08-44-48Z 1.22
|
||||
RELEASE.2025-04-22T22-12-26Z RELEASE.2025-04-16T18-13-26Z 1.24
|
||||
RELEASE.2025-10-15T17-29-55Z RELEASE.2025-08-13T08-35-41Z 1.24
|
||||
LIST
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# Mirrors upstream's entrypoint: bare args (`server /data`) run as `minio server /data`; other binaries
|
||||
# (sh, mc, curl) run as given; MINIO_USERNAME/GROUPNAME drop privileges the same way.
|
||||
if [ "${1}" != "minio" ] && [ -n "${1}" ] && ! command -v "${1}" >/dev/null 2>&1; then
|
||||
set -- minio "$@"
|
||||
fi
|
||||
if [ -n "${MINIO_USERNAME}" ] && [ -n "${MINIO_GROUPNAME}" ]; then
|
||||
if [ -n "${MINIO_UID}" ] && [ -n "${MINIO_GID}" ]; then
|
||||
exec chroot --userspec="${MINIO_UID}:${MINIO_GID}" / "$@"
|
||||
fi
|
||||
echo "${MINIO_USERNAME}:x:1000:1000:${MINIO_USERNAME}:/:/sbin/nologin" >>/etc/passwd
|
||||
echo "${MINIO_GROUPNAME}:x:1000:" >>/etc/group
|
||||
exec chroot --userspec="${MINIO_USERNAME}:${MINIO_GROUPNAME}" / "$@"
|
||||
fi
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user