]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - doc/md/docker/shaarli-images.md
docker: update image and usage documentation
[github/shaarli/Shaarli.git] / doc / md / docker / shaarli-images.md
CommitLineData
32488257 1A brief guide on getting starting using docker is given in [Docker 101](docker-101.md).
2To 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
7The images can be found in the [`shaarli/shaarli`](https://hub.docker.com/r/shaarli/shaarli/)
8repository.
9
10### Available image tags
c064d317
V
11- `latest`: latest branch
12- `master`: master branch
13- `stable`: stable branch
53ed6d7d 14
fab0f4e5
V
15The `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
21The `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
c064d317
V
27Additional Dockerfiles are provided for the `arm32v7` platform, relying on
28[Linuxserver.io Alpine armhf
29images](https://hub.docker.com/r/lsiobase/alpine.armhf/). These images must be
30built using [`docker
31build`](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/).
fab0f4e5 34
53ed6d7d 35### Download from DockerHub
36```bash
37$ docker pull shaarli/shaarli
38latest: Pulling from shaarli/shaarli
3932716d9fcddb: Pull complete
4084899d045435: Pull complete
414b6ad7444763: Pull complete
42e0345ef7a3e0: Pull complete
435c1dd344094f: Pull complete
446422305a200b: Pull complete
457d63f861dbef: Pull complete
463eb97210645c: Pull complete
47869319d746ff: Already exists
48869319d746ff: Pulling fs layer
49902b87aaaec9: Already exists
50Digest: sha256:f836b4627b958b3f83f59c332f22f02fcd495ace3056f2be2c4912bd8704cc98
51Status: Downloaded newer image for shaarli/shaarli:latest
52```
53
54### Create and start a new container from the image
55```bash
56# map the host's :8000 port to the container's :80 port
57$ docker create -p 8000:80 shaarli/shaarli
58d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101
59
60# launch the container in the background
61$ docker start d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101
62d40b7af693d678958adedfb88f87d6ea0237186c23de5c4102a55a8fcb499101
63
64# list active containers
65$ docker ps
66CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
67d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 15 seconds ago Up 4 seconds 0.0.0.0:8000->80/tcp backstabbing_galileo
68```
69
70### Stop and destroy a container
71```bash
72$ docker stop backstabbing_galileo # those docker guys are really rude to physicists!
73backstabbing_galileo
74
75# check the container is stopped
76$ docker ps
77CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
78
79# list ALL containers
80$ docker ps -a
81CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
82d40b7af693d6 shaarli/shaarli /usr/bin/supervisor 5 minutes ago Exited (0) 48 seconds ago backstabbing_galileo
83
84# destroy the container
85$ docker rm backstabbing_galileo # let's put an end to these barbarian practices
86backstabbing_galileo
87
88$ docker ps -a
89CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90```
60ca6354 91
92### Automatic builds
93
94Docker 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):
95```
96MY_SHAARLI_VOLUME=$(cd /path/to/shaarli/data/ && pwd -P)
97docker run -ti --rm \
98 -p 8000:80 \
99 -v $MY_SHAARLI_VOLUME:/var/www/shaarli/data \
100 shaarli/shaarli
101```