oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.13k stars 2.76k forks source link

Bun install stuck at Resolved, downloaded and extracted [2] with docker build #12546

Open ziyaDev opened 3 months ago

ziyaDev commented 3 months ago

How can we reproduce the crash?

I'm encountering issues while using the official Dockerfile configuration to build my NestJS app. The build process stalls at the following step: RUN cd /temp/dev && bun install --frozen-lockfile

Relevant log output

Step 5/21 : RUN cd /temp/dev && bun install --frozen-lockfile
 ---> Running in 8042b45383ff
bun install v1.1.18 (5a0b9352)
Resolving dependencies
Resolved, downloaded and extracted [2]
============================================================
Bun v1.1.18 (5a0b9352) Linux x64 (baseline)
Linux Kernel v6.8.11 | glibc v2.31
Args: "bun" "install" "--frozen-lockfile"
Features: extracted_packages(189)
Elapsed: 384584ms | User: 1636ms | Sys: 2961ms
RSS: 3.76GB | Peak: 0.42GB | Commit: 3.76GB | Faults: 200

panic: Segmentation fault at address 0xB0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Illegal instruction (core dumped)
The command '/bin/sh -c cd /temp/dev && bun install --frozen-lockfile' returned a non-zero code: 132

Stack Trace (bun.report)

Bun v1.1.18 (5a0b935) on linux x86_64_baseline [InstallCommand]

Segmentation fault at address 0x000000B0

yooouuri commented 1 month ago

Same over here

FROM oven/bun:1 AS base
WORKDIR /usr/src/app

FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile

RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production

FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
ENV NODE_ENV=production
RUN bun run --bun build

FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app/build/server ./build/server
COPY --from=prerelease /usr/src/app/build/client ./build/client
COPY --from=prerelease /usr/src/app/package.json .

USER bun
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "start" ]
Step 6/22 : RUN cd /temp/dev && bun install --frozen-lockfile
 ---> Running in 4fc091e27a5e
bun install v1.1.29 (6d43b366)
Resolving dependencies
Resolved, downloaded and extracted [2]
farhan-helmy commented 6 days ago

same here

arsu4ka commented 5 days ago

anybody got a fix? stuck with the same issue, can't build the docker image

[EDIT] Downgraded from 1.1.34 to 1.1.33 and it worked, should be like that 😢