diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/build_sandbox.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/build_sandbox.js b/scripts/build_sandbox.js index 89e186fa..59177e8f 100644 --- a/scripts/build_sandbox.js +++ b/scripts/build_sandbox.js @@ -109,8 +109,14 @@ function buildImage(imageName, dockerfile) { ? `${sandboxCommand} build --authfile=<(echo '{}')` : `${sandboxCommand} --config=".docker" buildx build`; + const npmPackageVersion = JSON.parse( + readFileSync(join(process.cwd(), 'package.json'), 'utf-8'), + ).version; + execSync( - `${buildCommand} ${process.env.BUILD_SANDBOX_FLAGS || ''} -f "${dockerfile}" -t "${imageName}" .`, + `${buildCommand} ${ + process.env.BUILD_SANDBOX_FLAGS || '' + } --build-arg CLI_VERSION_ARG=${npmPackageVersion} -f "${dockerfile}" -t "${imageName}" .`, { stdio: buildStdout, shell: '/bin/bash' }, ); console.log(`built ${imageName}`); |
