diff options
author | Mine Coins <mine.coins@yandex.com> | 2017-02-24 00:55:37 +0200 |
---|---|---|
committer | Mine Coins <mine.coins@yandex.com> | 2017-02-24 00:56:15 +0200 |
commit | a1cd4db4e695b257371efca13bd901e96b817173 (patch) | |
tree | 773de27c18639711d9390c21b7ec95ae5b71b0f0 | |
parent | Merge pull request #1775 (diff) | |
download | monero-a1cd4db4e695b257371efca13bd901e96b817173.tar.xz |
updated Dockerfile
- minified image: 75% smaller image
- statically-linked build
- add .dockerignore: no need to send repo to build context
-rw-r--r-- | .dockerignore | 1 | ||||
-rw-r--r-- | Dockerfile | 59 |
2 files changed, 28 insertions, 32 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..72e8ffc0d --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +* diff --git a/Dockerfile b/Dockerfile index 8a40e9533..38d7b96d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,40 +1,35 @@ -FROM debian:testing -MAINTAINER eiabea <developer@eiabea.com> - -# Install clone dependencies -RUN set -e && \ - apt-get update -q && \ - apt-get install -q -y --no-install-recommends ca-certificates git && \ - git clone https://github.com/monero-project/monero.git src && \ - apt-get purge -y git && \ - apt-get clean -q -y && \ - apt-get autoclean -q -y && \ - apt-get autoremove -q -y - -WORKDIR /src - -# Install make dependencies -RUN set -e && \ - apt-get update -q && \ - apt-get install -q -y --no-install-recommends build-essential ca-certificates g++ gcc cmake \ - pkg-config libunbound2 libevent-2.0-5 libgtest-dev libboost-all-dev libdb5.3++-dev libdb5.3-dev libssl1.0-dev && \ - make -j 4 && \ - apt-get purge -y g++ gcc cmake pkg-config && \ - apt-get clean -q -y && \ - apt-get autoclean -q -y && \ - apt-get autoremove -q -y && \ - mkdir /monero && \ - mv /src/build/release/bin/* /monero && \ - rm -rf /src - -WORKDIR /monero +FROM ubuntu:16.04 + +ENV SRC_DIR /usr/local/src/monero + +RUN set -x \ + && buildDeps=' \ + ca-certificates \ + cmake \ + g++ \ + git \ + libboost1.58-all-dev \ + libssl-dev \ + make \ + pkg-config \ + ' \ + && apt-get -qq update \ + && apt-get -qq --no-install-recommends install $buildDeps \ + \ + && git clone https://github.com/monero-project/monero.git $SRC_DIR \ + && cd $SRC_DIR \ + && make -j$(nproc) release-static \ + && cp build/release/bin/* /usr/local/bin/ \ + \ + && rm -r $SRC_DIR \ + && apt-get -qq --auto-remove purge $buildDeps # Contains the blockchain VOLUME /root/.bitmonero # Generate your wallet via accessing the container and run: # cd /wallet -# /./bitmonero/monero-wallet-cli +# monero-wallet-cli VOLUME /wallet ENV LOG_LEVEL 0 @@ -46,4 +41,4 @@ ENV RPC_BIND_PORT 18081 EXPOSE 18080 EXPOSE 18081 -CMD ./monerod --log-level=$LOG_LEVEL --p2p-bind-ip=$P2P_BIND_IP --p2p-bind-port=$P2P_BIND_PORT --rpc-bind-ip=$RPC_BIND_IP --rpc-bind-port=$RPC_BIND_PORT +CMD monerod --log-level=$LOG_LEVEL --p2p-bind-ip=$P2P_BIND_IP --p2p-bind-port=$P2P_BIND_PORT --rpc-bind-ip=$RPC_BIND_IP --rpc-bind-port=$RPC_BIND_PORT |