dozkerize build

This commit is contained in:
Petr Blaha 2023-09-07 10:19:38 +02:00
parent 062e31964a
commit a5623978a2
3 changed files with 44 additions and 0 deletions

32
Dockerfile.build Normal file
View File

@ -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 ###########################################

6
Dockerfile.howto Normal file
View File

@ -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

6
requirements.txt Normal file
View File

@ -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