blob: 4039078f8e20bd3d30d2c7652e08c537fa5a01cd [file] [log] [blame]
Michael Kutý17649402016-03-19 23:57:43 +01001
2======
3Docker
4======
5
6Docker 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.
7
8Docker is supported on the following systems:
9
10* Debian 8.0 Jessie (64-bit)
11* Ubuntu Trusty 14.04 (LTS) (64-bit)
12* Ubuntu Precise 12.04 (LTS) (64-bit)
13* Ubuntu Raring 13.04 and Saucy 13.10 (64 bit)
14
15Sample pillar
16-------------
17
Filip Pytloune27a90d2016-08-29 14:08:34 +020018Host
19----
20
Michael Kutý17649402016-03-19 23:57:43 +010021.. code-block:: yaml
22
23 docker:
24 host:
25 enabled: true
26
Filip Pytloune27a90d2016-08-29 14:08:34 +020027Client
28------
Michael Kutý17649402016-03-19 23:57:43 +010029
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020030Container
31~~~~~~~~~
32
33.. code-block:: yaml
34
Michael Kutý17649402016-03-19 23:57:43 +010035 docker:
Filip Pytloune27a90d2016-08-29 14:08:34 +020036 client:
Michael Kutý17649402016-03-19 23:57:43 +010037 container:
Filip Pytloun87169542016-08-29 13:38:30 +020038 jenkins:
39 # Don't start automatically
40 start: false
41 restart: unless-stopped
42 image: jenkins:2.7.1
Michael Kutý17649402016-03-19 23:57:43 +010043 ports:
Filip Pytloun87169542016-08-29 13:38:30 +020044 - 8081:8080
45 - 50000:50000
46 environment:
47 JAVA_OPTS: "-Dhudson.footerURL=https://www.example.com"
48 volumes:
49 - /srv/volumes/jenkins:/var/jenkins_home
Michael Kutý17649402016-03-19 23:57:43 +010050
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020051Compose
52~~~~~~~
53
Filip Pytloun21d9af92016-08-30 08:13:39 +020054There are three options how to install docker-compose:
55
56- distribution package (default)
57- using Pip
58- using Docker container
59
60Install docker-compose using Docker (default is distribution package)
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020061
62.. code-block:: yaml
63
64 docker:
65 client:
66 compose:
Filip Pytloun21d9af92016-08-30 08:13:39 +020067 source:
68 engine: docker
69 image: docker/compose:1.8.0
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020070 django_web:
71 # Run up action, any positional argument to docker-compose CLI
72 # If not defined, only docker-compose.yml is generated
73 status: up
74 environment:
75 SOMEVAR: somevalue
76 service:
77 db:
78 image: postgres
79 web:
80 image: djangoapp
81 volumes:
82 - /srv/volumes/django:/srv/django
83 ports:
84 - 8000:8000
85 depends_on:
86 - db
87
88
Filip Pytlounbaf94c92016-06-07 18:07:17 +020089Registry
90--------
91
92.. code-block:: yaml
93
94 docker:
95 registry:
96 log:
97 level: debug
98 formatter: json
99 cache:
100 engine: redis
101 host: localhost
102 storage:
103 engine: filesystem
104 root: /srv/docker/registry
105 bind:
106 host: 0.0.0.0
107 port: 5000
108 hook:
109 mail:
110 levels:
111 - panic
112 # Options are rendered as yaml as is so use hook-specific options here
113 options:
114 smtp:
115 addr: smtp.sendhost.com:25
116 username: sendername
117 password: password
118 insecure: true
119 from: name@sendhost.com
120 to:
121 - name@receivehost.com
122
marco85b72a62016-07-07 13:08:33 +0200123Docker login to private registry
124--------------------------------
125
126.. code-block:: yaml
127
128 docker:
129 host:
130 enabled: true
131 registry:
132 first:
133 address: private.docker.com
134 user: username
135 password: password
136 second:
137 address: private2.docker.com
138 user: username2
139 password: password2
Michael Kutý17649402016-03-19 23:57:43 +0100140
141Read more
142---------
143
144* https://docs.docker.com/installation/ubuntulinux/
145* https://github.com/saltstack-formulas/docker-formula
Filip Pytlounbaf94c92016-06-07 18:07:17 +0200146