diff options
author | Bruno Clermont <bruno@robotinfra.com> | 2017-11-17 12:14:19 +0800 |
---|---|---|
committer | Bruno Clermont <bruno@robotinfra.com> | 2017-11-17 21:51:22 +0800 |
commit | e03be11a0ee5e9944e99d72c2d3d7e8f8bc7781c (patch) | |
tree | 02cf626b92b9cd4f0efe2fcfe9817a1a11adc432 /Dockerfile | |
parent | Merge pull request #2818 (diff) | |
download | monero-e03be11a0ee5e9944e99d72c2d3d7e8f8bc7781c.tar.xz |
fix and improve docker image, add doc for docker-compose
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/Dockerfile b/Dockerfile index 37f212b73..5f0097be0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,40 @@ +# Multistage docker build, requires docker 17.05 + +# builder stage +FROM ubuntu:16.04 as builder + +RUN apt-get update && \ + apt-get --no-install-recommends --yes install \ + ca-certificates \ + cmake \ + g++ \ + libboost1.58-all-dev \ + libssl-dev \ + libzmq-dev \ + make \ + pkg-config \ + graphviz \ + doxygen \ + git + +WORKDIR /src +COPY . . +RUN rm -rf build && \ + qmake -j$(nproc) release-static + +# runtime stage 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 \ - libzmq3-dev \ - libsodium-dev \ - make \ - pkg-config \ - ' \ - && apt-get -qq update \ - && apt-get -qq --no-install-recommends install $buildDeps - -RUN git clone https://github.com/monero-project/monero.git $SRC_DIR -WORKDIR $SRC_DIR -RUN make -j$(nproc) release-static - -RUN cp build/release/bin/* /usr/local/bin/ \ - \ - && rm -r $SRC_DIR \ - && apt-get -qq --auto-remove purge $buildDeps +RUN apt-get update && \ + apt-get --no-install-recommends --yes install \ + ca-certificates \ + libboost1.58-all \ + libssl1.0.0 \ + libzmq1 && \ + apt-get clean && \ + rm -rf /var/lib/apt + +COPY --from=builder /src/build/release/bin/* /usr/local/bin/ # Contains the blockchain VOLUME /root/.bitmonero @@ -35,13 +44,7 @@ VOLUME /root/.bitmonero # monero-wallet-cli VOLUME /wallet -ENV LOG_LEVEL 0 -ENV P2P_BIND_IP 0.0.0.0 -ENV P2P_BIND_PORT 18080 -ENV RPC_BIND_IP 127.0.0.1 -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 +ENTRYPOINT ["monerod", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=18080", "--rpc-bind-ip=127.0.0.1", "--rpc-bind-port=18081"] |