docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

docker-machine doesn't respect region set in profile #4723

Open euri10 opened 5 years ago

euri10 commented 5 years ago

I have this in my config

[profile perso2]
region = us-west-2
output = json

I enter AWS_PROFILE=perso2 docker-machine create --driver amazonec2 toto

toto is created on us-east-1

Am I doing something wrong ?

gdippolito commented 5 years ago

You don't need to put profile in the name of the profile.

docker-machine does not find your profile and it therefore using the default region us-east-1

Try:

[perso2]
region = us-west-2
output = json
euri10 commented 5 years ago

Note that I didn't add the profile prefix myself, it's been set that way with aws cli running aws configure --profile perso2 Even with just [perso2] as suggested @gdippolito it's still creating the instance on us-east-1

 cat ~/.aws/config
[perso2]
region = us-west-2
output = json