diff --git a/Readme.adoc b/Readme.adoc index b164ba5..6c5296d 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -95,3 +95,32 @@ optional arguments: ---- +== Build and install instructions + +Install Docker Engine: + +https://docs.docker.com/engine/install/ubuntu/ + +Post docker install, add current user to docker group: + +https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user + +Ubuntu: +[source, bash] +---- +sudo apt-get -y install build-essential python3 python3-env + +python3 -m pip install pipenv + +# For Ubuntu Jammy ( 22.04 ): +make output-ubuntu-jammy +chmod +x out/ubuntu/jammy/radixnode +sudo cp out/ubuntu/jammy/radixnode /usr/local/bin/radixnode + + +# For Ubuntu Focal ( 20.04 ): +make output-ubuntu-focal +chmod +x out/ubuntu/focal/radixnode +sudo cp out/ubuntu/focal/radixnode /usr/local/bin/radixnode + +---- diff --git a/node-runner-cli/Dockerfile.ubuntujammy b/node-runner-cli/Dockerfile.ubuntujammy new file mode 100644 index 0000000..679a364 --- /dev/null +++ b/node-runner-cli/Dockerfile.ubuntujammy @@ -0,0 +1,43 @@ +FROM ubuntu:22.04 as BUILD +MAINTAINER radixdlt + +ENV DEBIAN_FRONTEND noninteractive +ENV PYTHON_VERSION 3.10 + +CMD /bin/bash + +RUN apt-get update \ + && apt-get install -y --no-install-recommends make build-essential libssl-dev zlib1g-dev \ + libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ + libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ca-certificates git > /dev/null + + + +ENV PYENV_ROOT /root/.pyenv +ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH + +# Install pyenv +RUN set -ex \ + && curl https://pyenv.run | bash \ + && pyenv update + + +RUN CONFIGURE_OPTS=--enable-shared pyenv install 3.10 + + + +RUN pyenv virtualenv 3.10 nodecli +RUN pyenv local nodecli +RUN pip install pyinstaller==4.10 + +WORKDIR /app +COPY requirements.txt /app/requirements.txt +RUN pip install -r requirements.txt + +COPY . /app +RUN pyinstaller --onefile --windowed radixnode.spec + +RUN DISABLE_VERSION_CHECK=true /app/dist/radixnode version + +FROM scratch AS export-stage +COPY --from=BUILD /app/dist / diff --git a/node-runner-cli/Makefile b/node-runner-cli/Makefile index 6835645..13c9b99 100644 --- a/node-runner-cli/Makefile +++ b/node-runner-cli/Makefile @@ -3,12 +3,15 @@ install: $(shell chmod +x add-version.sh) $(shell ./add-version.sh) pip install pipenv - pipenv lock -r > requirements.txt + pipenv requirements > requirements.txt .PHONY: output output-ubuntu-focal: install DOCKER_BUILDKIT=1 docker build --output type=local,dest=out/ubuntu/focal --progress plain -f Dockerfile.ubuntufocal . +output-ubuntu-jammy: install + DOCKER_BUILDKIT=1 docker build --output type=local,dest=out/ubuntu/jammy --progress plain -f Dockerfile.ubuntujammy . + .PHONY: local local: install pip install -r requirements.txt