From f64f9028bb81472f613a1dad3a12374b5716c967 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 9 Mar 2023 23:38:39 +0000 Subject: [PATCH] Use virtualenv --- .gitlab-ci.yml | 2 +- security-scanner/Dockerfile | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b7b0d89..93829cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,7 +57,7 @@ security_scanner: script: - set -x - export GITLAB_URL="$(echo "$CI_PROJECT_URL" | grep -Eo '^https?://[^/]*')" - - python3 -m security_scanner $target + - /code/venv/bin/python -m security_scanner $target only: refs: - schedules diff --git a/security-scanner/Dockerfile b/security-scanner/Dockerfile index 10110ad..622e443 100644 --- a/security-scanner/Dockerfile +++ b/security-scanner/Dockerfile @@ -7,14 +7,17 @@ RUN apt-get update \ python3 \ python3-apt \ python3-pip \ + python3-venv \ && rm -rf /var/lib/apt/lists/* COPY setup.py /code/setup.py WORKDIR /code -RUN pip3 install -e . +RUN python3 -m venv --system-site-packages venv + +RUN venv/bin/pip install -e . ADD . /code -RUN python3 setup.py install +RUN venv/bin/python setup.py install