From 7c6f0b58a1db0130275ccb9a286f05dd469ce66b Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Sat, 27 Apr 2019 16:44:12 -0400 Subject: [PATCH] Adds VERSION ARG to the lbrynet compiler and adds more README. --- lbrynet/Dockerfile-linux-multiarch-compiler | 6 +++-- lbrynet/README.md | 28 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lbrynet/Dockerfile-linux-multiarch-compiler b/lbrynet/Dockerfile-linux-multiarch-compiler index c62fc97..d4baeaa 100644 --- a/lbrynet/Dockerfile-linux-multiarch-compiler +++ b/lbrynet/Dockerfile-linux-multiarch-compiler @@ -39,9 +39,11 @@ RUN apt-get update && \ FROM dependencies as compile +ARG VERSION=master RUN python3.7 -m pip install -U pyinstaller && \ - git clone https://github.com/lbryio/lbry.git --depth 1 /lbry - WORKDIR /lbry + git clone https://github.com/lbryio/lbry.git /lbry && \ + git -C /lbry checkout ${VERSION} +WORKDIR /lbry RUN git clone https://github.com/lbryio/torba.git --depth 1 /lbry/torba WORKDIR /lbry/torba RUN python3.7 -m pip install -e . diff --git a/lbrynet/README.md b/lbrynet/README.md index 3e4d48a..6d440cd 100644 --- a/lbrynet/README.md +++ b/lbrynet/README.md @@ -28,3 +28,31 @@ docker build -t lbrynet-armhf -f Dockerfile-linux-multiarch-compiler --build-arg ``` docker build -t lbrynet-arm64 -f Dockerfile-linux-multiarch-compiler --build-arg BASE_IMAGE=multiarch/ubuntu-core:arm64-bionic . ``` + +### Extra build arguments + +#### VERSION + +Compile any version of lbrynet by specifying the git tag: + +``` +docker build -t lbrynet:v0.36.0 --build-arg VERSION=v0.36.0 -f Dockerfile-linux-multiarch-compiler . +``` + +### Running from the compiler container directly + +The container requires a home directory to be mounted at `/home/lbrynet`. This +is to ensure that the wallet is backed up to a real storage device. You must run +the container with the appropriate volume argument, or else lbrynet will refuse +to run. + +If you compiled lbrynet as above, with the tag `lbrynet-x86`, you could run +docker like so: + +``` +docker run --rm -it -v wallet:/home/lbrynet lbrynet-x86 lbrynet start +``` + +This automatically creates a docker volume called `wallet` and it will persist +across container restarts. See more in the [Docker volume +documentation](https://docs.docker.com/storage/volumes/)