diff --git a/build-image/mongo/Dockerfile b/build-image/mongo/Dockerfile index 7e64775..6c8036c 100644 --- a/build-image/mongo/Dockerfile +++ b/build-image/mongo/Dockerfile @@ -10,7 +10,7 @@ RUN apt update && apt install -y curl unzip && \ tar xf mongodump.tgz -C /usr/local && \ rm -rf aws awscliv2.zip mongodump.tgz -ENV PATH=$PATH:/usr/local/mongodump/bin DATABASES="" HOST="" PORT="" PASSWORD="" +ENV PATH=$PATH:/usr/local/mongodump/bin DATABASES="" HOST="" PORT="" PASSWORD="" AWS_ACCESS_KEY="" AWS_SECRET_KEY="" COPY entrypoint.sh /usr/local/bin CMD [ "/usr/local/bin/entrypoint.sh" ] \ No newline at end of file diff --git a/build-image/mongo/entrypoint.sh b/build-image/mongo/entrypoint.sh index 1b98751..beb9f17 100755 --- a/build-image/mongo/entrypoint.sh +++ b/build-image/mongo/entrypoint.sh @@ -2,6 +2,10 @@ datetime=`date +%Y%m%d%H` +mkdir -p ~/.aws + +echo -ne "[default]\naws_access_key_id = ${AWS_ACCESS_KEY}\naws_secret_access_key = ${AWS_SECRET_KEY}\n" > ~/.aws/credentials + dbs=($DATABASES) for db in "${dbs[@]}"