From cc7459e40388c8ede6a16277be94ea89e4fbfc6e Mon Sep 17 00:00:00 2001 From: Zach Sais Date: Mon, 16 Jun 2025 01:13:39 -0500 Subject: fix version release for Dockerfile build (#1080) --- scripts/build_sandbox.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts/build_sandbox.js') 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}`); -- cgit v1.2.3