Skip to content

Commit

Permalink
Füge Testnutzer in docker-images/python3.11 hinzu
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxG87 committed Dec 22, 2023
1 parent 377bfe6 commit 80f8616
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dockerfiles/python3.11
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# python:3.11.7-slim-bookworm as of 14 December 2023
FROM python@sha256:cfd7ed5c11a88ce533d69a1da2fd932d647f9eb6791c5b4ddce081aedf7f7876

ARG USER=testrunner

# Provide excecutables
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
Expand All @@ -12,6 +14,12 @@ ENV POETRY_VERSION=1.7.1
RUN python3 -m pip install "poetry==$POETRY_VERSION"
ENV PATH=$PATH:/root/.poetry/bin

# Add unpriviliged user
RUN useradd -ms /bin/bash $USER && \
adduser $USER sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER $USER

# Setup production dependencies
WORKDIR /project
COPY pyproject.toml poetry.lock ./
Expand All @@ -23,4 +31,4 @@ RUN poetry install

# Create /dev/disk/by-uuid/. It is required by the test suite but not available
# in Docker containers by default.
CMD mkdir -p /dev/disk/by-uuid/ && poetry run pytest --no-cov .
CMD sudo mkdir -p /dev/disk/by-uuid/ && poetry run pytest --no-cov .

0 comments on commit 80f8616

Please sign in to comment.