Add ARG HTTP_PROXY in Dockerfile to support HTTP proxy during image building.

Former-commit-id: c46af4c45f96f1942dfaf77bdbdbe5d0fe85a387
This commit is contained in:
shibingli@yeah.net
2024-12-27 18:31:14 +08:00
parent 2dedf7b401
commit 58bc6943dc
3 changed files with 58 additions and 6 deletions

View File

@@ -22,6 +22,7 @@ ARG HTTP_PROXY=
# Set the working directory
WORKDIR /app
# Set http proxy
RUN if [ -n "$HTTP_PROXY" ]; then \
echo "Configuring proxy..."; \
export http_proxy=$HTTP_PROXY; \
@@ -82,6 +83,7 @@ RUN pip uninstall -y transformer-engine flash-attn && \
fi
# Unset http proxy
RUN if [ -n "$HTTP_PROXY" ]; then \
unset http_proxy; \
unset https_proxy; \