# Derived MinIO Client image with the idempotent bootstrap script baked in.
#
# Why a custom image instead of a bind-mount?
# The production Gitea Actions runner is Docker-out-of-Docker. A
# `./infra/minio/bootstrap.sh:/bootstrap.sh:ro` mount resolves the path
# against the HOST filesystem (the host daemon owns the bind), not the
# runner container's `/workspace/...`. The path doesn't exist on the host
# and Docker auto-creates an empty directory at the mount target — the
# entrypoint then fails with `/bootstrap.sh: Is a directory`. Baking the
# script in removes runtime path resolution entirely. See #506.
FROM minio/mc:RELEASE.2025-08-13T08-35-41Z

COPY bootstrap.sh /bootstrap.sh
RUN chmod +x /bootstrap.sh

ENTRYPOINT ["/bin/sh", "/bootstrap.sh"]
