Last active
December 26, 2015 06:08
-
-
Save meatballhat/7105241 to your computer and use it in GitHub Desktop.
docker install from ansible
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
#!/bin/bash | |
ansible-playbook ./docker_app.yml -c ssh -u ubuntu -s |
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
--- | |
- hosts: target_host_identifier | |
gather_facts: no | |
tasks: | |
- name: bootstrap docker | |
shell: curl -s get.docker.io | sh | |
- name: add upstart job | |
copy: src=myapp.conf dest=/etc/init/myapp.conf | |
- name: add quay creds | |
copy: src=quay.dockercfg.json dest=/root/.dockercfg | |
- name: pull my container | |
shell: docker pull quay.io/meatballhat/foo | |
notify: | |
- restart app | |
handlers: | |
- name: run my app | |
shell: initctl stop myapp || true ; initctl start myapp |
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
description 'This is my app mkay' | |
start on filesystem and started docker | |
stop on runlevel [!2345] | |
respown | |
exec docker run quay.io/meatballhat/foo |
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
{ | |
"https://quay.io/v1/": { | |
"auth": "a1b2c3d4...", | |
"email": "foo@example.com" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment