Skip to content

Commit

Permalink
Fix Linuxarm32v7 docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Jan 11, 2019
1 parent 3c8629b commit 4a0aec3
Showing 1 changed file with 13 additions and 31 deletions.
44 changes: 13 additions & 31 deletions contrib/linuxarm32v7.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This dockerfile is meant to cross compile with a x64 machine for a arm32v7 host
# It is using multi stage build:
# * downloader: Download litecoin/bitcoin and qemu binaries needed for c-lightning
# It is using multi stage build:
# * downloader: Download Groestlcoin and qemu binaries needed for c-lightning
# * builder: Cross compile c-lightning dependencies, then c-lightning itself with static linking
# * final: Copy the binaries required at runtime
# The resulting image uploaded to dockerhub will only contain what is needed for runtime.
Expand All @@ -14,32 +14,15 @@ RUN set -ex \

WORKDIR /opt

ARG BITCOIN_VERSION=0.17.0
ENV BITCOIN_TARBALL bitcoin-$BITCOIN_VERSION-arm-linux-gnueabihf.tar.gz
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/$BITCOIN_TARBALL
ENV BITCOIN_ASC_URL https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/SHA256SUMS.asc

RUN mkdir /opt/bitcoin && cd /opt/bitcoin \
&& wget -qO $BITCOIN_TARBALL "$BITCOIN_URL" \
&& wget -qO bitcoin.asc "$BITCOIN_ASC_URL" \
&& grep $BITCOIN_TARBALL bitcoin.asc | tee SHA256SUMS.asc \
&& sha256sum -c SHA256SUMS.asc \
&& BD=bitcoin-$BITCOIN_VERSION/bin \
&& tar -xzvf $BITCOIN_TARBALL $BD/bitcoin-cli --strip-components=1 \
&& rm $BITCOIN_TARBALL

ENV LITECOIN_VERSION 0.14.2
ENV LITECOIN_TARBALL litecoin-$LITECOIN_VERSION-arm-linux-gnueabihf.tar.gz
ENV LITECOIN_URL https://download.litecoin.org/litecoin-$LITECOIN_VERSION/linux/$LITECOIN_TARBALL
ENV LITECOIN_SHA256 e79f2a8e8e1b9920d07cff8482237b56aa4be2623103d3d2825ce09a2cc2f6d7

# install litecoin binaries
RUN mkdir /opt/litecoin && cd /opt/litecoin \
&& wget -qO litecoin.tar.gz "$LITECOIN_URL" \
&& echo "$LITECOIN_SHA256 litecoin.tar.gz" | sha256sum -c - \
&& BD=litecoin-$LITECOIN_VERSION/bin \
&& tar -xzvf litecoin.tar.gz $BD/litecoin-cli --strip-components=1 --exclude=*-qt \
&& rm litecoin.tar.gz
ENV GROESTLCOIN_VERSION 2.16.3
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v2.16.3/groestlcoin-2.16.3-x86_64-linux-gnu.tar.gz
ENV GROESTLCOIN_SHA256 f15bd5e38b25a103821f1563cd0e1b2cf7146ec9f9835493a30bd57313d3b86f

RUN mkdir /opt/groestlcoin && cd /opt/groestlcoin \
&& wget -qO groestlcoin.tar.gz "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 groestlcoin.tar.gz" | sha256sum -c - \
&& tar -xzvf groestlcoin.tar.gz groestlcoin-cli --exclude=*-qt \
&& rm groestlcoin.tar.gz

FROM debian:stretch-slim as builder

Expand Down Expand Up @@ -89,7 +72,7 @@ RUN ./configure --enable-static && make -j3 DEVELOPER=${DEVELOPER} && cp lightni
FROM arm32v7/debian:stretch-slim as final
COPY --from=downloader /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
RUN apt-get update && apt-get install -y --no-install-recommends socat inotify-tools \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*

ENV LIGHTNINGD_DATA=/root/.lightning
ENV LIGHTNINGD_PORT=9835
Expand All @@ -100,8 +83,7 @@ VOLUME [ "/root/.lightning" ]

COPY --from=builder /opt/lightningd/cli/lightning-cli /usr/bin
COPY --from=builder /opt/lightningd/lightningd/lightning* /usr/bin/
COPY --from=downloader /opt/bitcoin/bin /usr/bin
COPY --from=downloader /opt/litecoin/bin /usr/bin
COPY --from=downloader /opt/groestlcoin /usr/bin
COPY tools/docker-entrypoint.sh entrypoint.sh

EXPOSE 9735 9835
Expand Down

0 comments on commit 4a0aec3

Please sign in to comment.