Refactor lbrynet compiler container locations and startup mechanics

This commit is contained in:
Ryan McGuire 2019-04-24 11:33:35 -04:00
parent f910732155
commit 69c8468e8f
6 changed files with 15 additions and 77 deletions

View file

@ -47,7 +47,7 @@ RUN python3.7 scripts/set_build.py && \
FROM multiarch/ubuntu-core:armhf-bionic as app FROM multiarch/ubuntu-core:armhf-bionic as app
RUN adduser lbrynet --gecos GECOS --shell /bin/bash --disabled-password --home /home/lbrynet RUN adduser lbrynet --gecos GECOS --shell /bin/bash --disabled-password --home /home/lbrynet
COPY ../stuff/start.sh /usr/local/bin/start COPY stuff/start.sh /usr/local/bin/start
COPY --from=compile /lbry/dist/lbrynet /usr/local/bin/ COPY --from=compile /lbry/dist/lbrynet /usr/local/bin/
EXPOSE 5279 EXPOSE 5279
USER lbrynet USER lbrynet

View file

@ -47,7 +47,7 @@ RUN python3.7 scripts/set_build.py && \
FROM ubuntu:18.04 as app FROM ubuntu:18.04 as app
RUN adduser lbrynet --gecos GECOS --shell /bin/bash --disabled-password --home /home/lbrynet RUN adduser lbrynet --gecos GECOS --shell /bin/bash --disabled-password --home /home/lbrynet
COPY ../stuff/start.sh /usr/local/bin/start COPY stuff/start.sh /usr/local/bin/start
COPY --from=compile /lbry/dist/lbrynet /usr/local/bin/ COPY --from=compile /lbry/dist/lbrynet /usr/local/bin/
EXPOSE 5279 EXPOSE 5279
USER lbrynet USER lbrynet

View file

@ -1,24 +1,17 @@
## lbrynet-As-A-Container # lbrynet
More documentation to come however the Invocation section should include enough to get you going. You're going to need at least docker docker-compose and git installed on whatever host OS you wish to use. ## Compiler containers
The compiler containers are for building lbrynet for multiple architectures.
### Build x86 compiler container
#### Invocation
This will get you a running copy of the lbrynet-daemon running inside of a docker container with default settings.
``` ```
git clone https://github.com/chamunks/lbry-docker.git docker build -t lbrynet-x86_64 -f Dockerfile-x86_64-compiler .
cd ./lbry-docker/lbrynet/
docker-compose up -d
``` ```
#### Executing commands ### Build ARM compiler container
To list containers on the host execute `docker ps -a` then run `docker exec CONTAINERNAME lbrynet-cli commands` ```
docker build -t lbrynet-armhf -f Dockerfile-armhf-compiler .
#### Docker Directory ```
This directory is in case we need to expand the functionality of this container at some point in the future.
#### Configuration
There's really no configuration required to launch this just launch it. However your blockchain data and other things are currently located in the applications home Directory here's a link to the [Documentation](https://lbry.io/faq/lbry-directories) for useful directories with lbrynet-daemon
*daemon_settings.yml* is on its way and it will be configurable soon via env-vars with *docker-compose.yml*

View file

@ -1,28 +0,0 @@
# 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
<!-- TODO: Process could be greatly sped up but keeping it simple for first release. -->
* `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.
<!-- TODO: Fork this container base to begin work on LbryTV compiler to reduce build time on rpi -->
* `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`

View file

@ -1,12 +0,0 @@
# 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`

View file

@ -1,17 +1,2 @@
#!/usr/bin/env bash #!/bin/bash
## Scope: This start.sh script will asssert container filesystem permissions and lbrynet start
## then execute the desired run mode for lbrynet with reduced permissions.
## The other thing this should do is simply create, configure or simply establish
## a fresh config with envvars passed to the container.
## Ensure perms are correct prior to running main binary
mkdir -p /lbrynet
chown -R lbrynet:lbrynet /lbrynet
chmod -R 755 /lbrynet
## TODO: Consider a config directory for future magic.
# chown -R 1000:1000 /etc/lbrynet
# chmod -R 755 /etc/lbrynet
# rm -f /var/run/lbrynet.pid
su -c "lbrynet start" lbrynet