From 17fe381402bfc842901559674dda74c7605a3367 Mon Sep 17 00:00:00 2001 From: s3lph Date: Tue, 19 Jun 2018 22:54:07 +0200 Subject: [PATCH] Use unprivileged docker image. --- .gitlab-ci.yml | 12 ++---------- Dockerfile | 10 ++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05aa099..b0cbf3c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ --- -image: debian:buster +image: s3lph/matemat:20180619-01 stages: - test @@ -8,21 +8,13 @@ stages: test: stage: test script: - - useradd matemat - - chmod o+rw -R . - - apt-get update -qy - - apt-get install -y --no-install-recommends python3-dev python3-pip python3-coverage python3-setuptools build-essential - - pip3 install wheel - pip3 install -r requirements.txt - - su - matemat -c 'python3-coverage run --branch -m unittest discover matemat' + - python3-coverage run --branch -m unittest discover matemat - python3-coverage report -m --include 'matemat/*' --omit '*/test_*.py' codestyle: stage: codestyle script: - - apt-get update -qy - - apt-get install -y --no-install-recommends python3-dev python3-pip python3-coverage python3-setuptools build-essential - - pip3 install wheel pycodestyle mypy - pip3 install -r requirements.txt - pycodestyle matemat # - mypy --ignore-missing-imports --strict -p matemat diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..126a06f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ + +FROM debian:buster + +RUN useradd -d /home/matemat -m matemat +RUN apt-get update -qy +RUN apt-get install -y --no-install-recommends python3-dev python3-pip python3-coverage python3-setuptools build-essential +RUN pip3 install wheel pycodestyle mypy + +WORKDIR /home/matemat +USER matemat