Skip to content

Instantly share code, notes, and snippets.

@meatballhat
Last active December 26, 2015 06:08
Show Gist options
  • Save meatballhat/7105241 to your computer and use it in GitHub Desktop.
Save meatballhat/7105241 to your computer and use it in GitHub Desktop.
docker install from ansible
#!/bin/bash
ansible-playbook ./docker_app.yml -c ssh -u ubuntu -s
---
- 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
description 'This is my app mkay'
start on filesystem and started docker
stop on runlevel [!2345]
respown
exec docker run quay.io/meatballhat/foo
{
"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