Browse Source

add build into make build-docker (#5253)

## Description

add make build-linux into `make build-docker` it is not documented that the cmd depends on the build folder so this aids in helping the user. 

Closes: #XXX
pull/5258/head
Marko 4 years ago
committed by GitHub
parent
commit
022b255ed6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 27 deletions
  1. +2
    -4
      DOCKER/README.md
  2. +3
    -3
      Makefile
  3. +31
    -19
      docs/networks/docker-compose.md
  4. +0
    -1
      networks/local/localnode/Dockerfile

+ 2
- 4
DOCKER/README.md View File

@ -30,7 +30,7 @@ To get started developing applications, see the [application developers guide](h
A quick example of a built-in app and Tendermint core in one container.
```
```sh
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint node --proxy_app=kvstore
```
@ -39,9 +39,7 @@ docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint node --proxy_app
To run a 4-node network, see the `Makefile` in the root of [the repo](https://github.com/tendermint/tendermint/blob/master/Makefile) and run:
```
make build-linux
make build-docker-localnode
```sh
make localnet-start
```


+ 3
- 3
Makefile View File

@ -188,7 +188,7 @@ sync-docs:
### Docker image ###
###############################################################################
build-docker:
build-docker: build-linux
cp $(OUTPUT) DOCKER/tendermint
docker build --label=tendermint --tag="tendermint/tendermint" DOCKER
rm -rf DOCKER/tendermint
@ -216,8 +216,8 @@ build_c-amazonlinux:
.PHONY: build_c-amazonlinux
# Run a 4-node testnet locally
localnet-start: localnet-stop build-docker-localnode
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --config /etc/tendermint/config-template.toml --v 4 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2; fi
localnet-start: localnet-stop build-linux
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --config /etc/tendermint/config-template.toml --o . --starting-ip-address 192.167.10.2; fi
docker-compose up
.PHONY: localnet-start


+ 31
- 19
docs/networks/docker-compose.md View File

@ -20,9 +20,7 @@ docker image.
Note the binary will be mounted into the container so it can be updated without
rebuilding the image.
```
cd $GOPATH/src/github.com/tendermint/tendermint
```sh
# Build the linux binary in ./build
make build-linux
@ -34,7 +32,7 @@ make build-docker-localnode
To start a 4 node testnet run:
```
```sh
make localnet-start
```
@ -48,9 +46,8 @@ on ports 26656-26657, 26659-26660, 26661-26662, and 26663-26664 respectively.
To update the binary, just rebuild it and restart the nodes:
```
```sh
make build-linux
make localnet-stop
make localnet-start
```
@ -62,31 +59,46 @@ calling the `tendermint testnet` command.
The `./build` directory is mounted to the `/tendermint` mount point to attach
the binary and config files to the container.
To change the number of validators / non-validators change the `localnet-start` Makefile target:
To change the number of validators / non-validators change the `localnet-start` Makefile target [here](../../makefile):
```
```sh
localnet-start: localnet-stop
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --v 5 --n 3 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2 ; fi
docker-compose up
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --v 5 --n 3 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2 ; fi
docker-compose up
```
The command now will generate config files for 5 validators and 3
non-validators network.
Before running it, don't forget to cleanup the old files:
non-validators. Along with generating new config files the docker-compose file needs to be edited.
Adding 4 more nodes is required in order to fully utilize the config files that were generated.
```yml
node3: # bump by 1 for every node
container_name: node3 # bump by 1 for every node
image: "tendermint/localnode"
environment:
- ID=3
- LOG=${LOG:-tendermint.log}
ports:
- "26663-26664:26656-26657" # Bump 26663-26664 by one for every node
volumes:
- ./build:/tendermint:Z
networks:
localnet:
ipv4_address: 192.167.10.5 # bump the final digit by 1 for every node
```
cd $GOPATH/src/github.com/tendermint/tendermint
Before running it, don't forget to cleanup the old files:
```sh
# Clear the build folder
rm -rf ./build/node*
```
## Configuring abci containers
## Configuring ABCI containers
To use your own abci applications with 4-node setup edit the [docker-compose.yaml](https://github.com/tendermint/tendermint/blob/master/docker-compose.yml) file and add image to your abci application.
To use your own ABCI applications with 4-node setup edit the [docker-compose.yaml](https://github.com/tendermint/tendermint/blob/master/docker-compose.yml) file and add image to your ABCI application.
```
```yml
abci0:
container_name: abci0
image: "abci-image"
@ -133,9 +145,9 @@ To use your own abci applications with 4-node setup edit the [docker-compose.yam
```
Override the [command](https://github.com/tendermint/tendermint/blob/master/networks/local/localnode/Dockerfile#L12) in each node to connect to it's abci.
Override the [command](https://github.com/tendermint/tendermint/blob/master/networks/local/localnode/Dockerfile#L12) in each node to connect to it's ABCI.
```
```yml
node0:
container_name: node0
image: "tendermint/localnode"


+ 0
- 1
networks/local/localnode/Dockerfile View File

@ -1,5 +1,4 @@
FROM alpine:3.7
MAINTAINER Greg Szabo <greg@tendermint.com>
RUN apk update && \
apk upgrade && \


Loading…
Cancel
Save