You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.8 KiB

9 years ago
  1. FROM alpine:3.9
  2. LABEL maintainer="hello@tendermint.com"
  3. # Tendermint will be looking for the genesis file in /tendermint/config/genesis.json
  4. # (unless you change `genesis_file` in config.toml). You can put your config.toml and
  5. # private validator file into /tendermint/config.
  6. #
  7. # The /tendermint/data dir is used by tendermint to store state.
  8. ENV TMHOME /tendermint
  9. # OS environment setup
  10. # Set user right away for determinism, create directory for persistence and give our user ownership
  11. # jq and curl used for extracting `pub_key` from private validator while
  12. # deploying tendermint with Kubernetes. It is nice to have bash so the users
  13. # could execute bash commands.
  14. RUN apk update && \
  15. apk upgrade && \
  16. apk --no-cache add curl jq bash && \
  17. addgroup tmuser && \
  18. adduser -S -G tmuser tmuser -h "$TMHOME"
  19. # Run the container with tmuser by default. (UID=100, GID=1000)
  20. USER tmuser
  21. WORKDIR $TMHOME
  22. # p2p, rpc and prometheus port
  23. EXPOSE 26656 26657 26660
  24. ENTRYPOINT ["/usr/bin/tendermint"]
  25. CMD ["node"]
  26. STOPSIGNAL SIGTERM
  27. ARG BINARY=tendermint
  28. COPY $BINARY /usr/bin/tendermint
  29. # Create default configuration for docker run.
  30. RUN /usr/bin/tendermint init && \
  31. sed -i \
  32. -e 's/^proxy_app\s*=.*/proxy_app = "kvstore"/' \
  33. -e 's/^moniker\s*=.*/moniker = "dockernode"/' \
  34. -e 's/^addr_book_strict\s*=.*/addr_book_strict = false/' \
  35. -e 's/^timeout_commit\s*=.*/timeout_commit = "500ms"/' \
  36. -e 's/^index_all_tags\s*=.*/index_all_tags = true/' \
  37. -e 's,^laddr = "tcp://127.0.0.1:26657",laddr = "tcp://0.0.0.0:26657",' \
  38. -e 's/^prometheus\s*=.*/prometheus = true/' \
  39. $TMHOME/config/config.toml && \
  40. sed -i \
  41. -e 's/^\s*"chain_id":.*/ "chain_id": "dockerchain",/' \
  42. $TMHOME/config/genesis.json
  43. # Expose the data directory as a volume since there's mutable state in there
  44. VOLUME [ $TMHOME ]