diff options
Diffstat (limited to 'doc/md/docker')
-rw-r--r-- | doc/md/docker/docker-101.md | 62 | ||||
-rw-r--r-- | doc/md/docker/resources.md | 19 | ||||
-rw-r--r-- | doc/md/docker/reverse-proxy-configuration.md | 6 | ||||
-rw-r--r-- | doc/md/docker/shaarli-images.md | 71 |
4 files changed, 158 insertions, 0 deletions
diff --git a/doc/md/docker/docker-101.md b/doc/md/docker/docker-101.md new file mode 100644 index 00000000..b02dd149 --- /dev/null +++ b/doc/md/docker/docker-101.md | |||
@@ -0,0 +1,62 @@ | |||
1 | ## Basics | ||
2 | Install [Docker](https://www.docker.com/), by following the instructions relevant | ||
3 | to your OS / distribution, and start the service. | ||
4 | |||
5 | ### Search an image on [DockerHub](https://hub.docker.com/) | ||
6 | |||
7 | ```bash | ||
8 | $ docker search debian | ||
9 | |||
10 | NAME DESCRIPTION STARS OFFICIAL AUTOMATED | ||
11 | ubuntu Ubuntu is a Debian-based Linux operating s... 2065 [OK] | ||
12 | debian Debian is a Linux distribution that's comp... 603 [OK] | ||
13 | google/debian 47 [OK] | ||
14 | ``` | ||
15 | |||
16 | ### Show available tags for a repository | ||
17 | ```bash | ||
18 | $ curl https://index.docker.io/v1/repositories/debian/tags | python -m json.tool | ||
19 | |||
20 | % Total % Received % Xferd Average Speed Time Time Time Current | ||
21 | Dload Upload Total Spent Left Speed | ||
22 | 100 1283 0 1283 0 0 433 0 --:--:-- 0:00:02 --:--:-- 433 | ||
23 | ``` | ||
24 | |||
25 | Sample output: | ||
26 | ```json | ||
27 | [ | ||
28 | { | ||
29 | "layer": "85a02782", | ||
30 | "name": "stretch" | ||
31 | }, | ||
32 | { | ||
33 | "layer": "59abecbc", | ||
34 | "name": "testing" | ||
35 | }, | ||
36 | { | ||
37 | "layer": "bf0fd686", | ||
38 | "name": "unstable" | ||
39 | }, | ||
40 | { | ||
41 | "layer": "60c52dbe", | ||
42 | "name": "wheezy" | ||
43 | }, | ||
44 | { | ||
45 | "layer": "c5b806fe", | ||
46 | "name": "wheezy-backports" | ||
47 | } | ||
48 | ] | ||
49 | |||
50 | ``` | ||
51 | |||
52 | ### Pull an image from DockerHub | ||
53 | ```bash | ||
54 | $ docker pull repository[:tag] | ||
55 | |||
56 | $ docker pull debian:wheezy | ||
57 | wheezy: Pulling from debian | ||
58 | 4c8cbfd2973e: Pull complete | ||
59 | 60c52dbe9d91: Pull complete | ||
60 | Digest: sha256:c584131da2ac1948aa3e66468a4424b6aea2f33acba7cec0b631bdb56254c4fe | ||
61 | Status: Downloaded newer image for debian:wheezy | ||
62 | ``` | ||
diff --git a/doc/md/docker/resources.md b/doc/md/docker/resources.md new file mode 100644 index 00000000..082d4a46 --- /dev/null +++ b/doc/md/docker/resources.md | |||
@@ -0,0 +1,19 @@ | |||
1 | ### Docker | ||
2 | |||
3 | - [Interactive Docker training portal](https://www.katacoda.com/courses/docker/) on [Katakoda](https://www.katacoda.com/) | ||
4 | - [Where are Docker images stored?](http://blog.thoward37.me/articles/where-are-docker-images-stored/) | ||
5 | - [Dockerfile reference](https://docs.docker.com/reference/builder/) | ||
6 | - [Dockerfile best practices](https://docs.docker.com/articles/dockerfile_best-practices/) | ||
7 | - [Volumes](https://docs.docker.com/userguide/dockervolumes/) | ||
8 | |||
9 | ### DockerHub | ||
10 | |||
11 | - [Repositories](https://docs.docker.com/userguide/dockerrepos/) | ||
12 | - [Teams and organizations](https://docs.docker.com/docker-hub/orgs/) | ||
13 | - [GitHub automated build](https://docs.docker.com/docker-hub/github/) | ||
14 | |||
15 | ### Service management | ||
16 | |||
17 | - [Using supervisord](https://docs.docker.com/articles/using_supervisord/) | ||
18 | - [Nginx in the foreground](http://nginx.org/en/docs/ngx_core_module.html#daemon) | ||
19 | - [supervisord](http://supervisord.org/) | ||
diff --git a/doc/md/docker/reverse-proxy-configuration.md b/doc/md/docker/reverse-proxy-configuration.md new file mode 100644 index 00000000..91ffecff --- /dev/null +++ b/doc/md/docker/reverse-proxy-configuration.md | |||
@@ -0,0 +1,6 @@ | |||
1 | |||
2 | TODO, see https://github.com/shaarli/Shaarli/issues/888 | ||
3 | |||
4 | ## HAProxy | ||
5 | |||
6 | ## Nginx | ||
diff --git a/doc/md/docker/shaarli-images.md b/doc/md/docker/shaarli-images.md new file mode 100644 index 00000000..6d108d21 --- /dev/null +++ b/doc/md/docker/shaarli-images.md | |||
@@ -0,0 +1,71 @@ | |||
1 | ## Get and run a Shaarli image | ||
2 | |||
3 | ### DockerHub repository | ||
4 | The images can be found in the [`shaarli/shaarli`](https://hub.docker.com/r/shaarli/shaarli/) | ||
5 | repository. | ||
6 | |||
7 | ### Available image tags | ||
8 | - `latest`: master branch (tarball release) | ||
9 | - `stable`: stable branch (tarball release) | ||
10 | |||
11 | All images rely on: | ||
12 | - [Debian 8 Jessie](https://hub.docker.com/_/debian/) | ||
13 | - [PHP5-FPM](http://php-fpm.org/) | ||
14 | - [Nginx](http://nginx.org/) | ||
15 | |||
16 | ### Download from DockerHub | ||
17 | ```bash | ||
18 | $ docker pull shaarli/shaarli | ||
19 | latest: Pulling from shaarli/shaarli | ||
20 | 32716d9fcddb: Pull complete | ||
21 | 84899d045435: Pull complete | ||
22 | 4b6ad7444763: Pull complete | ||
23 | e0345ef7a3e0: Pull complete | ||
24 | 5c1dd344094f: Pull complete | ||
25 | 6422305a200b: Pull complete | ||
26 | 7d63f861dbef: Pull complete | ||
27 | 3eb97210645c: Pull complete | ||
28 | 869319d746ff: Already exists | ||
29 | 869319d746ff: Pulling fs layer | ||
30 | 902b87aaaec9: Already exists | ||
31 | Digest: sha256:f836b4627b958b3f83f59c332f22f02fcd495ace3056f2be2c4912bd8704cc98 | ||
32 | Status: Downloaded newer image for shaarli/shaarli:latest | ||
33 | ``` | ||
34 | |||
35 | ### Create and start a new container from the image | ||
36 | ```bash | ||
37 | # map the host's :8000 port to the container's :80 port | ||
38 | $ docker create -p 8000:80 shaarli/shaarli | ||
39 | d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | ||
40 | |||
41 | # launch the container in the background | ||
42 | $ docker start d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | ||
43 | d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | ||
44 | |||
45 | # list active containers | ||
46 | $ docker ps | ||
47 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
48 | d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds 0.0.0.0:8000->80/tcp backstabbing_galileo | ||
49 | ``` | ||
50 | |||
51 | ### Stop and destroy a container | ||
52 | ```bash | ||
53 | $ docker stop backstabbing_galileo # those docker guys are really rude to physicists! | ||
54 | backstabbing_galileo | ||
55 | |||
56 | # check the container is stopped | ||
57 | $ docker ps | ||
58 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
59 | |||
60 | # list ALL containers | ||
61 | $ docker ps -a | ||
62 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
63 | d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 5 minutes ago Exited (0) 48 seconds ago backstabbing_galileo | ||
64 | |||
65 | # destroy the container | ||
66 | $ docker rm backstabbing_galileo # let's put an end to these barbarian practices | ||
67 | backstabbing_galileo | ||
68 | |||
69 | $ docker ps -a | ||
70 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
71 | ``` | ||