oven-sh / bun

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

rsbuild build command does not exit when ran inside docker using bun. #12419

Open m4r1vs opened 4 months ago

m4r1vs commented 4 months ago

What version of Bun is running?

1.1.18+5a0b93523 (inside Docker image oven/bun:alpine, oven/bun:1 and oven/bun:debian)

What platform is your computer?

Linux 6.5.0-41-generic x86_64 x86_64 running Docker version 27.0.1, build 7fafd33

What steps can reproduce the bug?

  1. Create Rspack project with bun create rsbuild@latest.
  2. Create following Dockerfile:
    
    FROM oven/bun:alpine as webinterface-builder

COPY rspack-project /app/rspack-project

WORKDIR /app/rspack-project

RUN bun install RUN bun run build CMD ["echo 'never reached'"]

3. Run `docker build -t my-container .`
4. Observe that the project is build correctly but the container creation is stuck after `bun run build` and "never reached" is never printed.

### What is the expected behavior?

The docker image builds and is not stuck.

### What do you see instead?

=> => # dist/static/js/index.8b25dab0.js 24.8 kB 7.9 kB => => # dist/static/js/lib-polyfill.84abecef.js 40.5 kB 12.4 kB => => # dist/static/js/lib-react.0b11da2f.js 140.3 kB 45.0 kB => => # dist/static/js/877.f4d2276a.js 325.1 kB 99.5 kB => => # Total size: 556.0 kB => => # Gzipped size: 174.2 kB


Forever.

### Additional information

Works fine outside of Docker.
m4r1vs commented 4 months ago

See rspack issue for more details and another workaround.