Michael Kutý | 1764940 | 2016-03-19 23:57:43 +0100 | [diff] [blame] | 1 | |
| 2 | ====== |
| 3 | Docker |
| 4 | ====== |
| 5 | |
| 6 | 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. |
| 7 | |
| 8 | Docker 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 | |
| 15 | Sample pillar |
| 16 | ------------- |
| 17 | |
Filip Pytloun | e27a90d | 2016-08-29 14:08:34 +0200 | [diff] [blame] | 18 | Host |
| 19 | ---- |
| 20 | |
Michael Kutý | 1764940 | 2016-03-19 23:57:43 +0100 | [diff] [blame] | 21 | .. code-block:: yaml |
| 22 | |
| 23 | docker: |
| 24 | host: |
| 25 | enabled: true |
| 26 | |
Filip Pytloun | e27a90d | 2016-08-29 14:08:34 +0200 | [diff] [blame] | 27 | Client |
| 28 | ------ |
Michael Kutý | 1764940 | 2016-03-19 23:57:43 +0100 | [diff] [blame] | 29 | |
Filip Pytloun | 96fc0cc | 2016-08-29 16:01:10 +0200 | [diff] [blame] | 30 | Container |
| 31 | ~~~~~~~~~ |
| 32 | |
| 33 | .. code-block:: yaml |
| 34 | |
Michael Kutý | 1764940 | 2016-03-19 23:57:43 +0100 | [diff] [blame] | 35 | docker: |
Filip Pytloun | e27a90d | 2016-08-29 14:08:34 +0200 | [diff] [blame] | 36 | client: |
Michael Kutý | 1764940 | 2016-03-19 23:57:43 +0100 | [diff] [blame] | 37 | container: |
Filip Pytloun | 8716954 | 2016-08-29 13:38:30 +0200 | [diff] [blame] | 38 | jenkins: |
| 39 | # Don't start automatically |
| 40 | start: false |
| 41 | restart: unless-stopped |
| 42 | image: jenkins:2.7.1 |
Michael Kutý | 1764940 | 2016-03-19 23:57:43 +0100 | [diff] [blame] | 43 | ports: |
Filip Pytloun | 8716954 | 2016-08-29 13:38:30 +0200 | [diff] [blame] | 44 | - 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ý | 1764940 | 2016-03-19 23:57:43 +0100 | [diff] [blame] | 50 | |
Filip Pytloun | 96fc0cc | 2016-08-29 16:01:10 +0200 | [diff] [blame] | 51 | Compose |
| 52 | ~~~~~~~ |
| 53 | |
| 54 | Install docker-compose using Pip (default is distribution package) |
| 55 | |
| 56 | .. code-block:: yaml |
| 57 | |
| 58 | docker: |
| 59 | client: |
| 60 | compose: |
| 61 | django_web: |
| 62 | # Run up action, any positional argument to docker-compose CLI |
| 63 | # If not defined, only docker-compose.yml is generated |
| 64 | status: up |
| 65 | environment: |
| 66 | SOMEVAR: somevalue |
| 67 | service: |
| 68 | db: |
| 69 | image: postgres |
| 70 | web: |
| 71 | image: djangoapp |
| 72 | volumes: |
| 73 | - /srv/volumes/django:/srv/django |
| 74 | ports: |
| 75 | - 8000:8000 |
| 76 | depends_on: |
| 77 | - db |
| 78 | |
| 79 | |
Filip Pytloun | baf94c9 | 2016-06-07 18:07:17 +0200 | [diff] [blame] | 80 | Registry |
| 81 | -------- |
| 82 | |
| 83 | .. code-block:: yaml |
| 84 | |
| 85 | docker: |
| 86 | registry: |
| 87 | log: |
| 88 | level: debug |
| 89 | formatter: json |
| 90 | cache: |
| 91 | engine: redis |
| 92 | host: localhost |
| 93 | storage: |
| 94 | engine: filesystem |
| 95 | root: /srv/docker/registry |
| 96 | bind: |
| 97 | host: 0.0.0.0 |
| 98 | port: 5000 |
| 99 | hook: |
| 100 | mail: |
| 101 | levels: |
| 102 | - panic |
| 103 | # Options are rendered as yaml as is so use hook-specific options here |
| 104 | options: |
| 105 | smtp: |
| 106 | addr: smtp.sendhost.com:25 |
| 107 | username: sendername |
| 108 | password: password |
| 109 | insecure: true |
| 110 | from: name@sendhost.com |
| 111 | to: |
| 112 | - name@receivehost.com |
| 113 | |
marco | 85b72a6 | 2016-07-07 13:08:33 +0200 | [diff] [blame] | 114 | Docker login to private registry |
| 115 | -------------------------------- |
| 116 | |
| 117 | .. code-block:: yaml |
| 118 | |
| 119 | docker: |
| 120 | host: |
| 121 | enabled: true |
| 122 | registry: |
| 123 | first: |
| 124 | address: private.docker.com |
| 125 | user: username |
| 126 | password: password |
| 127 | second: |
| 128 | address: private2.docker.com |
| 129 | user: username2 |
| 130 | password: password2 |
Michael Kutý | 1764940 | 2016-03-19 23:57:43 +0100 | [diff] [blame] | 131 | |
| 132 | Read more |
| 133 | --------- |
| 134 | |
| 135 | * https://docs.docker.com/installation/ubuntulinux/ |
| 136 | * https://github.com/saltstack-formulas/docker-formula |
Filip Pytloun | baf94c9 | 2016-06-07 18:07:17 +0200 | [diff] [blame] | 137 | |