From 11a6ae8971c96780169d89f7e836a1494672bdac Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Thu, 18 Nov 2021 09:08:31 +0100
Subject: [PATCH] [doc] Document Docker images usage

---
 README.md     |  4 ++++
 doc/docker.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100644 doc/docker.md

diff --git a/README.md b/README.md
index 66b72657..e1c84858 100644
--- a/README.md
+++ b/README.md
@@ -24,6 +24,10 @@ If you want a more recent version [install with Pip](doc/install_pip.md):
 pip3 install silkaj --user
 ```
 
+### Docker images
+There is two kind of images. One build with `pip` for user purposes, and one using Poetry for developer purposes.
+- [Docker images](doc/docker.md)
+
 ### For contributing purposes
 - [Install the Poetry development environment](doc/install_poetry.md)
 - Check out the [contributing guidelines](CONTRIBUTING.md)
diff --git a/doc/docker.md b/doc/docker.md
new file mode 100644
index 00000000..c2dc56c6
--- /dev/null
+++ b/doc/docker.md
@@ -0,0 +1,57 @@
+### Docker images
+There are two kind of images. The one built with `pip` for user purposes, and the one built with Poetry for developer purposes.
+
+We are using `podman` instead of `docker` command for not having to run the command as `root`.
+
+In case you use `docker`, you can [add your user into the `docker` group, so you can manipulate `docker` executable without `root` permissions](https://askubuntu.com/a/739861).
+
+Feel free to replace `podman` with `sudo docker`.
+
+#### User
+Pull the image:
+```bash
+podman pull registry.duniter.org/clients/python/silkaj/release/pip:latest
+```
+Run Silkaj from outside the image:
+```bash
+podman run -it registry.duniter.org/clients/python/silkaj/release/pip:latest silkaj info
+```
+
+Go into the image, then run Silkaj:
+```bash
+podman run -it registry.duniter.org/clients/python/silkaj/release/pip:latest bash
+silkaj info
+```
+
+The working directory is where Silkaj sources are installed in Python `site-packages`.
+This is fine for doing small editions. For bigger editions, it is adviced to use a development environment with Poetry.
+
+#### Developer
+`git` is installed, so it can be used as a development environment.
+
+Pull the image:
+```bash
+podman pull registry.duniter.org/clients/python/silkaj/release/poetry:latest
+```
+
+Run Silkaj from ouside the image:
+```bash
+podman run -it registry.duniter.org/clients/python/silkaj/release/poetry:latest silkaj info
+```
+
+Go into the image, then run Silkaj:
+```bash
+podman run -it registry.duniter.org/clients/python/silkaj/release/poetry:latest bash
+silkaj info
+```
+
+The working directory contains Silkaj sources. Set up the repository to have it ready for developments:
+```bash
+git checkout dev
+git remote set-url origin https://git@git.duniter.org/clients/python/silkaj.git
+```
+
+```bash
+git config --global user.email "you@example.com"
+git config --global user.name "Your Name"
+```
-- 
GitLab