Skip to content

Commit

Permalink
fix: using bitnami minio clients to startup works again (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Nov 24, 2023
1 parent 92d2ab6 commit 7e199f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit 7e199f3

Please sign in to comment.