fix(pipeline): update npm install command to include --no-audit and adjust Docker socket volume mount configuration

Signed-off-by: 孙振宇 <>
This commit is contained in:
孙振宇 2025-02-10 01:54:12 +08:00
parent 719b040ae5
commit 1335c9ec8d
2 changed files with 6 additions and 2 deletions

View File

@ -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 {

View File

@ -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}") {