-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdockerfile
More file actions
30 lines (24 loc) · 883 Bytes
/
Copy pathdockerfile
File metadata and controls
30 lines (24 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM python:3.13-slim AS build-image
# package install
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install \
-y --no-install-recommends --no-install-suggests \
rdfind gcc libc6-dev libtiff-dev openjdk-21-jdk && \
apt clean && \
rm -rf /var/lib/apt/lists/*
# de-duplicate files and replace them with symlinks
RUN rdfind -minsize 32768 -makehardlinks true -makeresultsfile false /home/myuser
# make sure all messages always reach console
ENV PYTHONUNBUFFERED=1
# install package
WORKDIR /home/myuser/scantools
COPY scantools/ scantools
COPY pyproject.toml .
RUN sed -i 's/.*\[tool.setuptools_scm\]/#&/g' pyproject.toml
RUN pip3 install --no-cache-dir .
RUN useradd --create-home myuser
USER myuser
WORKDIR /home/myuser/scantools
COPY --chown=myuser:myuser scantools/ scantools
COPY --chown=myuser:myuser pyproject.toml .
CMD ["/usr/bin/env", "bash"]