how to configure aws configure in docker file

Sathish David  Kumar N
Sathish David  Kumar N used Ask the Experts™
on
how to configure aws configure in docker file

my docker file

FROM ubuntu


RUN apt-get update && apt-get install -y awscli


cmd docker pull mariadb
cmd  docker pull mysql
CMD ["/test.sh"]

test.sh
 aws configure set aws_access_key_id default_access_key xxxxxx
 aws configure set aws_secret_access_key default_secret_key xxxxxx
aws configure set default.region us-west-2
 
aws s3 cp s3://mariadbs3bucket/test.txt /test

 mysql -u xxx-pxxx --host xxx -P 3306  --socket=TCP/IP  -e "USE myDB; insert into myDB.tt values(50000);"

the above both command are working fine while running in ec command line
there i have set the aws configure
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Technical Architect
Commented:
Instead of include Access/Secret key inside the Container, better create a role and use that role will add more security. if you embed role in to the instances, you do not required to run configure.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial