Skip to content

Instantly share code, notes, and snippets.

@abby-fuller
Last active July 18, 2016 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abby-fuller/d08f9024ab0810ae5a5eb23c617cd2ee to your computer and use it in GitHub Desktop.
Save abby-fuller/d08f9024ab0810ae5a5eb23c617cd2ee to your computer and use it in GitHub Desktop.
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