diff options
Diffstat (limited to 'doc/md/docker')
-rw-r--r-- | doc/md/docker/shaarli-images.md | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/doc/md/docker/shaarli-images.md b/doc/md/docker/shaarli-images.md index 12f7b5d1..5948949a 100644 --- a/doc/md/docker/shaarli-images.md +++ b/doc/md/docker/shaarli-images.md | |||
@@ -8,9 +8,9 @@ The images can be found in the [`shaarli/shaarli`](https://hub.docker.com/r/shaa | |||
8 | repository. | 8 | repository. |
9 | 9 | ||
10 | ### Available image tags | 10 | ### Available image tags |
11 | - `latest`: latest branch (tarball release) | 11 | - `latest`: latest branch |
12 | - `master`: master branch (tarball release) | 12 | - `master`: master branch |
13 | - `stable`: stable branch (tarball release) | 13 | - `stable`: stable branch |
14 | 14 | ||
15 | The `latest` and `master` images rely on: | 15 | The `latest` and `master` images rely on: |
16 | 16 | ||
@@ -24,11 +24,18 @@ The `stable` image relies on: | |||
24 | - [PHP5-FPM](http://php-fpm.org/) | 24 | - [PHP5-FPM](http://php-fpm.org/) |
25 | - [Nginx](http://nginx.org/) | 25 | - [Nginx](http://nginx.org/) |
26 | 26 | ||
27 | Additional [Dockerfiles](https://github.com/shaarli/Shaarli/tree/master/docker) are provided for the `arm32v7` platform, relying on [Linuxserver.io Alpine armhf images](https://hub.docker.com/r/lsiobase/alpine.armhf/). These images must be built using [`docker build`](https://docs.docker.com/engine/reference/commandline/build/) on an `arm32v7` machine or using an emulator such as [qemu](https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/). | 27 | Additional Dockerfiles are provided for the `arm32v7` platform, relying on |
28 | [Linuxserver.io Alpine armhf | ||
29 | images](https://hub.docker.com/r/lsiobase/alpine.armhf/). These images must be | ||
30 | built using [`docker | ||
31 | build`](https://docs.docker.com/engine/reference/commandline/build/) on an | ||
32 | `arm32v7` machine or using an emulator such as | ||
33 | [qemu](https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/). | ||
28 | 34 | ||
29 | ### Download from DockerHub | 35 | ### Download from Docker Hub |
30 | ```bash | 36 | ```shell |
31 | $ docker pull shaarli/shaarli | 37 | $ docker pull shaarli/shaarli |
38 | |||
32 | latest: Pulling from shaarli/shaarli | 39 | latest: Pulling from shaarli/shaarli |
33 | 32716d9fcddb: Pull complete | 40 | 32716d9fcddb: Pull complete |
34 | 84899d045435: Pull complete | 41 | 84899d045435: Pull complete |
@@ -46,7 +53,7 @@ Status: Downloaded newer image for shaarli/shaarli:latest | |||
46 | ``` | 53 | ``` |
47 | 54 | ||
48 | ### Create and start a new container from the image | 55 | ### Create and start a new container from the image |
49 | ```bash | 56 | ```shell |
50 | # map the host's :8000 port to the container's :80 port | 57 | # map the host's :8000 port to the container's :80 port |
51 | $ docker create -p 8000:80 shaarli/shaarli | 58 | $ docker create -p 8000:80 shaarli/shaarli |
52 | d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | 59 | d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 |
@@ -62,7 +69,7 @@ d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds | |||
62 | ``` | 69 | ``` |
63 | 70 | ||
64 | ### Stop and destroy a container | 71 | ### Stop and destroy a container |
65 | ```bash | 72 | ```shell |
66 | $ docker stop backstabbing_galileo # those docker guys are really rude to physicists! | 73 | $ docker stop backstabbing_galileo # those docker guys are really rude to physicists! |
67 | backstabbing_galileo | 74 | backstabbing_galileo |
68 | 75 | ||
@@ -84,12 +91,34 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS | |||
84 | ``` | 91 | ``` |
85 | 92 | ||
86 | ### Automatic builds | 93 | ### Automatic builds |
94 | Docker users can start a personal instance from an | ||
95 | [autobuild image](https://hub.docker.com/r/shaarli/shaarli/). | ||
96 | For example to start a temporary Shaarli at ``localhost:8000``, and keep session | ||
97 | data (config, storage): | ||
87 | 98 | ||
88 | Docker users can start a personal instance from an [autobuild image](https://hub.docker.com/r/shaarli/shaarli/). For example to start a temporary Shaarli at ``localhost:8000``, and keep session data (config, storage): | 99 | ```shell |
89 | ``` | ||
90 | MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P) | 100 | MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P) |
91 | docker run -ti --rm \ | 101 | docker run -ti --rm \ |
92 | -p 8000:80 \ | 102 | -p 8000:80 \ |
93 | -v $MY_SHAARLI_VOLUME:/var/www/shaarli/data \ | 103 | -v $MY_SHAARLI_VOLUME:/var/www/shaarli/data \ |
94 | shaarli/shaarli | 104 | shaarli/shaarli |
95 | ``` | 105 | ``` |
106 | |||
107 | ### Volumes and data persistence | ||
108 | Data can be persisted by [using volumes](https://docs.docker.com/storage/volumes/). | ||
109 | Volumes allow to keep your data when renewing and/or updating container images: | ||
110 | |||
111 | ```shell | ||
112 | # Create data volumes | ||
113 | $ docker volume create shaarli-data | ||
114 | $ docker volume create shaarli-cache | ||
115 | |||
116 | # Create and start a Shaarli container using these volumes to persist data | ||
117 | $ docker create \ | ||
118 | --name shaarli \ | ||
119 | -v shaarli-cache:/var/www/shaarli/cache \ | ||
120 | -v shaarli-data:/var/www/shaarli/data \ | ||
121 | -p 8000:80 \ | ||
122 | shaarli/shaarli:master | ||
123 | $ docker start shaarli | ||
124 | ``` | ||