Created
January 29, 2015 17:07
-
-
Save KrustyHack/cd214870a148a82f9141 to your computer and use it in GitHub Desktop.
Saltstack docker sample
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-registries: | |
https://my.regist.ry/v1/: | |
email: my@email.com | |
password: mypassword | |
username: myusername |
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
# State file | |
{% set name = 'image' %} | |
{% set registryname = 'krustyhack' %} | |
{% set tag = 'latest' %} | |
{{ name }}-image: | |
docker.pulled: | |
- name: {{ registryname }}/{{ name }} | |
- tag: {{ tag }} | |
- force: False | |
{{ name }}-container: | |
docker.installed: | |
- name: {{ name }} | |
- hostname: {{ name }} | |
- image: {{ registryname }}/{{ name }}:{{ tag }} | |
- ports: | |
- "80/tcp" | |
- "443/tcp" | |
- volumes: | |
- /var/test:/home/test | |
- require_in: {{ name }} | |
- require: | |
- docker: {{ name }}-image | |
{{ name }}: | |
docker.running: | |
- container: {{ name }} | |
- binds: | |
/home/test/: | |
bind: /var/test/ | |
ro: False | |
- port_bindings: | |
"80/tcp": | |
HostIp: "0.0.0.0" | |
HostPort: "80" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment