Use Makefile to build virtualenv inside of docker

This commit is contained in:
Vasily Evseenko 2024-08-15 14:07:40 +03:00
parent a79a9ced47
commit 6595bbb557
4 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
*.pyc
dist/
deb_dist/
docker/src/
build/
env/
_trial_temp/

View File

@ -79,6 +79,7 @@ clean:
deb_docker: /opt/qemu/bin
@if ! [ -d /opt/qemu ]; then echo "Docker cross build requires patched QEMU!\nApply ./scripts/qemu/qemu.patch to qemu-7.2.0 and build it:\n ./configure --prefix=/opt/qemu --static --disable-system && make && sudo make install"; exit 1; fi
if ! ls /proc/sys/fs/binfmt_misc | grep -q qemu ; then sudo ./scripts/qemu/qemu-binfmt-conf.sh --qemu-path /opt/qemu/bin --persistent yes; fi
cp -a Makefile docker/src/
TAG="wfb-ng:build-`date +%s`"; docker build -t $$TAG docker --build-arg SRC_IMAGE=$(DOCKER_SRC_IMAGE) && \
docker run -i --rm -v $(PWD):/build $$TAG bash -c "trap 'chown -R --reference=. .' EXIT; export VERSION=$(VERSION) COMMIT=$(COMMIT) SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) && cd /build && make clean && make test && make deb"
docker ps -a -f 'status=exited' --format '{{ .ID }} {{ .Image }}' | grep wfb-ng:build | tail -n+11 | while read c i ; do docker rm $$c && docker rmi $$i; done

View File

@ -11,8 +11,8 @@ RUN apt-get update && \
python3-future python3-all python3-all-dev \
python3-serial dh-python python3-setuptools python3-msgpack
COPY src/Makefile /tmp
ENV ENV=/opt/env
ENV PYTHON=python3
RUN virtualenv --python=$PYTHON $ENV
RUN $ENV/bin/pip install --upgrade pip setuptools git+https://github.com/svpcom/stdeb
RUN cd /tmp && make $ENV

0
docker/src/.gitignore vendored Normal file
View File