From f4b31b303b02e41eab0ea040468247ebe0d453a4 Mon Sep 17 00:00:00 2001 From: kurihada Date: Sun, 1 Mar 2026 00:09:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=90=86=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20172.17.0.1=EF=BC=88Linux=20Docker=20?= =?UTF-8?q?=E7=BD=91=E6=A1=A5=E7=BD=91=E5=85=B3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 ++++++ Jenkinsfile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f809270..95a4bbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,12 @@ FROM node:22-slim AS builder +# Proxy for downloading dependencies (passed via --build-arg) +ARG HTTP_PROXY +ARG HTTPS_PROXY +ENV HTTP_PROXY=${HTTP_PROXY} \ + HTTPS_PROXY=${HTTPS_PROXY} + # China npm mirror RUN npm config set registry https://registry.npmmirror.com diff --git a/Jenkinsfile b/Jenkinsfile index 2ae4ffa..5b4298c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,7 +18,7 @@ pipeline { stage('Build Docker Image') { steps { - sh "docker build --build-arg HTTP_PROXY=http://host.docker.internal:7897 --build-arg HTTPS_PROXY=http://host.docker.internal:7897 -t ${APP_NAME}:${BUILD_NUMBER} -t ${APP_NAME}:latest ." + sh "docker build --build-arg HTTP_PROXY=http://172.17.0.1:7897 --build-arg HTTPS_PROXY=http://172.17.0.1:7897 -t ${APP_NAME}:${BUILD_NUMBER} -t ${APP_NAME}:latest ." } }