diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-10-12 13:58:35 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-10-12 13:58:35 +0200 |
commit | bc22c9a0acb095970e9494cbe8954f0612e05dc0 (patch) | |
tree | 4e3a94b7469f5b2e3eaf946756235730429bf9d4 /doc/Docker.html | |
parent | 890afc32f744859d11b97eb26ed5c030af9b4145 (diff) | |
parent | ebd67c6e1b40aebdd3a52285ce9ff9412b2a3038 (diff) | |
download | Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.tar.gz Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.tar.zst Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.zip |
Merge tag 'v0.7.0' of github.com:shaarli/Shaarli into stable
Release v0.7.0
Diffstat (limited to 'doc/Docker.html')
-rw-r--r-- | doc/Docker.html | 244 |
1 files changed, 244 insertions, 0 deletions
diff --git a/doc/Docker.html b/doc/Docker.html new file mode 100644 index 00000000..a443d100 --- /dev/null +++ b/doc/Docker.html | |||
@@ -0,0 +1,244 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <meta charset="utf-8"> | ||
5 | <meta name="generator" content="pandoc"> | ||
6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> | ||
7 | <title>Shaarli – Docker</title> | ||
8 | <style type="text/css">code{white-space: pre;}</style> | ||
9 | <style type="text/css"> | ||
10 | div.sourceCode { overflow-x: auto; } | ||
11 | table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { | ||
12 | margin: 0; padding: 0; vertical-align: baseline; border: none; } | ||
13 | table.sourceCode { width: 100%; line-height: 100%; } | ||
14 | td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; } | ||
15 | td.sourceCode { padding-left: 5px; } | ||
16 | code > span.kw { color: #007020; font-weight: bold; } /* Keyword */ | ||
17 | code > span.dt { color: #902000; } /* DataType */ | ||
18 | code > span.dv { color: #40a070; } /* DecVal */ | ||
19 | code > span.bn { color: #40a070; } /* BaseN */ | ||
20 | code > span.fl { color: #40a070; } /* Float */ | ||
21 | code > span.ch { color: #4070a0; } /* Char */ | ||
22 | code > span.st { color: #4070a0; } /* String */ | ||
23 | code > span.co { color: #60a0b0; font-style: italic; } /* Comment */ | ||
24 | code > span.ot { color: #007020; } /* Other */ | ||
25 | code > span.al { color: #ff0000; font-weight: bold; } /* Alert */ | ||
26 | code > span.fu { color: #06287e; } /* Function */ | ||
27 | code > span.er { color: #ff0000; font-weight: bold; } /* Error */ | ||
28 | code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ | ||
29 | code > span.cn { color: #880000; } /* Constant */ | ||
30 | code > span.sc { color: #4070a0; } /* SpecialChar */ | ||
31 | code > span.vs { color: #4070a0; } /* VerbatimString */ | ||
32 | code > span.ss { color: #bb6688; } /* SpecialString */ | ||
33 | code > span.im { } /* Import */ | ||
34 | code > span.va { color: #19177c; } /* Variable */ | ||
35 | code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ | ||
36 | code > span.op { color: #666666; } /* Operator */ | ||
37 | code > span.bu { } /* BuiltIn */ | ||
38 | code > span.ex { } /* Extension */ | ||
39 | code > span.pp { color: #bc7a00; } /* Preprocessor */ | ||
40 | code > span.at { color: #7d9029; } /* Attribute */ | ||
41 | code > span.do { color: #ba2121; font-style: italic; } /* Documentation */ | ||
42 | code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ | ||
43 | code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ | ||
44 | code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ | ||
45 | </style> | ||
46 | <link rel="stylesheet" href="github-markdown.css"> | ||
47 | <!--[if lt IE 9]> | ||
48 | <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> | ||
49 | <![endif]--> | ||
50 | </head> | ||
51 | <body> | ||
52 | <div id="local-sidebar"> | ||
53 | <ul> | ||
54 | <li><a href="Home.html">Home</a></li> | ||
55 | <li>Installation | ||
56 | <ul> | ||
57 | <li><a href="Download.html">Download</a></li> | ||
58 | <li><a href="Server-requirements.html">Server requirements</a></li> | ||
59 | <li><a href="Server-configuration.html">Server configuration</a></li> | ||
60 | <li><a href="Server-security.html">Server security</a></li> | ||
61 | <li><a href="Shaarli-installation.html">Shaarli installation</a></li> | ||
62 | <li><a href="Shaarli-configuration.html">Shaarli configuration</a></li> | ||
63 | <li><a href="Plugins.html">Plugins</a></li> | ||
64 | </ul></li> | ||
65 | <li><a href="Docker.html">Docker</a></li> | ||
66 | <li><a href="Usage.html">Usage</a> | ||
67 | <ul> | ||
68 | <li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li> | ||
69 | <li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li> | ||
70 | <li><a href="Firefox-share.html">Firefox share</a></li> | ||
71 | <li><a href="RSS-feeds.html">RSS feeds</a></li> | ||
72 | </ul></li> | ||
73 | <li>How To | ||
74 | <ul> | ||
75 | <li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li> | ||
76 | <li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li> | ||
77 | <li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li> | ||
78 | <li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li> | ||
79 | <li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li> | ||
80 | <li><a href="Datastore-hacks.html">Datastore hacks</a></li> | ||
81 | </ul></li> | ||
82 | <li><a href="Troubleshooting.html">Troubleshooting</a></li> | ||
83 | <li><a href="Development.html">Development</a> | ||
84 | <ul> | ||
85 | <li><a href="GnuPG-signature.html">GnuPG signature</a></li> | ||
86 | <li><a href="Coding-guidelines.html">Coding guidelines</a></li> | ||
87 | <li><a href="Directory-structure.html">Directory structure</a></li> | ||
88 | <li><a href="3rd-party-libraries.html">3rd party libraries</a></li> | ||
89 | <li><a href="Plugin-System.html">Plugin System</a></li> | ||
90 | <li><a href="Release-Shaarli.html">Release Shaarli</a></li> | ||
91 | <li><a href="Security.html">Security</a></li> | ||
92 | <li><a href="Static-analysis.html">Static analysis</a></li> | ||
93 | <li><a href="Theming.html">Theming</a></li> | ||
94 | <li><a href="Unit-tests.html">Unit tests</a></li> | ||
95 | </ul></li> | ||
96 | <li>About | ||
97 | <ul> | ||
98 | <li><a href="FAQ.html">FAQ</a></li> | ||
99 | <li><a href="Community-&-Related-software.html">Community & Related software</a></li> | ||
100 | <li><a href="TODO.html">TODO</a></li> | ||
101 | </ul></li> | ||
102 | </ul> | ||
103 | </div> | ||
104 | <h1 id="docker">Docker</h1> | ||
105 | <ul> | ||
106 | <li><a href="#docker-usage">Docker usage</a><a href=".html"></a></li> | ||
107 | <li><a href="#get-and-run-a-shaarli-image">Get and run a Shaarli image</a><a href=".html"></a></li> | ||
108 | <li><a href="#resources">Resources</a><a href=".html"></a></li> | ||
109 | </ul> | ||
110 | <h2 id="docker-usage">Docker usage</h2> | ||
111 | <h3 id="basics">Basics</h3> | ||
112 | <p>Install <a href="https://www.docker.com/">Docker</a>, by following the instructions relevant<a href=".html"></a><br /> | ||
113 | to your OS / distribution, and start the service.</p> | ||
114 | <h4 id="search-an-image-on-dockerhub">Search an image on <a href="https://hub.docker.com/">DockerHub</a><a href=".html"></a></h4> | ||
115 | <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">docker</span> search debian | ||
116 | |||
117 | <span class="kw">NAME</span> DESCRIPTION STARS OFFICIAL AUTOMATED | ||
118 | <span class="kw">ubuntu</span> Ubuntu is a Debian-based Linux operating s... 2065 [OK][](.html) | ||
119 | <span class="kw">debian</span> Debian is a Linux distribution that<span class="st">'s comp... 603 [OK][](.html)</span> | ||
120 | <span class="st">google/debian 47 [OK][](.html)</span></code></pre></div> | ||
121 | <h4 id="show-available-tags-for-a-repository">Show available tags for a repository</h4> | ||
122 | <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">curl</span> https://index.docker.io/v1/repositories/debian/tags <span class="kw">|</span> <span class="kw">python</span> -m json.tool | ||
123 | |||
124 | <span class="kw">%</span> Total % Received % Xferd Average Speed Time Time Time Current | ||
125 | <span class="kw">Dload</span> Upload Total Spent Left Speed | ||
126 | <span class="kw">100</span> 1283 0 1283 0 0 433 0 --:--:-- 0:00:02 --:--:-- 433</code></pre></div> | ||
127 | <p>Sample output:</p> | ||
128 | <div class="sourceCode"><pre class="sourceCode json"><code class="sourceCode json"><span class="ot">[[]</span><span class="er">(.html)</span> | ||
129 | <span class="fu">{</span> | ||
130 | <span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"85a02782"</span><span class="fu">,</span> | ||
131 | <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"stretch"</span> | ||
132 | <span class="fu">}</span><span class="ot">,</span> | ||
133 | <span class="fu">{</span> | ||
134 | <span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"59abecbc"</span><span class="fu">,</span> | ||
135 | <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"testing"</span> | ||
136 | <span class="fu">}</span><span class="ot">,</span> | ||
137 | <span class="fu">{</span> | ||
138 | <span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"bf0fd686"</span><span class="fu">,</span> | ||
139 | <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"unstable"</span> | ||
140 | <span class="fu">}</span><span class="ot">,</span> | ||
141 | <span class="fu">{</span> | ||
142 | <span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"60c52dbe"</span><span class="fu">,</span> | ||
143 | <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"wheezy"</span> | ||
144 | <span class="fu">}</span><span class="ot">,</span> | ||
145 | <span class="fu">{</span> | ||
146 | <span class="dt">"layer"</span><span class="fu">:</span> <span class="st">"c5b806fe"</span><span class="fu">,</span> | ||
147 | <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"wheezy-backports"</span> | ||
148 | <span class="fu">}</span> | ||
149 | <span class="ot">]</span></code></pre></div> | ||
150 | <h4 id="pull-an-image-from-dockerhub">Pull an image from DockerHub</h4> | ||
151 | <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">docker</span> pull repository[:tag][](.html) | ||
152 | |||
153 | $ <span class="kw">docker</span> pull debian:wheezy | ||
154 | <span class="kw">wheezy</span>: Pulling from debian | ||
155 | <span class="kw">4c8cbfd2973e</span>: Pull complete | ||
156 | <span class="kw">60c52dbe9d91</span>: Pull complete | ||
157 | <span class="kw">Digest</span>: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe | ||
158 | <span class="kw">Status</span>: Downloaded newer image for debian:wheezy</code></pre></div> | ||
159 | <h2 id="get-and-run-a-shaarli-image">Get and run a Shaarli image</h2> | ||
160 | <h3 id="dockerhub-repository">DockerHub repository</h3> | ||
161 | <p>The images can be found in the <a href="https://hub.docker.com/r/shaarli/shaarli/"><code>shaarli/shaarli</code></a><a href=".html"></a><br /> | ||
162 | repository.</p> | ||
163 | <h3 id="available-image-tags">Available image tags</h3> | ||
164 | <ul> | ||
165 | <li><code>latest</code>: master branch (tarball release)</li> | ||
166 | <li><code>stable</code>: stable branch (tarball release)</li> | ||
167 | <li><code>dev</code>: master branch (Git clone)</li> | ||
168 | </ul> | ||
169 | <p>All images rely on:</p> | ||
170 | <ul> | ||
171 | <li><a href="https://hub.docker.com/_/debian/">Debian 8 Jessie</a><a href=".html"></a></li> | ||
172 | <li><a href="http://php-fpm.org/">PHP5-FPM</a><a href=".html"></a></li> | ||
173 | <li><a href="http://nginx.org/">Nginx</a><a href=".html"></a></li> | ||
174 | </ul> | ||
175 | <h3 id="download-from-dockerhub">Download from DockerHub</h3> | ||
176 | <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">docker</span> pull shaarli/shaarli | ||
177 | <span class="kw">latest</span>: Pulling from shaarli/shaarli | ||
178 | <span class="kw">32716d9fcddb</span>: Pull complete | ||
179 | <span class="kw">84899d045435</span>: Pull complete | ||
180 | <span class="kw">4b6ad7444763</span>: Pull complete | ||
181 | <span class="kw">e0345ef7a3e0</span>: Pull complete | ||
182 | <span class="kw">5c1dd344094f</span>: Pull complete | ||
183 | <span class="kw">6422305a200b</span>: Pull complete | ||
184 | <span class="kw">7d63f861dbef</span>: Pull complete | ||
185 | <span class="kw">3eb97210645c</span>: Pull complete | ||
186 | <span class="kw">869319d746ff</span>: Already exists | ||
187 | <span class="kw">869319d746ff</span>: Pulling fs layer | ||
188 | <span class="kw">902b87aaaec9</span>: Already exists | ||
189 | <span class="kw">Digest</span>: sha256:f836b4627b958b3f83f59c332f22f02fcd495ace3056f2be2c4912bd8704cc98 | ||
190 | <span class="kw">Status</span>: Downloaded newer image for shaarli/shaarli:latest</code></pre></div> | ||
191 | <h3 id="create-and-start-a-new-container-from-the-image">Create and start a new container from the image</h3> | ||
192 | <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># map the host's :8000 port to the container's :80 port</span> | ||
193 | $ <span class="kw">docker</span> create -p 8000:80 shaarli/shaarli | ||
194 | <span class="kw">d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101</span> | ||
195 | |||
196 | <span class="co"># launch the container in the background</span> | ||
197 | $ <span class="kw">docker</span> start d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | ||
198 | <span class="kw">d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101</span> | ||
199 | |||
200 | <span class="co"># list active containers</span> | ||
201 | $ <span class="kw">docker</span> ps | ||
202 | <span class="kw">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
203 | <span class="kw">d40b7af693d6</span> shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds 0.0.0.0:8000-<span class="kw">></span>80/tcp backstabbing_galileo</code></pre></div> | ||
204 | <h3 id="stop-and-destroy-a-container">Stop and destroy a container</h3> | ||
205 | <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash">$ <span class="kw">docker</span> stop backstabbing_galileo <span class="co"># those docker guys are really rude to physicists!</span> | ||
206 | <span class="kw">backstabbing_galileo</span> | ||
207 | |||
208 | <span class="co"># check the container is stopped</span> | ||
209 | $ <span class="kw">docker</span> ps | ||
210 | <span class="kw">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
211 | |||
212 | <span class="co"># list ALL containers</span> | ||
213 | $ <span class="kw">docker</span> ps -a | ||
214 | <span class="kw">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
215 | <span class="kw">d40b7af693d6</span> shaarli/shaarli /usr/bin/supervisor 5 minutes ago Exited (0) <span class="kw">48</span> seconds ago backstabbing_galileo | ||
216 | |||
217 | <span class="co"># destroy the container</span> | ||
218 | $ <span class="kw">docker</span> rm backstabbing_galileo <span class="co"># let's put an end to these barbarian practices</span> | ||
219 | <span class="kw">backstabbing_galileo</span> | ||
220 | |||
221 | $ <span class="kw">docker</span> ps -a | ||
222 | <span class="kw">CONTAINER</span> ID IMAGE COMMAND CREATED STATUS PORTS NAMES</code></pre></div> | ||
223 | <h2 id="resources">Resources</h2> | ||
224 | <h3 id="docker-1">Docker</h3> | ||
225 | <ul> | ||
226 | <li><a href="http://blog.thoward37.me/articles/where-are-docker-images-stored/">Where are Docker images stored?</a><a href=".html"></a></li> | ||
227 | <li><a href="https://docs.docker.com/reference/builder/">Dockerfile reference</a><a href=".html"></a></li> | ||
228 | <li><a href="https://docs.docker.com/articles/dockerfile_best-practices/">Dockerfile best practices</a><a href=".html"></a></li> | ||
229 | <li><a href="https://docs.docker.com/userguide/dockervolumes/">Volumes</a><a href=".html"></a></li> | ||
230 | </ul> | ||
231 | <h3 id="dockerhub">DockerHub</h3> | ||
232 | <ul> | ||
233 | <li><a href="https://docs.docker.com/userguide/dockerrepos/">Repositories</a><a href=".html"></a></li> | ||
234 | <li><a href="https://docs.docker.com/docker-hub/orgs/">Teams and organizations</a><a href=".html"></a></li> | ||
235 | <li><a href="https://docs.docker.com/docker-hub/github/">GitHub automated build</a><a href=".html"></a></li> | ||
236 | </ul> | ||
237 | <h3 id="service-management">Service management</h3> | ||
238 | <ul> | ||
239 | <li><a href="https://docs.docker.com/articles/using_supervisord/">Using supervisord</a><a href=".html"></a></li> | ||
240 | <li><a href="http://nginx.org/en/docs/ngx_core_module.html#daemon">Nginx in the foreground</a><a href=".html"></a></li> | ||
241 | <li><a href="http://supervisord.org/">supervisord</a><a href=".html"></a></li> | ||
242 | </ul> | ||
243 | </body> | ||
244 | </html> | ||