fix(dev): repair createbuckets — mc's config/policy commands were removed (#4646)

The `createbuckets` service in docker-compose.base.yml has been failing on
every local `docker compose up`, so the modelshare and images buckets are
never created. It uses two mc subcommands that no longer exist:

    mc config host add   ->  mc alias set
    mc policy set        ->  mc anonymous set

The image is unpinned (`minio/mc`), so this broke silently whenever upstream
dropped them. On mc RELEASE.2025-08-13T08-35-41Z the container exits 1 with:

    mc: <ERROR> `config` is not a recognized command.

Because the entrypoint is a single `&&` chain, the first failure aborts it and
neither bucket is made. Nothing else in the stack reports a problem, so the
failure is easy to miss until something tries to use object storage.

Also add `--ignore-existing` to both `mc mb` calls. Without it the fix would
only work once: `mc mb` on an existing bucket exits 1 ("you already own it"),
which aborts the same `&&` chain, so the service would go back to failing on
the second and every subsequent `docker compose up`.

Verified against a running local MinIO:
  - before: container exits 1, `mc ls` shows no buckets
  - after:  exits 0, both buckets created and set public
  - re-run: exits 0 again (idempotent)
  - control: `mc mb` on an existing bucket is rc=1 without the flag, rc=0 with it
This commit is contained in:
Zachary Lowden
2026-09-05 02:15:05 -05:00
committed by GitHub
parent 7ba3688c6a
commit a7b09fbefe
+1 -1
View File
@@ -92,7 +92,7 @@ services:
depends_on:
- minio
entrypoint: >
/bin/sh -c "/usr/bin/mc config host add minio http://minio:9000 minioadmin minioadmin && /usr/bin/mc mb minio/modelshare && /usr/bin/mc policy set public minio/modelshare && /usr/bin/mc mb minio/images && /usr/bin/mc policy set public minio/images && exit 0"
/bin/sh -c "/usr/bin/mc alias set minio http://minio:9000 minioadmin minioadmin && /usr/bin/mc mb --ignore-existing minio/modelshare && /usr/bin/mc anonymous set public minio/modelshare && /usr/bin/mc mb --ignore-existing minio/images && /usr/bin/mc anonymous set public minio/images && exit 0"
maildev:
image: maildev/maildev