blob: 4a511620298a19f3c14c4dfd42b8774002469379 [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
Filip Pytlounbe2b4a82016-09-15 18:10:24 +020076 # Run image pull every time state is run triggering container
77 # restart in case it's changed
78 pull: true
Filip Pytloun96fc0cc2016-08-29 16:01:10 +020079 environment:
80 SOMEVAR: somevalue
81 service:
82 db:
83 image: postgres
84 web:
85 image: djangoapp
86 volumes:
87 - /srv/volumes/django:/srv/django
88 ports:
89 - 8000:8000
90 depends_on:
91 - db
92
93
Filip Pytlounbaf94c92016-06-07 18:07:17 +020094Registry
95--------
96
97.. code-block:: yaml
98
99 docker:
100 registry:
101 log:
102 level: debug
103 formatter: json
104 cache:
105 engine: redis
106 host: localhost
107 storage:
108 engine: filesystem
109 root: /srv/docker/registry
110 bind:
111 host: 0.0.0.0
112 port: 5000
113 hook:
114 mail:
115 levels:
116 - panic
117 # Options are rendered as yaml as is so use hook-specific options here
118 options:
119 smtp:
120 addr: smtp.sendhost.com:25
121 username: sendername
122 password: password
123 insecure: true
124 from: name@sendhost.com
125 to:
126 - name@receivehost.com
127
marco85b72a62016-07-07 13:08:33 +0200128Docker login to private registry
129--------------------------------
130
131.. code-block:: yaml
132
133 docker:
134 host:
135 enabled: true
136 registry:
137 first:
138 address: private.docker.com
139 user: username
140 password: password
141 second:
142 address: private2.docker.com
143 user: username2
144 password: password2
Michael Kutý17649402016-03-19 23:57:43 +0100145
146Read more
147---------
148
149* https://docs.docker.com/installation/ubuntulinux/
150* https://github.com/saltstack-formulas/docker-formula
Filip Pytlounbaf94c92016-06-07 18:07:17 +0200151