Author: | Pavel Antonov |
---|
parameter | required | default | choices | comments |
---|---|---|---|---|
docker_url | no | unix://var/run/docker.sock | URL of docker host to issue commands to | |
name | yes | Image name to work with | ||
nocache | no | Do not use cache with building | ||
path | no | Path to directory with Dockerfile | ||
state | no | present |
|
Set the state of the image |
tag | no | Image tag to work with | ||
timeout | no | 600 | Set image operation timeout |
Note
Requires docker-py
Build docker image if required. Path should contains Dockerfile to build image:
- hosts: web
sudo: yes
tasks:
- name: check or build image
docker_image: path="/path/to/build/dir" name="my/app" state=present
Build new version of image:
- hosts: web
sudo: yes
tasks:
- name: check or build image
docker_image: path="/path/to/build/dir" name="my/app" state=build
Remove image from local docker storage:
- hosts: web
sudo: yes
tasks:
- name: run tomcat servers
docker_image: name="my/app" state=absent