mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
[docker] move to alpine base image
813Mb => 29.5Mb
This commit is contained in:
parent
1bf5ae9c8d
commit
bf64dd21fd
@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.7.4
|
FROM alpine:3.5
|
||||||
|
|
||||||
# This is the release of tendermint to pull in.
|
# This is the release of tendermint to pull in.
|
||||||
ENV TM_VERSION 0.8.0
|
ENV TM_VERSION 0.8.0
|
||||||
@ -12,30 +12,31 @@ ENV DATA_ROOT /tendermint
|
|||||||
ENV TMROOT $DATA_ROOT
|
ENV TMROOT $DATA_ROOT
|
||||||
|
|
||||||
# Set user right away for determinism
|
# Set user right away for determinism
|
||||||
RUN groupadd -r tmuser && \
|
RUN addgroup tmuser && \
|
||||||
useradd -r -s /bin/false -g tmuser tmuser
|
adduser -S -G tmuser tmuser
|
||||||
|
|
||||||
# Create directory for persistence and give our user ownership
|
# Create directory for persistence and give our user ownership
|
||||||
RUN mkdir -p $DATA_ROOT && \
|
RUN mkdir -p $DATA_ROOT && \
|
||||||
chown -R tmuser:tmuser $DATA_ROOT
|
chown -R tmuser:tmuser $DATA_ROOT
|
||||||
|
|
||||||
# TODO replace with downloading a binary (this will allow us to replace golang
|
# jq and curl used for extracting `pub_key` from private validator while
|
||||||
# base container with alpine|jessie - 600MB vs 50MB)
|
# deploying tendermint with Kubernetes. It is nice to have bash so the users
|
||||||
RUN apt-get update && \
|
# could execute bash commands.
|
||||||
apt-get install -y --no-install-recommends \
|
RUN apk add --no-cache bash curl jq
|
||||||
git && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
RUN apk add --no-cache openssl && \
|
||||||
RUN mkdir -p $GOPATH/src/github.com/tendermint/tendermint && \
|
wget https://s3-us-west-2.amazonaws.com/tendermint/${TM_VERSION}/tendermint_linux_amd64.zip && \
|
||||||
cd $GOPATH/src/github.com/tendermint/tendermint && \
|
echo "83f6bd52055ebc93434a68263c6666a4de41e0e543d0b5a06ad461262c460f4c tendermint_linux_amd64.zip" | sha256sum -c && \
|
||||||
git clone https://github.com/tendermint/tendermint.git . && \
|
unzip -d /bin tendermint_linux_amd64.zip && \
|
||||||
git fetch && \
|
apk del openssl && \
|
||||||
git reset --hard v$TM_VERSION && \
|
rm -f tendermint_linux_amd64.zip
|
||||||
make install
|
|
||||||
|
|
||||||
# Expose the data directory as a volume since there's mutable state in there
|
# Expose the data directory as a volume since there's mutable state in there
|
||||||
VOLUME $DATA_ROOT
|
VOLUME $DATA_ROOT
|
||||||
|
|
||||||
|
# p2p port
|
||||||
EXPOSE 46656
|
EXPOSE 46656
|
||||||
|
# rpc port
|
||||||
EXPOSE 46657
|
EXPOSE 46657
|
||||||
|
|
||||||
ENTRYPOINT ["tendermint"]
|
ENTRYPOINT ["tendermint"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user