Skip to content

Instantly share code, notes, and snippets.

@mikeywaites
Last active August 29, 2015 14:11
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 mikeywaites/aad30cc8e271102892f1 to your computer and use it in GitHub Desktop.
Save mikeywaites/aad30cc8e271102892f1 to your computer and use it in GitHub Desktop.
#!stateconf yaml . jinja
.api_container_pull:
docker.pulled:
- name: mikeywaites/vizibl
- tag: develop
- require:
- stateconf: docker::goal
# Remove the foo container (stop and killed) if the image has changed
.vizibl_absent:
cmd.wait:
- name: docker rm -f vizibl_api
- onlyif: docker inspect vizibl_api 2>&1 > /dev/null
- prereq:
- docker: mikeywaites/vizibl
## Create a container
.create_vizibl_api_container:
docker.installed:
- name: vizibl_api
- image: mikeywaites/vizibl:develop
- ports:
- '5000/tcp'
- require:
- docker: mikeywaites/vizibl
- watch:
- cmd: .vizibl_absent
## Run the container
.run_vizibl_container:
docker.running:
- container: vizibl_api
- command: "python vizibl/run.py"
- require:
- docker: .create_vizibl_api_container
----------
ID: viziblapp.docker::api_container_pull
Function: docker.pulled
Name: mikeywaites/vizibl
Result: True
Comment: Image mikeywaites/vizibl:develop was pulled (0a2a3ff99461f40e58a78ed9dfa598a5d05b179a89f50dcc35990824cb358ccc)
Started: 17:12:22.371874
Duration: 8927.181 ms
Changes:
----------
mikeywaites/vizibl:
----------
new:
0a2a3ff99461f40e58a78ed9dfa598a5d05b179a89f50dcc35990824cb358ccc
old:
None
----------
ID: viziblapp.docker::vizibl_absent
Function: cmd.wait
Name: docker rm -f vizibl_api
Result: False
Comment: The following requisites were
not found:
prereq:
docker: .create_vizibl_api_container
Started:
Duration:
Changes:
----------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment