Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: using bitnami minio clients to startup works again #36

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ services:
hostname: minio-client
depends_on:
- minio # start after the server
image: "${image_mc_name:-quay.io/minio/mc}:\
image: "${image_mc_name:-bitnami/minio-client}:\
${image_mc_version:-latest}"
# Run with custom entrypoint that sets the alias "minio" with admin
# credentials, ensures that the "varfish" user and "varfish-server"
# buckets are created, and then sleeps forever.
entrypoint: /opt/minio-utils/entrypoint-override.sh
entrypoint: bash -i /opt/minio-utils/entrypoint-override.sh
secrets:
- minio-root-password
- minio-varfish-password
Expand Down
2 changes: 1 addition & 1 deletion env.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# image_minio_version=latest

# Name of the "mc" (Minio client) image to use.
# image_mc_name=minio/mc
# image_mc_name=bitnami/minio-client

# Version of the "mc" (Minio client) image to use.
# image_mc_version=latest
Expand Down
6 changes: 3 additions & 3 deletions utils/minio-utils/entrypoint-override.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ S3_BUCKET=varfish-server
mc alias set minio http://minio:9000 minioadmin $(cat /run/secrets/minio-root-password)

# 2. Ensure that the user "varfish" exists.
users=$(mc admin user list minio | egrep '^enabled\s+varfish' || true)
users=$(mc admin user list minio | grep -e '^enabled\s+varfish' || true)
if [ "$users" == "" ]; then
>&2 echo "Creating user '$S3_USER'..."
mc admin user add minio $S3_USER $(cat /run/secrets/minio-varfish-password)
Expand All @@ -46,10 +46,10 @@ else
fi

# 3. Create the "varfish-server" bucket and give "varfish" user access.
buckets=$(mc ls minio | egrep "$S3_BUCKET/\$" || true)
buckets=$(mc ls minio | grep -e "$S3_BUCKET/\$" || true)
if [ "$buckets" == "" ]; then
>&2 echo "Creating bucket '$S3_BUCKET'..."
mc mb minio/$S3_BUCKET
mc stat minio/$S3_BUCKET || mc mb minio/$S3_BUCKET

>&2 echo "Create policy file that provides access for '$S3_USER' to '$S3_BUCKET'..."
sed -e "s/__BUCKET__/$S3_BUCKET/g" $SCRIPT_DIR/bucket-user-policy.json.tpl \
Expand Down