Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installing plugins in dockerfile #2451

Merged
merged 3 commits into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Improved plugin install in docker
- All files generated by 'make install' are copied
- Fixes issues with incomplete installation.
- Example: New executables created by build but are missing in docker.
  • Loading branch information
wailo committed Mar 5, 2019
commit 48d6d64f56d9e8ab593af1b14efd12b7b5450fc5
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG PREFIX=/tmp/lightning_install

FROM alpine:3.7 as builder

RUN apk add --no-cache \
Expand All @@ -20,7 +22,7 @@ RUN apk add --no-cache \
zlib-dev

WORKDIR /opt

ARG PREFIX
ARG BITCOIN_VERSION=0.17.0
ENV BITCOIN_TARBALL bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/$BITCOIN_TARBALL
Expand Down Expand Up @@ -61,7 +63,7 @@ RUN git clone --recursive /tmp/lightning . && \
git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD)

ARG DEVELOPER=0
RUN ./configure && make -j3 DEVELOPER=${DEVELOPER} && cp lightningd/lightning* cli/lightning-cli /usr/bin/
RUN ./configure --prefix=$PREFIX && make -j3 DEVELOPER=${DEVELOPER} && make install

FROM alpine:3.7

Expand Down Expand Up @@ -93,10 +95,8 @@ ENV LIGHTNINGD_DATA=/root/.lightning
ENV LIGHTNINGD_RPC_PORT=9835

VOLUME [ "/root/.lightning" ]

COPY --from=builder /opt/lightningd/cli/lightning-cli /usr/bin
COPY --from=builder /opt/lightningd/lightningd/lightning* /usr/bin/
COPY --from=builder /opt/lightningd/plugins/pay /usr/libexec/c-lightning/plugins/
ARG PREFIX
COPY --from=builder $PREFIX/ /usr/local/
COPY --from=builder /opt/bitcoin/bin /usr/bin
COPY --from=builder /opt/litecoin/bin /usr/bin
COPY tools/docker-entrypoint.sh entrypoint.sh
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ services:
- --bitcoin-rpcconnect=bitcoind
- --bitcoin-rpcuser=rpcuser
- --bitcoin-rpcpassword=rpcpass
- --plugin-dir=/usr/libexec/c-lightning/plugins
- --network=testnet
- --alias=myawesomenode
- --log-level=debug
Expand Down
11 changes: 6 additions & 5 deletions contrib/linuxarm32v7.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# * final: Copy the binaries required at runtime
# The resulting image uploaded to dockerhub will only contain what is needed for runtime.
# From the root of the repository, run "docker build -t yourimage:yourtag -f contrib/linuxarm32v7.Dockerfile ."
ARG PREFIX=/tmp/lightning_install

FROM debian:stretch-slim as downloader

RUN set -ex \
Expand All @@ -15,6 +17,7 @@ RUN set -ex \
WORKDIR /opt

ARG BITCOIN_VERSION=0.17.0
ARG PREFIX
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
Expand Down Expand Up @@ -87,7 +90,7 @@ RUN git clone --recursive /tmp/lightning . && \
git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD)

ARG DEVELOPER=0
RUN ./configure --enable-static && make -j3 DEVELOPER=${DEVELOPER} && cp lightningd/lightning* cli/lightning-cli /usr/bin/
RUN ./configure --prefix=$PREFIX --enable-static && make -j3 DEVELOPER=${DEVELOPER} && make install

FROM arm32v7/debian:stretch-slim as final
COPY --from=downloader /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
Expand All @@ -100,10 +103,8 @@ ENV LIGHTNINGD_PORT=9835
RUN mkdir $LIGHTNINGD_DATA && \
touch $LIGHTNINGD_DATA/config
VOLUME [ "/root/.lightning" ]

COPY --from=builder /opt/lightningd/cli/lightning-cli /usr/bin
COPY --from=builder /opt/lightningd/lightningd/lightning* /usr/bin/
COPY --from=builder /opt/lightningd/plugins/pay /usr/libexec/c-lightning/plugins/
ARG PREFIX
COPY --from=builder $PREFIX/ /usr/local/
COPY --from=downloader /opt/bitcoin/bin /usr/bin
COPY --from=downloader /opt/litecoin/bin /usr/bin
COPY tools/docker-entrypoint.sh entrypoint.sh
Expand Down