Docker is a platform for developers and sysadmins to develop, ship, and run applications. Docker lets you quickly assemble applications from components and eliminates the friction that can come when shipping code. Docker lets you get your code tested and deployed into production as fast as possible.
Configure proxy for docker host
Role can be master, manager or worker. Where master is the first manager that will initialize the swarm.
Metadata for manager (first node):
Metadata for worker.
Token to join to master node is obtained from grains using salt.mine. In case of any join_token undefined
issues, ensure you have docker_swarm_
grains available.
There are two states that provides this functionality:
- docker.client.stack
- docker.client.compose
Stack is new and works with Docker Swarm Mode. Compose is legacy and works only if node isn't member of Swarm. Metadata for both states are similar and differs only in implementation.
There are three options how to install docker-compose:
- distribution package (default)
- using Pip
- using Docker container
Install docker-compose using Docker (default is distribution package)
docker:
client:
compose:
source:
engine: docker
image: docker/compose:1.8.0
django_web:
# Run up action, any positional argument to docker-compose CLI
# If not defined, only docker-compose.yml is generated
status: up
# Run image pull every time state is run triggering container
# restart in case it's changed
pull: true
environment:
SOMEVAR: somevalue
service:
db:
image: postgres
web:
image: djangoapp
volumes:
- /srv/volumes/django:/srv/django
ports:
- 8000:8000
depends_on:
- db
To deploy service in Swarm mode, you can use docker.client.service
:
docker:
registry:
log:
level: debug
formatter: json
cache:
engine: redis
host: localhost
storage:
engine: filesystem
root: /srv/docker/registry
bind:
host: 0.0.0.0
port: 5000
hook:
mail:
levels:
- panic
# Options are rendered as yaml as is so use hook-specific options here
options:
smtp:
addr: smtp.sendhost.com:25
username: sendername
password: password
insecure: true
from: name@sendhost.com
to:
- name@receivehost.com
Docker login to private registry
Enforce the service in container is started
or
Enforce the service in container is stoped
Enforce the service in container will be restarted
Enforce the service in container is enabled
Enforce the service in container is disabled
- https://docs.docker.com/installation/ubuntulinux/
- https://github.com/saltstack-formulas/docker-formula
To learn how to install and update salt-formulas, consult the documentation available online at:
In the unfortunate event that bugs are discovered, they should be reported to the appropriate issue tracker. Use Github issue tracker for specific salt formula:
For feature requests, bug reports or blueprints affecting entire ecosystem, use Launchpad salt-formulas project:
You can also join salt-formulas-users team and subscribe to mailing list:
Developers wishing to work on the salt-formulas projects should always base their work on master branch and submit pull request against specific formula.
Any questions or feedback is always welcome so feel free to join our IRC channel:
#salt-formulas @ irc.freenode.net