Files
tendermint/DOCKER/Dockerfile
Ismail Khoffi ebd2cbec97 Rework Docker image (#5087)
* fix #5086

* fixes #5082

- run tendermint init on runtime (if necessary)

* Address some feedback:

 - restrict the entrypoint to only run `tendermint`
 - script into /usr/local/bin

* make it also possible to run ``ith unmodified config again via:

`docker run -v $HOME/.tendermint:/tendermint tendermint/tendermint init

* Update DOCKER/docker-entrypoint.sh

Co-authored-by: Greg Szabo <16846635+greg-szabo@users.noreply.github.com>

Co-authored-by: Greg Szabo <16846635+greg-szabo@users.noreply.github.com>
2020-07-07 19:17:57 +02:00

48 lines
1.4 KiB
Docker

FROM alpine:3.9
LABEL maintainer="hello@tendermint.com"
# Tendermint will be looking for the genesis file in /tendermint/config/genesis.json
# (unless you change `genesis_file` in config.toml). You can put your config.toml and
# private validator file into /tendermint/config.
#
# The /tendermint/data dir is used by tendermint to store state.
ENV TMHOME /tendermint
# OS environment setup
# Set user right away for determinism, create directory for persistence and give our user ownership
# jq and curl used for extracting `pub_key` from private validator while
# deploying tendermint with Kubernetes. It is nice to have bash so the users
# could execute bash commands.
RUN apk update && \
apk upgrade && \
apk --no-cache add curl jq bash && \
addgroup tmuser && \
adduser -S -G tmuser tmuser -h "$TMHOME"
# Run the container with tmuser by default. (UID=100, GID=1000)
USER tmuser
WORKDIR $TMHOME
# p2p, rpc and prometheus port
EXPOSE 26656 26657 26660
STOPSIGNAL SIGTERM
ARG BINARY=tendermint
COPY $BINARY /usr/bin/tendermint
# You can overwrite these before the first run to influence
# config.json and genesis.json. Additionally, you can override
# CMD to add parameters to `tendermint node`.
ENV PROXY_APP=kvstore MONIKER=dockernode CHAIN_ID=dockerchain
COPY ./docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["node"]
# Expose the data directory as a volume since there's mutable state in there
VOLUME [ "$TMHOME" ]