blob: ccc9022cd267d91e27313ebb60807e1f64b62056 [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
Filip Pytloun972294d2016-09-15 17:52:32 +020026 insecure_registries:
27 - 127.0.0.1
Michael Kutý17649402016-03-19 23:57:43 +010028
Filip Pytloune27a90d2016-08-29 14:08:34 +020029Client
30------
Michael Kutý17649402016-03-19 23:57:43 +010031
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020032Container
33~~~~~~~~~
34
35.. code-block:: yaml
36
Michael Kutý17649402016-03-19 23:57:43 +010037 docker:
Filip Pytloune27a90d2016-08-29 14:08:34 +020038 client:
Michael Kutý17649402016-03-19 23:57:43 +010039 container:
Filip Pytloun87169542016-08-29 13:38:30 +020040 jenkins:
41 # Don't start automatically
42 start: false
43 restart: unless-stopped
44 image: jenkins:2.7.1
Michael Kutý17649402016-03-19 23:57:43 +010045 ports:
Filip Pytloun87169542016-08-29 13:38:30 +020046 - 8081:8080
47 - 50000:50000
48 environment:
49 JAVA_OPTS: "-Dhudson.footerURL=https://www.example.com"
50 volumes:
51 - /srv/volumes/jenkins:/var/jenkins_home
Michael Kutý17649402016-03-19 23:57:43 +010052
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020053Compose
54~~~~~~~
55
Filip Pytloun21d9af92016-08-30 08:13:39 +020056There are three options how to install docker-compose:
57
58- distribution package (default)
59- using Pip
60- using Docker container
61
62Install docker-compose using Docker (default is distribution package)
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020063
64.. code-block:: yaml
65
66 docker:
67 client:
68 compose:
Filip Pytloun21d9af92016-08-30 08:13:39 +020069 source:
70 engine: docker
71 image: docker/compose:1.8.0
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020072 django_web:
73 # Run up action, any positional argument to docker-compose CLI
74 # If not defined, only docker-compose.yml is generated
75 status: up
76 environment:
77 SOMEVAR: somevalue
78 service:
79 db:
80 image: postgres
81 web:
82 image: djangoapp
83 volumes:
84 - /srv/volumes/django:/srv/django
85 ports:
86 - 8000:8000
87 depends_on:
88 - db
89
90
Filip Pytlounbaf94c92016-06-07 18:07:17 +020091Registry
92--------
93
94.. code-block:: yaml
95
96 docker:
97 registry:
98 log:
99 level: debug
100 formatter: json
101 cache:
102 engine: redis
103 host: localhost
104 storage:
105 engine: filesystem
106 root: /srv/docker/registry
107 bind:
108 host: 0.0.0.0
109 port: 5000
110 hook:
111 mail:
112 levels:
113 - panic
114 # Options are rendered as yaml as is so use hook-specific options here
115 options:
116 smtp:
117 addr: smtp.sendhost.com:25
118 username: sendername
119 password: password
120 insecure: true
121 from: name@sendhost.com
122 to:
123 - name@receivehost.com
124
marco85b72a62016-07-07 13:08:33 +0200125Docker login to private registry
126--------------------------------
127
128.. code-block:: yaml
129
130 docker:
131 host:
132 enabled: true
133 registry:
134 first:
135 address: private.docker.com
136 user: username
137 password: password
138 second:
139 address: private2.docker.com
140 user: username2
141 password: password2
Michael Kutý17649402016-03-19 23:57:43 +0100142
143Read more
144---------
145
146* https://docs.docker.com/installation/ubuntulinux/
147* https://github.com/saltstack-formulas/docker-formula
Filip Pytlounbaf94c92016-06-07 18:07:17 +0200148