-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile.tensorflow
More file actions
34 lines (27 loc) · 932 Bytes
/
Dockerfile.tensorflow
File metadata and controls
34 lines (27 loc) · 932 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
31
32
33
34
FROM python:3.12-slim@sha256:46cb7cc2877e60fbd5e21a9ae6115c30ace7a077b9f8772da879e4590c18c2e3
WORKDIR /app
# Pull in current Debian security fixes from the configured apt sources.
RUN apt-get update \
&& apt-get install --yes --no-install-recommends --only-upgrade libc-bin libc6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy only necessary files for installation
COPY pyproject.toml README.md ./
COPY requirements-tensorflow.txt ./
COPY modelaudit ./modelaudit
# Install the application with TensorFlow extras using pinned constraints
RUN pip install --no-cache-dir -c requirements-tensorflow.txt ".[tensorflow]"
# Create a non-root user
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser
USER appuser
# Set the entrypoint
ENTRYPOINT ["modelaudit"]
CMD ["--help"]