1
- ARG BASE_IMAGE=docker.io/python:3.13-slim
1
+ # FIXME: Update to official python-3.13-minimal image when available
2
+ ARG BASE_IMAGE=quay.io/psap/python-313-minimal:fedora
2
3
3
4
# release: take the last version and add a post if build iteration
4
5
# candidate: increment to next minor, add 'rc' with build iteration
@@ -10,13 +11,14 @@ ARG GUIDELLM_BUILD_TYPE=dev
10
11
# Use a multi-stage build to create a lightweight production image
11
12
FROM $BASE_IMAGE as builder
12
13
13
- # Ensure files are installed as root
14
+ # Switch to root for installing packages
14
15
USER root
15
16
16
17
# Install build tooling
17
- RUN apt-get update \
18
- && apt-get install -y --no-install-recommends git \
19
- && pip install --no-cache-dir -U pdm
18
+ RUN dnf install -y git \
19
+ && python3 -m venv /tmp/pdm \
20
+ && /tmp/pdm/bin/pip install --no-cache-dir -U pdm \
21
+ && ln -s /tmp/pdm/bin/pdm /usr/local/bin/pdm
20
22
21
23
# Disable pdm update check
22
24
# Set correct build type for versioning
@@ -28,8 +30,7 @@ ENV PDM_CHECK_UPDATE=false \
28
30
COPY / /opt/app-root/src
29
31
30
32
# Create a venv and install guidellm
31
- RUN python3 -m venv /opt/app-root/guidellm \
32
- && pdm use -p /opt/app-root/src -f /opt/app-root/guidellm \
33
+ RUN pdm use -p /opt/app-root/src -f /opt/app-root \
33
34
&& pdm install -p /opt/app-root/src --check --prod --no-editable
34
35
35
36
# Prod image
@@ -38,14 +39,10 @@ FROM $BASE_IMAGE
38
39
# Add guidellm bin to PATH
39
40
# Argument defaults can be set with GUIDELLM_<ARG>
40
41
ENV HOME="/home/guidellm" \
41
- PATH="/opt/app-root/guidellm/bin:$PATH" \
42
42
GUIDELLM_OUTPUT_PATH="/results/benchmarks.json"
43
43
44
- # Create a non-root user
45
- RUN useradd -K UMASK=0002 -Md $HOME -g root guidellm
46
-
47
- # Switch to non-root user
48
- USER guidellm
44
+ # Make sure root is the primary group
45
+ USER 1001:0
49
46
50
47
# Create the user home dir
51
48
WORKDIR $HOME
@@ -59,7 +56,7 @@ LABEL org.opencontainers.image.source="https://github.com/vllm-project/guidellm"
59
56
60
57
# Copy the virtual environment from the builder stage
61
58
# Do this as late as possible to leverage layer caching
62
- COPY --from=builder /opt/app-root/guidellm /opt/app-root/guidellm
59
+ COPY --chown=1001:0 -- from=builder /opt/app-root /opt/app-root
63
60
64
- ENTRYPOINT [ "/opt/app-root/guidellm/ bin/guidellm" ]
61
+ ENTRYPOINT [ "/opt/app-root/bin/guidellm" ]
65
62
CMD [ "benchmark" , "run" ]
0 commit comments