Skip to content

Commit f3f59a0

Browse files
wemeetagainphilknows
authored andcommitted
fix(docker): reinstall dependencies on target platform (#8816)
**Motivation** - Report of our latest release not working on aarch64 via docker **Description** It seems that pnpm has stricter rules around which optionalDependencies are installed, which lead to platform-specific dependencies not being available in the final docker image on aarch64 builds. Old dockerfile steps: ``` step 1: (on x86_64) install packages (doesn't install aarch64 packages) step 2: (on aarch64) rebuild packages final: doesn't have aarch64 packages ``` This PR adds to step 2 of the dockerfile to re-`pnpm install` when on the target platform.
1 parent af8d4d2 commit f3f59a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y git g++ make python3 python3-setuptools
3030
COPY --from=build_src /usr/app .
3131

3232
# Rebuild native deps
33-
RUN corepack enable && pnpm rebuild
33+
RUN corepack enable && pnpm install --frozen-lockfile --prod && pnpm rebuild
3434

3535
# Copy built src + node_modules to a new layer to prune unnecessary fs
3636
# Previous layer weights 7.25GB, while this final 488MB (as of Oct 2020)

0 commit comments

Comments
 (0)