Unverified Commit a2c79c49 authored by Stéphane Veyret's avatar Stéphane Veyret
Browse files

Update Docker documentation

parent 5ed774cc
......@@ -134,11 +134,11 @@ For other distributions, there is a binary file containing the _desktop_ version
To get the image of the last version:
docker pull duniter/duniter-ts
docker pull duniter/duniter
It is then possible to create the container with:
docker run -d -p127.0.0.1:9220:9220 -p10901:10901 -p20901:20901 --name duniter duniter/duniter-ts
docker run -d -p127.0.0.1:9220:9220 -p10901:10901 -p20901:20901 --name duniter duniter/duniter
Without any other option, the container will automatically execute `duniter direct_webstart`. The `-d` in the command line make the container being executed in the background (daemon). The `--name` option is used to give a unique name to the container, which will then be easier to use for the next commands. The `-p` options are used to connect in-container ports with the host ones:
......@@ -146,7 +146,7 @@ Without any other option, the container will automatically execute `duniter dire
* port 10901 is used for BMA access; exporting this port is then only necessary if you activate BMA.
* port 20901 is used for WS2P access.
> Note : do not use both daemon options for Duniter and Docker (for example: `docker run -d duniter/duniter-ts webstart`) or the container will immediately stop.
> Note : do not use both daemon options for Duniter and Docker (for example: `docker run -d duniter/duniter webstart`) or the container will immediately stop.
Once the node is started, it is accessable either using web UI, going to http://localhost:9220, either using command line:
......@@ -159,22 +159,30 @@ You can stop and restart the container using standard Docker commands:
docker stop duniter
docker start duniter
### Using a keyfile
### Volumes
If the file `/etc/duniter/keys.yml` is found on the container, it is used as keyfile for the node identity. For this file is visible by Duniter, it must be granted appropriate access rights. If the file `keys.yml` is for example on the host in the `~/duniter/conf` directory, here are the commands to execute for it is used:
The container creates 2 Docker volumes. The first one is attached to `/etc/duniter` and contains the Duniter configuration (see the _keyfile_ chapter below). The other one is attached to the Duniter home directory `/var/lib/duniter`. This is the place the Duniter database will be stored.
chown -R 1111:1111 ~/duniter/conf
chmod -R 644 ~/duniter/conf
docker run -d -p127.0.0.1:9220:9220 -p10901:10901 -p20901:20901 --mount src=~/duniter/conf,dst=/etc/duniter --name duniter duniter/duniter-ts
You can specify where these directories must be mounted. This would be usefull in order for the data to persist even if, for example, you delete your container because you want to get a new version of the image.
> Note: some of the above commands need “root” access, usage of `sudo` may be required.
For example, if you want the database to be stored on a `duniter-db` Docker volume, you may create the container using this command:
### Configuration external storage
docker run -d -p127.0.0.1:9220:9220 -p10901:10901 -p20901:20901 --mount type=volume,src=duniter-db,dst=/var/lib/duniter --name duniter duniter/duniter
By default, configuration and database are stored on the container. It is however possible to store them on the host computer. For this to be done, folder `/var/lib/duniter` must be shared with appropriate rights. For example, for the data to be recorded in the `~/duniter/data` directory, here are the commands to be executed:
If you prefer the database to be stored on the host directory `~/duniter/data`, you have to be carreful of the rights given to this directory. The commands to be executed are then:
chown -R 1111:1111 ~/duniter/data
docker run -d -p127.0.0.1:9220:9220 -p10901:10901 -p20901:20901 --mount src=~/duniter/data,dst=/var/lib/duniter --name duniter duniter/duniter-ts
docker run -d -p127.0.0.1:9220:9220 -p10901:10901 -p20901:20901 --mount type=bind,src=~/duniter/data,dst=/var/lib/duniter --name duniter duniter/duniter
> Note: some of the above commands need “root” access, usage of `sudo` may be required.
### Using a keyfile
If the file `/etc/duniter/keys.yml` is found on the container, it is used as keyfile for the node identity. For this file is visible by Duniter, it must be granted appropriate access rights. If the file `keys.yml` is for example on the host in the `~/duniter/conf` directory, here are the commands to execute for it is used:
chown -R 1111:1111 ~/duniter/conf
chmod -R 644 ~/duniter/conf
docker run -d -p127.0.0.1:9220:9220 -p10901:10901 -p20901:20901 --mount type=bind,src=~/duniter/conf,dst=/etc/duniter --name duniter duniter/duniter
> Note: some of the above commands need “root” access, usage of `sudo` may be required.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment