diff options
author | nodiscc <nodiscc@gmail.com> | 2020-09-12 12:38:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-12 12:38:05 +0000 |
commit | e809908f9e593b2cec11f72849caa1dae6394451 (patch) | |
tree | b26f77ec59b7c25800599d751212db72cfc65870 /doc/md/docker/shaarli-images.md | |
parent | 6128ab6a55430a2b705be31ff417c0c552a0db1f (diff) | |
parent | 97870f35121bed42ac126652d81bc43416b44356 (diff) | |
download | Shaarli-e809908f9e593b2cec11f72849caa1dae6394451.tar.gz Shaarli-e809908f9e593b2cec11f72849caa1dae6394451.tar.zst Shaarli-e809908f9e593b2cec11f72849caa1dae6394451.zip |
Merge pull request #1389 from shaarli/doc-rework-setup
doc: rework installation/setup guides, general refactoring
Diffstat (limited to 'doc/md/docker/shaarli-images.md')
-rw-r--r-- | doc/md/docker/shaarli-images.md | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/doc/md/docker/shaarli-images.md b/doc/md/docker/shaarli-images.md deleted file mode 100644 index 14971d54..00000000 --- a/doc/md/docker/shaarli-images.md +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | A brief guide on getting starting using docker is given in [Docker 101](docker-101.md). | ||
2 | To learn more about user data and how to keep it across versions, please see [Upgrade and Migration](../Upgrade-and-migration.md). | ||
3 | |||
4 | ## Get and run a Shaarli image | ||
5 | |||
6 | ### DockerHub repository | ||
7 | The images can be found in the [`shaarli/shaarli`](https://hub.docker.com/r/shaarli/shaarli/) | ||
8 | repository. | ||
9 | |||
10 | ### Available image tags | ||
11 | - `latest`: latest branch | ||
12 | - `master`: master branch | ||
13 | - `stable`: stable branch | ||
14 | |||
15 | The `latest`, `master` and `stable` images rely on: | ||
16 | |||
17 | - [Alpine Linux](https://www.alpinelinux.org/) | ||
18 | - [PHP7-FPM](http://php-fpm.org/) | ||
19 | - [Nginx](http://nginx.org/) | ||
20 | |||
21 | Additional Dockerfiles are provided for the `arm32v7` platform, relying on | ||
22 | [Linuxserver.io Alpine armhf | ||
23 | images](https://hub.docker.com/r/lsiobase/alpine.armhf/). These images must be | ||
24 | built using [`docker | ||
25 | build`](https://docs.docker.com/engine/reference/commandline/build/) on an | ||
26 | `arm32v7` machine or using an emulator such as | ||
27 | [qemu](https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/). | ||
28 | |||
29 | ### Download from Docker Hub | ||
30 | ```shell | ||
31 | $ docker pull shaarli/shaarli | ||
32 | |||
33 | latest: Pulling from shaarli/shaarli | ||
34 | 32716d9fcddb: Pull complete | ||
35 | 84899d045435: Pull complete | ||
36 | 4b6ad7444763: Pull complete | ||
37 | e0345ef7a3e0: Pull complete | ||
38 | 5c1dd344094f: Pull complete | ||
39 | 6422305a200b: Pull complete | ||
40 | 7d63f861dbef: Pull complete | ||
41 | 3eb97210645c: Pull complete | ||
42 | 869319d746ff: Already exists | ||
43 | 869319d746ff: Pulling fs layer | ||
44 | 902b87aaaec9: Already exists | ||
45 | Digest: sha256:f836b4627b958b3f83f59c332f22f02fcd495ace3056f2be2c4912bd8704cc98 | ||
46 | Status: Downloaded newer image for shaarli/shaarli:latest | ||
47 | ``` | ||
48 | |||
49 | ### Create and start a new container from the image | ||
50 | ```shell | ||
51 | # map the host's :8000 port to the container's :80 port | ||
52 | $ docker create -p 8000:80 shaarli/shaarli | ||
53 | d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | ||
54 | |||
55 | # launch the container in the background | ||
56 | $ docker start d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | ||
57 | d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | ||
58 | |||
59 | # list active containers | ||
60 | $ docker ps | ||
61 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
62 | d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds 0.0.0.0:8000->80/tcp backstabbing_galileo | ||
63 | ``` | ||
64 | |||
65 | ### Stop and destroy a container | ||
66 | ```shell | ||
67 | $ docker stop backstabbing_galileo # those docker guys are really rude to physicists! | ||
68 | backstabbing_galileo | ||
69 | |||
70 | # check the container is stopped | ||
71 | $ docker ps | ||
72 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
73 | |||
74 | # list ALL containers | ||
75 | $ docker ps -a | ||
76 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
77 | d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 5 minutes ago Exited (0) 48 seconds ago backstabbing_galileo | ||
78 | |||
79 | # destroy the container | ||
80 | $ docker rm backstabbing_galileo # let's put an end to these barbarian practices | ||
81 | backstabbing_galileo | ||
82 | |||
83 | $ docker ps -a | ||
84 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
85 | ``` | ||
86 | |||
87 | ### Automatic builds | ||
88 | Docker users can start a personal instance from an | ||
89 | [autobuild image](https://hub.docker.com/r/shaarli/shaarli/). | ||
90 | For example to start a temporary Shaarli at ``localhost:8000``, and keep session | ||
91 | data (config, storage): | ||
92 | |||
93 | ```shell | ||
94 | MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P) | ||
95 | docker run -ti --rm \ | ||
96 | -p 8000:80 \ | ||
97 | -v $MY_SHAARLI_VOLUME:/var/www/shaarli/data \ | ||
98 | shaarli/shaarli | ||
99 | ``` | ||
100 | |||
101 | ### Volumes and data persistence | ||
102 | Data can be persisted by [using volumes](https://docs.docker.com/storage/volumes/). | ||
103 | Volumes allow to keep your data when renewing and/or updating container images: | ||
104 | |||
105 | ```shell | ||
106 | # Create data volumes | ||
107 | $ docker volume create shaarli-data | ||
108 | $ docker volume create shaarli-cache | ||
109 | |||
110 | # Create and start a Shaarli container using these volumes to persist data | ||
111 | $ docker create \ | ||
112 | --name shaarli \ | ||
113 | -v shaarli-cache:/var/www/shaarli/cache \ | ||
114 | -v shaarli-data:/var/www/shaarli/data \ | ||
115 | -p 8000:80 \ | ||
116 | shaarli/shaarli:master | ||
117 | $ docker start shaarli | ||
118 | ``` | ||