Fix/ignore venv restrict bind mount (#1796)

* Ignore .venv files in git and docker

* Only bind mount cwd for `main`

Bind mounting `.` in every case would interfere with .dockerignore
We want to ignore `.venv` so that the venv of the built docker image
is used. Otherwise we would use the venv of the host inside docker.
This would negate the whole point of testing in a docker container.

Bind mounting `.` is however useful if one wants to use docker just
for "sandboxing" while running the tests on the local machine.

---------

Co-authored-by: intrigus <abc123zeus@live.de>
This commit is contained in:
intrigus-lgtm 2023-07-13 11:27:40 +02:00 committed by GitHub
parent 7d9d2dc1de
commit c54d040f06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
# venv
.venv/

3
.gitignore vendored
View File

@ -84,3 +84,6 @@ tests/qemu-tests/images
.zig/ .zig/
gdb.txt gdb.txt
# venv
.venv/

View File

@ -1,14 +1,16 @@
version: "3.8" version: "3.8"
services: services:
main: &base-spec base: &base-spec
build: . build: .
volumes:
- .:/pwndbg
platform: linux/amd64 platform: linux/amd64
security_opt: security_opt:
- seccomp:unconfined - seccomp:unconfined
cap_add: cap_add:
- SYS_PTRACE - SYS_PTRACE
main:
<<: *base-spec
volumes:
- .:/pwndbg
ubuntu18.04: ubuntu18.04:
<<: *base-spec <<: *base-spec