Last active
July 18, 2016 20:14
-
-
Save abby-fuller/d08f9024ab0810ae5a5eb23c617cd2ee to your computer and use it in GitHub Desktop.
authenticating with aws and ecr from vagrant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#docker/ecr setup | |
- name: login for config | |
sudo: yes | |
shell: export AWS_CONFIG_FILE=/home/vagrant/.aws/config; ECR_LOGIN="$(aws ecr get-login --region us-east-1)"; $ECR_LOGIN; | |
- name: login to ecr | |
sudo: yes | |
shell: export AWS_CONFIG_FILE=/home/vagrant/.aws/config; ECR_LOGIN="$(aws ecr get-login --region us-east-1)"; echo $ECR_LOGIN | awk '{print $6}'; | |
register: docker_pass | |
- set_fact: | |
DOCKER_PASS: "{{ docker_pass.stdout }}" | |
- name: give vagrant user access to docker | |
command: usermod -aG docker vagrant | |
sudo: true | |
- name: copy ecr login | |
sudo: yes | |
shell: cp -Rf /root/.docker/ /home/vagrant/.docker/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment