Install Docker in advance.
docker -v
If it is installed, the version will be displayed.
Create an IAM (Identity and Access Management) user with the appropriate policy attached (https://docs.aws.amazon.com/ja_jp/IAM/latest/UserGuide/id_users_create.html#id_users_create_console). (AWS (Amazon Web Services) access type is programmatic access
)
Create ~ / .aws / credentials
and
mkdir ~/.aws/ && touch $_/credentials
Enter the access key ID and secret access key.
~/.aws/credentials
[default]
aws_access_key_id =Access key ID
aws_secret_access_key =Secret access key
See if you can list your buckets in Amazon S3 (Simple Storage Service) by running the s3 ls
command.
docker run --rm -ti -v ~/.aws:/root/.aws amazon/aws-cli s3 ls
You can shorten the Docker command by creating ʻalias`.
alias aws='docker run --rm -ti -v ~/.aws:/root/.aws amazon/aws-cli'
Also check if the s3 ls
command can be executed.
aws s3 ls
-Use Official AWS CLI Version 2 Docker Image
Recommended Posts