mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-21 18:41:18 +00:00
Merge pull request #64 from tendermint/883-improve-docker-docs
Improve docker docs
This commit is contained in:
commit
5efc536ba3
@ -1,120 +1,71 @@
|
|||||||
Using Docker
|
Using Docker
|
||||||
============
|
============
|
||||||
|
|
||||||
`This folder <https://github.com/tendermint/tools/tree/master/docker>`__ contains Docker container descriptions. Using this folder
|
It is assumed that you have already `setup docker <https://docs.docker.com/engine/installation/>`__.
|
||||||
you can build your own Docker images with the tendermint application.
|
|
||||||
|
|
||||||
It is assumed that you have already setup docker.
|
|
||||||
|
|
||||||
If you don't want to build the images yourself, you should be able to
|
|
||||||
download them from Docker Hub.
|
|
||||||
|
|
||||||
Tendermint
|
Tendermint
|
||||||
----------
|
----------
|
||||||
|
|
||||||
Build the container: Copy the ``tendermint`` binary to the
|
The application configuration and data will be stored at ``/tendermint`` in the
|
||||||
``tendermint`` folder.
|
container. This directory will also be exposed as a volume. The ports 46656 and
|
||||||
|
46657 will be open for ABCI applications to connect.
|
||||||
|
|
||||||
|
Initialize tendermint:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
docker build -t tendermint tendermint
|
mkdir /tmdata
|
||||||
|
docker run --rm -v /tmdata:/tendermint tendermint/tendermint init
|
||||||
|
|
||||||
The application configuration will be stored at ``/tendermint`` in the
|
Change ``/tmdata`` folder to any destination where you want to store Tendermint
|
||||||
container. The ports 46656 and 46657 will be open for ABCI applications
|
configuration and data.
|
||||||
to connect.
|
|
||||||
|
|
||||||
Initialize tendermint configuration and keep it after the container is
|
Tendermint docker image is stored on `docker hub <https://hub.docker.com/r/tendermint/tendermint/>`__.
|
||||||
finished in a docker volume called ``data``:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
docker run --rm -v data:/tendermint tendermint init
|
|
||||||
|
|
||||||
If you want the docker volume to be a physical directory on your
|
|
||||||
filesystem, you have to give an absolute path to docker and make sure
|
|
||||||
the permissions allow the application to write it.
|
|
||||||
|
|
||||||
Get the public key of tendermint:
|
Get the public key of tendermint:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
docker run --rm -v data:/tendermint tendermint show_validator
|
docker run --rm -v /tmdata:/tendermint tendermint/tendermint show_validator
|
||||||
|
|
||||||
Run the docker tendermint application with:
|
Run the docker tendermint application with:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
docker run --rm -d -v data:/tendermint tendermint node
|
docker run --rm -d -v /tmdata:/tendermint tendermint/tendermint node
|
||||||
|
|
||||||
Basecoin
|
Building images by yourself:
|
||||||
--------
|
|
||||||
|
|
||||||
Build the container: Copy the ``basecoin`` binary to the ``basecoin``
|
`This folder <https://github.com/tendermint/tendermint/tree/master/DOCKER>`__
|
||||||
folder.
|
contains Docker container descriptions. Using this folder you can build your
|
||||||
|
own Docker images with the tendermint application.
|
||||||
::
|
|
||||||
|
|
||||||
docker build -t basecoin basecoin
|
|
||||||
|
|
||||||
The application configuration will be stored at ``/basecoin``.
|
|
||||||
|
|
||||||
Initialize basecoin configuration and keep it after the container is
|
|
||||||
finished:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
docker run --rm -v basecoindata:/basecoin basecoin init deadbeef
|
|
||||||
|
|
||||||
Use your own basecoin account instead of ``deadbeef`` in the ``init``
|
|
||||||
command.
|
|
||||||
|
|
||||||
Get the public key of basecoin: We use a trick here: since the basecoin
|
|
||||||
and the tendermint configuration folders are similar, the ``tendermint``
|
|
||||||
command can extract the public key for us if we feed the basecoin
|
|
||||||
configuration folder to tendermint.
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
docker run --rm -v basecoindata:/tendermint tendermint show_validator
|
|
||||||
|
|
||||||
Run the docker tendermint application with: This is a two-step process:
|
|
||||||
\* Run the basecoin container. \* Run the tendermint container and
|
|
||||||
expose the ports that allow clients to connect. The --proxy\_app should
|
|
||||||
contain the basecoin application's IP address and port.
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
docker run --rm -d -v basecoindata:/basecoin basecoin start --without-tendermint
|
|
||||||
docker run --rm -d -v data:/tendermint -p 46656-46657:46656-46657 tendermint node --proxy_app tcp://172.17.0.2:46658
|
|
||||||
|
|
||||||
Ethermint
|
Ethermint
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Build the container: Copy the ``ethermint`` binary and the setup folder
|
The application configuration will be stored at ``/ethermint``.
|
||||||
to the ``ethermint`` folder.
|
|
||||||
|
Initialize ethermint:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
docker build -t ethermint ethermint
|
mkdir /ethermintdata
|
||||||
|
wget -O /ethermintdata/genesis.json https://github.com/tendermint/ethermint/raw/master/setup/genesis.json
|
||||||
|
docker run --rm -v /ethermintdata:/ethermint tendermint/ethermint ethermint --datadir /ethermint init /ethermint/genesis.json
|
||||||
|
|
||||||
The application configuration will be stored at ``/ethermint``. The
|
Start ethermint as a validator node: This is a two-step process: \* Run the
|
||||||
files required for initializing ethermint (the files in the source
|
tendermint container and expose the ports that allow clients to connect. \* Run
|
||||||
``setup`` folder) are under ``/setup``.
|
the ethermint container. You will have to define where tendermint runs as the
|
||||||
|
ethermint binary connects to it explicitly. The --proxy\_app should contain the
|
||||||
Initialize ethermint configuration:
|
ethermint application's IP address and port.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
docker run --rm -v ethermintdata:/ethermint ethermint init /setup/genesis.json
|
docker run --rm -d -v /tmdata:/tendermint tendermint/tendermint node --proxy_app=tcp://172.17.0.3:46658
|
||||||
|
docker run --rm -d -v /ethermintdata:/ethermint tendermint/ethermint ethermint --tendermint_addr tcp://172.17.0.2:46657
|
||||||
|
|
||||||
Start ethermint as a validator node: This is a two-step process: \* Run
|
Building images by yourself:
|
||||||
the ethermint container. You will have to define where tendermint runs
|
|
||||||
as the ethermint binary connects to it explicitly. \* Run the tendermint
|
|
||||||
container and expose the ports that allow clients to connect. The
|
|
||||||
--proxy\_app should contain the ethermint application's IP address and
|
|
||||||
port.
|
|
||||||
|
|
||||||
::
|
`This folder <https://github.com/tendermint/ethermint/blob/master/scripts/docker>`__
|
||||||
|
contains Docker container descriptions. Using this folder you can build your
|
||||||
docker run --rm -d -v ethermintdata:/ethermint ethermint --tendermint_addr tcp://172.17.0.3:46657
|
own Docker images with the ethermint application.
|
||||||
docker run --rm -d -v data:/tendermint -p 46656-46657:46656-46657 tendermint node --proxy_app tcp://172.17.0.2:46658
|
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
FROM busybox
|
|
||||||
#Use --build-arg to change where the basecoin binary resides
|
|
||||||
ARG BASECOIN_BINARY=basecoin
|
|
||||||
ENV BCHOME /basecoin
|
|
||||||
COPY $BASECOIN_BINARY /usr/bin/basecoin
|
|
||||||
RUN adduser -h $BCHOME -D basecoin
|
|
||||||
VOLUME [ $BCHOME ]
|
|
||||||
EXPOSE 46658
|
|
||||||
USER basecoin
|
|
||||||
ENTRYPOINT ["/usr/bin/basecoin"]
|
|
||||||
CMD ["start","--without-tendermint"]
|
|
||||||
WORKDIR $BCHOME
|
|
||||||
STOPSIGNAL SIGTERM
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user