]>
Commit | Line | Data |
---|---|---|
32488257 | 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 | ||
53ed6d7d | 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 | |
fab0f4e5 V |
11 | - `latest`: latest branch (tarball release) |
12 | - `master`: master branch (tarball release) | |
53ed6d7d | 13 | - `stable`: stable branch (tarball release) |
53ed6d7d | 14 | |
fab0f4e5 V |
15 | The `latest` and `master` 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 | The `stable` image relies on: | |
22 | ||
53ed6d7d | 23 | - [Debian 8 Jessie](https://hub.docker.com/_/debian/) |
24 | - [PHP5-FPM](http://php-fpm.org/) | |
25 | - [Nginx](http://nginx.org/) | |
26 | ||
fab0f4e5 | 27 | |
53ed6d7d | 28 | ### Download from DockerHub |
29 | ```bash | |
30 | $ docker pull shaarli/shaarli | |
31 | latest: Pulling from shaarli/shaarli | |
32 | 32716d9fcddb: Pull complete | |
33 | 84899d045435: Pull complete | |
34 | 4b6ad7444763: Pull complete | |
35 | e0345ef7a3e0: Pull complete | |
36 | 5c1dd344094f: Pull complete | |
37 | 6422305a200b: Pull complete | |
38 | 7d63f861dbef: Pull complete | |
39 | 3eb97210645c: Pull complete | |
40 | 869319d746ff: Already exists | |
41 | 869319d746ff: Pulling fs layer | |
42 | 902b87aaaec9: Already exists | |
43 | Digest: sha256:f836b4627b958b3f83f59c332f22f02fcd495ace3056f2be2c4912bd8704cc98 | |
44 | Status: Downloaded newer image for shaarli/shaarli:latest | |
45 | ``` | |
46 | ||
47 | ### Create and start a new container from the image | |
48 | ```bash | |
49 | # map the host's :8000 port to the container's :80 port | |
50 | $ docker create -p 8000:80 shaarli/shaarli | |
51 | d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | |
52 | ||
53 | # launch the container in the background | |
54 | $ docker start d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | |
55 | d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101 | |
56 | ||
57 | # list active containers | |
58 | $ docker ps | |
59 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
60 | d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds 0.0.0.0:8000->80/tcp backstabbing_galileo | |
61 | ``` | |
62 | ||
63 | ### Stop and destroy a container | |
64 | ```bash | |
65 | $ docker stop backstabbing_galileo # those docker guys are really rude to physicists! | |
66 | backstabbing_galileo | |
67 | ||
68 | # check the container is stopped | |
69 | $ docker ps | |
70 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
71 | ||
72 | # list ALL containers | |
73 | $ docker ps -a | |
74 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
75 | d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 5 minutes ago Exited (0) 48 seconds ago backstabbing_galileo | |
76 | ||
77 | # destroy the container | |
78 | $ docker rm backstabbing_galileo # let's put an end to these barbarian practices | |
79 | backstabbing_galileo | |
80 | ||
81 | $ docker ps -a | |
82 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
83 | ``` | |
60ca6354 | 84 | |
85 | ### Automatic builds | |
86 | ||
87 | 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): | |
88 | ``` | |
89 | MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P) | |
90 | docker run -ti --rm \ | |
91 | -p 8000:80 \ | |
92 | -v $MY_SHAARLI_VOLUME:/var/www/shaarli/data \ | |
93 | shaarli/shaarli | |
94 | ``` |