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

Former-commit-id: f1d76786e0
This commit is contained in:
shibingli@yeah.net
2024-12-27 18:31:14 +08:00
parent a37ef0eaae
commit c76c33ddb1
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; \