Skip to content

Commit 001be23

Browse files
committed
Reorder layers to improve layer reuse
Signed-off-by: Samuel Monson <[email protected]>
1 parent 837fea6 commit 001be23

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Containerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ FROM $BASE_IMAGE as builder
1313
# Ensure files are installed as root
1414
USER root
1515

16-
# Copy repository files
17-
COPY / /opt/app-root/src
18-
1916
# Set correct build type for versioning
2017
ENV GUIDELLM_BUILD_TYPE=$GUIDELLM_BUILD_TYPE
2118

@@ -27,6 +24,9 @@ RUN apt-get update \
2724
# disable pdm update check
2825
ENV PDM_CHECK_UPDATE=false
2926

27+
# Copy repository files
28+
COPY / /opt/app-root/src
29+
3030
# Create a venv and install guidellm
3131
RUN python3 -m venv /opt/app-root/guidellm \
3232
&& pdm use -p /opt/app-root/src -f /opt/app-root/guidellm \
@@ -35,9 +35,6 @@ RUN python3 -m venv /opt/app-root/guidellm \
3535
# Prod image
3636
FROM $BASE_IMAGE
3737

38-
# Copy the virtual environment from the builder stage
39-
COPY --from=builder /opt/app-root/guidellm /opt/app-root/guidellm
40-
4138
# Add guidellm bin to PATH
4239
# Argument defaults can be set with GUIDELLM_<ARG>
4340
ENV HOME="/home/guidellm" \
@@ -60,5 +57,8 @@ VOLUME /results
6057
LABEL org.opencontainers.image.source="https://github.com/vllm-project/guidellm" \
6158
org.opencontainers.image.description="GuideLLM Performance Benchmarking Container"
6259

60+
# Copy the virtual environment from the builder stage
61+
COPY --from=builder /opt/app-root/guidellm /opt/app-root/guidellm
62+
6363
ENTRYPOINT [ "/opt/app-root/guidellm/bin/guidellm" ]
6464
CMD [ "benchmark", "run" ]

0 commit comments

Comments
 (0)