Skip to content

Commit

Permalink
fixing #3
Browse files Browse the repository at this point in the history
  • Loading branch information
freegroup authored Jun 17, 2020
1 parent a70a177 commit eaef1a3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
set -o errexit
set -o errtrace
IFS=$'\n\t'

export S3_ACL=${S3_ACL:-private}

mkdir -p ${MNT_POINT}

if [ "$IAM_ROLE" == "none" ]; then
export AWSACCESSKEYID=${AWSACCESSKEYID:-$AWS_KEY}
export AWSSECRETACCESSKEY=${AWSSECRETACCESSKEY:-$AWS_SECRET_KEY}

echo "${AWS_KEY}:${AWS_SECRET_KEY}" > /etc/passwd-s3fs
chmod 0400 /etc/passwd-s3fs

echo 'IAM_ROLE is not set - mounting S3 with credentials from ENV'
/usr/bin/s3fs ${S3_BUCKET} ${MNT_POINT} -d -d -f -o endpoint=${S3_REGION},allow_other,retries=5
echo 'started...'
else
echo 'IAM_ROLE is set - using it to mount S3'
/usr/bin/s3fs ${S3_BUCKET} ${MNT_POINT} -d -d -f -o endpoint=${S3_REGION},iam_role=${IAM_ROLE},allow_other,retries=5
fi

0 comments on commit eaef1a3

Please sign in to comment.