From a5623978a26fd06298fd53b3a0eb10fa614dd49d Mon Sep 17 00:00:00 2001 From: Petr Blaha Date: Thu, 7 Sep 2023 10:19:38 +0200 Subject: [PATCH] dozkerize build --- Dockerfile.build | 32 ++++++++++++++++++++++++++++++++ Dockerfile.howto | 6 ++++++ requirements.txt | 6 ++++++ 3 files changed, 44 insertions(+) create mode 100644 Dockerfile.build create mode 100644 Dockerfile.howto create mode 100644 requirements.txt diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 0000000..3ffba8e --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,32 @@ +FROM python:alpine +LABEL authors="Petr Blaha petr.blaha@cleverdata.cz" +USER root +RUN apk update +RUN apk add build-base libffi-dev cargo pkgconfig linux-headers py3-virtualenv + +RUN addgroup -S myuser && adduser -S -G myuser myuser +USER myuser +WORKDIR /home/myuser + +RUN pip install --upgrade pip +RUN pip install setuptools-rust pyopenssl cryptography + + +ENV PATH="/home/myuser/.local/bin:${PATH}" + +################### BEGIN NomadNet ########################################### + +COPY --chown=myuser:myuser requirements.txt requirements.txt + +RUN pip install --user -r requirements.txt + + +COPY --chown=myuser:myuser . . + +#Python create virtual environment +RUN virtualenv /home/myuser/NomadNet/venv +RUN source /home/myuser/NomadNet/venv/bin/activate + +RUN make all + +################### END NomadNet ########################################### diff --git a/Dockerfile.howto b/Dockerfile.howto new file mode 100644 index 0000000..cfd4ee8 --- /dev/null +++ b/Dockerfile.howto @@ -0,0 +1,6 @@ +# Run docker command one by one(all four), it will build NomadNet artifact and copy to dist directory. +# No need to build locally and install dependencies +docker build -t nomadnetdockerimage -f Dockerfile.build . +docker run -d -it --name nomadnetdockercontainer nomadnetdockerimage /bin/sh +docker cp nomadnetdockercontainer:/home/myuser/dist . +docker rm -f nomadnetdockercontainer \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..884128f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +compiler==0.2.0 +configobj==5.0.8 +lxmf==0.3.2 +rns==0.5.7 +setuptools==68.0.0 +urwid==2.1.2