Skip to content

Instantly share code, notes, and snippets.

@abby-fuller
Last active Jul 18, 2016
Embed
What would you like to do?
authenticating with aws and ecr from vagrant
#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