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