@@ -130,6 +130,35 @@ describe("Dockerfile", () => {
130130 ) ;
131131 } ) ;
132132
133+ it ( "uses portable copies for workspace dependency inputs" , async ( ) => {
134+ const dockerfile = await readFile ( dockerfilePath , "utf8" ) ;
135+ const workspaceDepsStart = dockerfile . indexOf (
136+ "FROM ${OPENCLAW_NODE_BOOKWORM_IMAGE} AS workspace-deps" ,
137+ ) ;
138+ const workspaceDepsEnd = dockerfile . indexOf ( "FROM ${OPENCLAW_BUN_IMAGE} AS bun-binary" ) ;
139+
140+ expect ( workspaceDepsStart ) . toBeGreaterThan ( - 1 ) ;
141+ expect ( workspaceDepsEnd ) . toBeGreaterThan ( workspaceDepsStart ) ;
142+
143+ const workspaceDeps = dockerfile . slice ( workspaceDepsStart , workspaceDepsEnd ) ;
144+ const extractionIndex = workspaceDeps . indexOf (
145+ 'RUN mkdir -p /out/packages "/out/${OPENCLAW_BUNDLED_PLUGIN_DIR}"' ,
146+ ) ;
147+ const inputCopies = [
148+ "COPY scripts/lib/docker-plugin-selection.mjs /tmp/docker-plugin-selection.mjs" ,
149+ "COPY packages /tmp/packages" ,
150+ "COPY ${OPENCLAW_BUNDLED_PLUGIN_DIR} /tmp/${OPENCLAW_BUNDLED_PLUGIN_DIR}" ,
151+ ] ;
152+
153+ expect ( extractionIndex ) . toBeGreaterThan ( - 1 ) ;
154+ for ( const copy of inputCopies ) {
155+ const copyIndex = workspaceDeps . indexOf ( copy ) ;
156+ expect ( copyIndex , copy ) . toBeGreaterThan ( - 1 ) ;
157+ expect ( copyIndex , copy ) . toBeLessThan ( extractionIndex ) ;
158+ }
159+ expect ( workspaceDeps ) . not . toContain ( "--mount=type=bind" ) ;
160+ } ) ;
161+
133162 it ( "copies install workspace manifests before pnpm install" , async ( ) => {
134163 const dockerfile = await readFile ( dockerfilePath , "utf8" ) ;
135164 const installIndex = dockerfile . indexOf ( "pnpm install --frozen-lockfile" ) ;
@@ -151,9 +180,6 @@ describe("Dockerfile", () => {
151180 expect ( packageManifestIndex ) . toBeGreaterThan ( - 1 ) ;
152181 expect ( extensionManifestIndex ) . toBeGreaterThan ( - 1 ) ;
153182 expect ( dockerfile ) . toContain ( "for manifest in /tmp/packages/*/package.json" ) ;
154- expect ( dockerfile ) . toContain (
155- "--mount=type=bind,source=scripts/lib/docker-plugin-selection.mjs,target=/tmp/docker-plugin-selection.mjs,readonly" ,
156- ) ;
157183 expect ( dockerfile ) . toContain (
158184 'node /tmp/docker-plugin-selection.mjs "/tmp/${OPENCLAW_BUNDLED_PLUGIN_DIR}" "$OPENCLAW_EXTENSIONS"' ,
159185 ) ;
0 commit comments