Skip to content

Commit

Permalink
Use Makefile to build virtualenv inside of docker
Browse files Browse the repository at this point in the history
  • Loading branch information
svpcom committed Aug 15, 2024
1 parent a79a9ce commit 6595bbb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.pyc
dist/
deb_dist/
docker/src/
build/
env/
_trial_temp/
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file added docker/src/.gitignore
Empty file.

0 comments on commit 6595bbb

Please sign in to comment.