Skip to content

Commit 42e706a

Browse files
committed
fix(Dockerfile): Fixed ScanCode build issues in Dockerfile
ScanCode, especially on macOS due to the used Python installation, needs some explicit dependencies (especially click and setuptools) to work correctly. The dependencies must be installed before installing ScanCode for it to work properly. Signed-off-by: Jan-Niclas Struewer <[email protected]>
1 parent 5365aec commit 42e706a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.env.versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ NUGET_INSPECTOR_VERSION=0.9.12
1717
PHP_VERSION=8.3
1818
PIP_VERSION=25.2.0
1919
PYENV_GIT_TAG=v2.6.3
20+
PYTHON_CLICK_VERSION=8.2.1
2021
PYTHON_INSPECTOR_VERSION=0.14.4
2122
PYTHON_PIPENV_VERSION=2023.12.1
2223
PYTHON_POETRY_VERSION=2.1.3

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ FROM base AS python_install
121121
ARG CONAN2_VERSION
122122
ARG CONAN_VERSION
123123
ARG PIP_VERSION
124+
ARG PYTHON_CLICK_VERSION
124125
ARG PYTHON_INSPECTOR_VERSION
125126
ARG PYTHON_PIPENV_VERSION
126127
ARG PYTHON_POETRY_PLUGIN_EXPORT_VERSION
@@ -155,13 +156,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
155156
clang \
156157
&& sudo rm -rf /var/lib/apt/lists/*
157158

158-
RUN ARCH=$(arch | sed s/aarch64/arm64/) \
159-
&& if [ "$ARCH" == "arm64" ]; then \
160-
pip install -U scancode-toolkit-mini==$SCANCODE_VERSION; \
161-
else \
162-
pip install -U scancode-toolkit==$SCANCODE_VERSION; \
163-
fi
164-
165159
RUN pip install --no-cache-dir -U \
166160
pip=="$PIP_VERSION" \
167161
wheel \
@@ -172,9 +166,17 @@ RUN pip install --no-cache-dir -U \
172166
poetry=="$PYTHON_POETRY_VERSION" \
173167
poetry-plugin-export=="$PYTHON_POETRY_PLUGIN_EXPORT_VERSION" \
174168
python-inspector=="$PYTHON_INSPECTOR_VERSION" \
169+
click==$PYTHON_CLICK_VERSION \
175170
setuptools=="$PYTHON_SETUPTOOLS_VERSION" \
176171
uv=="$UV_VERSION"
177172

173+
RUN ARCH=$(arch | sed s/aarch64/arm64/) \
174+
&& if [ "$ARCH" == "arm64" ]; then \
175+
pip install -U scancode-toolkit-mini==$SCANCODE_VERSION; \
176+
else \
177+
pip install -U scancode-toolkit==$SCANCODE_VERSION; \
178+
fi
179+
178180
# # Extract ScanCode license texts to a directory.
179181
# RUN ARCH=$(arch | sed s/aarch64/arm64/) \
180182
# if [ "$ARCH" == "arm64" ]; then \

0 commit comments

Comments
 (0)