From 1335c9ec8dff22bc967b1b0466a7fbeffac0f00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=8C=AF=E5=AE=87?= <> Date: Mon, 10 Feb 2025 01:54:12 +0800 Subject: [PATCH] fix(pipeline): update npm install command to include --no-audit and adjust Docker socket volume mount configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙振宇 <> --- .../src/com/freeleaps/devops/DependenciesResolver.groovy | 2 +- first-class-pipeline/vars/executeFreeleapsPipeline.groovy | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy b/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy index e7161bd5..578a2ec3 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy @@ -66,7 +66,7 @@ class DependenciesResolver { if (cachingEnabled) { steps.dir(this.workspace) { steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: '.npm-cache', cacheValidityDecidingFile: 'package-lock.json']]) { - steps.sh "npm install --cache .npm-cache --prefer-offline" + steps.sh "npm install --cache .npm-cache --prefer-offline --no-audit" } } } else { diff --git a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy index a1aa38c4..9031d809 100644 --- a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy +++ b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy @@ -376,14 +376,18 @@ def generateComponentStages(component, configurations) { containerTemplate( name: 'image-builder', image: env.imageBuilderImage, + privileged: true, ttyEnabled: true, command: 'sleep', args: 'infinity', volumeMounts: [ // We need to mount the docker socket to the container to build the image when using dind as image builder - hostPathVolumeMount(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock'), + volumeMount(mountPath: '/var/run/docker.sock', name: 'docker-sock'), ] ) + ], + volumes: [ + hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock') ] ) { node("image-builder-${component.name}") {