From 46c7a7eea737eb7a728cd75f4a02e77418b9bbfd Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Wed, 17 Sep 2025 17:34:21 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8(dockerfile)=20fix=20development=20?= =?UTF-8?q?image=20to=20work=20with=20a=20different=20working=20dir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because the `pip install --editable` command was run from an empty directory, the `oidc2fer` directory that was later copied from the sources did not show up as an importable module. This worked before changing the working directory because the import falled back on looking in the current directory. --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 125974f..77ad601 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,10 +51,15 @@ WORKDIR /app # Copy project file to list dependencies COPY ./src/satosa/pyproject.toml /app/ -# Install oidc2fer in editable mode along with development dependencies -RUN pip install -e .[dev] +# Create empty module directory to please pip install --editable +# (without this, the oidc2fer module will not be importable because +# pip --editable scans the directory to create its "links") +RUN mkdir -p /app/oidc2fer -# Copy oidc2fer application (see .dockerignore) +# Install oidc2fer in editable mode along with development dependencies +RUN pip install --editable .[dev] + +# Copy oidc2fer sources (see .dockerignore) COPY ./src/satosa /app/ # Switch to unprivileged user