diff --git a/lbrynet/linux-armhf-compiler/Dockerfile b/lbrynet/linux-armhf-compiler/Dockerfile new file mode 100644 index 0000000..b3f19a9 --- /dev/null +++ b/lbrynet/linux-armhf-compiler/Dockerfile @@ -0,0 +1,55 @@ +FROM multiarch/ubuntu-core:armhf-bionic + +RUN apt update && \ + apt install -y \ + python3-pip \ + python3.7 \ + python3.7-dev \ + build-essential \ + libssl-dev \ + libacl1-dev \ + liblz4-dev \ + libfuse-dev \ + fuse \ + pkg-config \ + fakeroot \ + git \ + zlib1g-dev \ + libbz2-dev \ + libncurses5-dev \ + libreadline-dev \ + liblzma-dev \ + libsqlite3-dev \ + zip \ + libffi-dev + +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1 && \ + update-alternatives --install /usr/bin/python python /usr/bin/python3.7 10 && \ + update-alternatives --config python && \ + python --version && \ + pip3 --version + + +RUN python3.7 -m pip install -U pyinstaller cryptography aiohttp coincurve pbkdf2 cryptography attrs pylru + +## SPLIT CONTAINER HERE. +RUN git clone https://github.com/lbryio/lbry.git --depth 1 /lbry && \ + cd /lbry && \ + git clone https://github.com/lbryio/torba.git --depth 1 /lbry/torba + +RUN sed -i -e "s/'plyvel',//" /lbry/torba/setup.py && \ + cd /lbry/torba && python3.7 -m pip install -e . && cd /lbry/ && \ + python3.7 scripts/set_build.py && \ + python3.7 -m pip install -e . && \ + pyinstaller -F -n lbrynet lbrynet/extras/cli.py + +RUN echo "checking contents of /lbry/dist/" && ls -lAh /lbry/dist/ && \ + echo "checking contents of /" && ls -lAh / && \ + echo "redundantly setting executable bit for good measure" && chmod +x /lbry/dist/lbrynet && \ + echo "compressing lbrynet armhf binary" && zip -j /lbry/dist/lbrynet-armhf.zip /lbry/dist/lbrynet && \ + echo "creating /target/" && mkdir /target +COPY ./start.sh /usr/local/bin/start + +RUN /lbry/dist/lbrynet --version + +CMD start diff --git a/lbrynet/linux-armhf-compiler/README.md b/lbrynet/linux-armhf-compiler/README.md new file mode 100644 index 0000000..2689438 --- /dev/null +++ b/lbrynet/linux-armhf-compiler/README.md @@ -0,0 +1,28 @@ +# armhf-compiler + +This container's goal is to make CI/CD easier for everyone, Travis CI, GitlabCI, Jenkins... Your desktop's docker equipped development environment. + +## Example Usage + +#### binfmt_misc register +This step sets up your docker daemon to support more container architectures. + +Register `quemu-*-static` for all supported processors except the current one. +* `docker run --rm --privileged multiarch/qemu-user-static:register` + +#### build the armhf bin + +* `docker build --tag lbryio/lbrynet:armhf-compiler .` + +#### export compiled bin to local /target +This containers sole purpose is to build and spit out the bin. + +* `docker run --rm -ti -v $(pwd)/target:/target lbryio/lbrynet:armhf-compiler` + + +## Cleanup +If you're doing this on a machine you care to have restored to defaults this is the only host change we imposed so to revert the change you must execute the following docker command. + +Same as above, but remove all registered `binfmt_misc` before +* `docker run --rm --privileged multiarch/qemu-user-static:register --reset` + diff --git a/lbrynet/linux-armhf-compiler/start.sh b/lbrynet/linux-armhf-compiler/start.sh new file mode 100755 index 0000000..13da549 --- /dev/null +++ b/lbrynet/linux-armhf-compiler/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sleep 2 +cp /lbry/dist/lbrynet-armhf.zip /target/ diff --git a/lbrynet/linux-x86_64-compiler/Dockerfile b/lbrynet/linux-x86_64-compiler/Dockerfile new file mode 100644 index 0000000..6a8d6fd --- /dev/null +++ b/lbrynet/linux-x86_64-compiler/Dockerfile @@ -0,0 +1,54 @@ +FROM ubuntu:18.04 + +RUN apt update && \ + apt install -y \ + python3-pip \ + python3.7 \ + python3.7-dev \ + build-essential \ + libssl-dev \ + libacl1-dev \ + liblz4-dev \ + libfuse-dev \ + fuse \ + pkg-config \ + fakeroot \ + git \ + zlib1g-dev \ + libbz2-dev \ + libncurses5-dev \ + libreadline-dev \ + liblzma-dev \ + libsqlite3-dev \ + zip \ + libffi-dev + +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1 && \ + update-alternatives --install /usr/bin/python python /usr/bin/python3.7 10 && \ + update-alternatives --config python && \ + python --version && \ + pip3 --version + + +RUN python3.7 -m pip install -U pyinstaller cryptography aiohttp coincurve pbkdf2 cryptography attrs pylru + +## Split container here. +RUN git clone https://github.com/lbryio/lbry.git --depth 1 /lbry && \ + cd /lbry && \ + git clone https://github.com/lbryio/torba.git --depth 1 /lbry/torba + +RUN cd /lbry/torba && python3.7 -m pip install -e . && cd /lbry/ && \ + python3.7 scripts/set_build.py && \ + python3.7 -m pip install -e . && \ + pyinstaller -F -n lbrynet lbrynet/extras/cli.py + +RUN echo "checking contents of /lbry/dist/" && ls -lAh /lbry/dist/ && \ + echo "checking contents of /" && ls -lAh / && \ + echo "redundantly setting executable bit for good measure" && chmod +x /lbry/dist/lbrynet && \ + echo "compressing lbrynet x86_64 binary" && zip -j /lbry/dist/lbrynet-x86_64.zip /lbry/dist/lbrynet && \ + echo "creating /target/" && mkdir /target +COPY ./start.sh /usr/local/bin/start + +RUN /lbry/dist/lbrynet --version + +CMD start diff --git a/lbrynet/linux-x86_64-compiler/README.md b/lbrynet/linux-x86_64-compiler/README.md new file mode 100644 index 0000000..f8ff870 --- /dev/null +++ b/lbrynet/linux-x86_64-compiler/README.md @@ -0,0 +1,12 @@ +# x86_64-compiler + +This container's goal is to make CI/CD easier for everyone, Travis CI, GitlabCI, Jenkins... Your desktop's docker equipped development environment. + +## Example Usage + +#### build the x86_64 bin +* `docker build --tag lbryio/lbrynet:x86_64-compiler .` + +#### export compiled bin to local /target +This containers sole purpose is to build and spit out the x86_64 binary. +* `docker run --rm -ti -v $(pwd)/target:/target lbryio/lbrynet:x86_64-compiler` diff --git a/lbrynet/linux-x86_64-compiler/start.sh b/lbrynet/linux-x86_64-compiler/start.sh new file mode 100755 index 0000000..519c9a3 --- /dev/null +++ b/lbrynet/linux-x86_64-compiler/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sleep 2 +cp /lbry/dist/lbrynet-x86_64.zip /target/