From 3f8bc46bc32ef3b6848e7adafb9bd641f3f451cb Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Tue, 9 Jun 2020 11:52:53 +0200 Subject: [PATCH] docs - Adds volumes to docker --- README.md | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 72187d6..ee00522 100644 --- a/README.md +++ b/README.md @@ -109,22 +109,48 @@ Notice that ENV variables are optional, if unset the corresponding default setti - BTC_FEED_PORT= ``` +You may also want to run docker with a volume, so you can have data persistence in `teos` databases and keys. +If so, run: + + docker volume create teos-data + +And add the the mount parameter to `docker run`: + + --mount source=teos-data,target=/root/.teos + If you are running `teos` and `bitcoind` in the same machine, continue reading for how to create the container based on your OS. ### `bitcoind` running on the same machine (UNIX) -The easiest way to run both together int he same machine is to set the container to use the host network. +The easiest way to run both together in he same machine using UNIX is to set the container to use the host network. -For example, if both `teos` and `bitcoind` are running on default settings, run: - `docker run --network=host -it -e BTC_RPC_USER= -e BTC_RPC_PASSWD= teos` +For example, if both `teos` and `bitcoind` are running on default settings, run + +``` +docker run --network=host \ + --name teos \ + --mount source=teos-data,target=/root/.teos \ + -e BTC_RPC_USER= \ + -e BTC_RPC_PASSWD= \ + -it teos +``` Notice that you may still need to set your RPC authentication details, since, hopefully, your credentials won't match the `teos` defaults. ### `bitcoind` running on the same machine (OSX or Windows) -Docker for OSX and Windows do not allow to use the host network (nor to use the `docker0` bridge interface). To workaround this +Docker for OSX and Windows does not allow to use the host network (nor to use the `docker0` bridge interface). To workaround this you can use the special `host.docker.internal` domain. - docker run -p 9814 -it -e BTC_RPC_CONNECT=host.docker.internal -e BTC_FEED_CONNECT=host.docker.internal -e BTC_RPC_USER= -e BTC_RPC_PASSWD= teos +``` +docker run -p 9814:9814 \ + --name teos \ + --mount source=teos-data,target=/root/.teos \ + -e BTC_RPC_CONNECT=host.docker.internal \ + -e BTC_FEED_CONNECT=host.docker.internal \ + -e BTC_RPC_USER= \ + -e BTC_RPC_PASSWD= \ + -it teos +``` ## Interacting with a TEOS Instance