Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base image OS versions #9240

Open
marvinruder opened this issue Mar 4, 2024 · 10 comments · May be fixed by #15514
Open

Update base image OS versions #9240

marvinruder opened this issue Mar 4, 2024 · 10 comments · May be fixed by #15514
Labels
docker An issue that occurs when running in Docker enhancement New feature or request

Comments

@marvinruder
Copy link
Contributor

What is the problem this feature would solve?

I would like to have a Bun container with more recent operating systems (Debian Bookworm, Alpine 3.19). They offer more recent packages (notably OpenSSL 3 in Bookworm instead of 1.1 in Bullseye), have less security vulnerabilities (Bullseye shows 26, Bookworm 18 low vulnerabilities in Docker Scout) and are generally expected to include other improvements.

What is the feature you are proposing to solve the problem?

Replacing the base images

alpine:3.18                           -> alpine:3.19
debian:bullseye                       -> debian:bookworm
debian:bullseye-slim                  -> debian:bookworm-slim
gcr.io/distroless/base-nossl-debian11 -> gcr.io/distroless/base-nossl-debian12

in both build and final steps for consistency. For the distroless build step, an additional bind mount to /etc/alternatives is required to provide the which command.

What alternatives have you considered?

Like Node.js, Bun could also start publishing images for different OS versions, e.g. :alpine3.19, :alpine3.18, :bookworm, :bullseye, :bookworm-slim, :bullseye-slim etc.

@marvinruder marvinruder added the enhancement New feature or request label Mar 4, 2024
@Electroid Electroid added the docker An issue that occurs when running in Docker label Mar 4, 2024
@simonecervini
Copy link

Like Node.js, Bun could also start publishing images for different OS versions, e.g. :alpine3.19, :alpine3.18, :bookworm, :bullseye, :bookworm-slim, :bullseye-slim etc.

+1, I find this feature very useful in Node.js. I leverage it to ensure that apk add chromium always installs a very specific version of Chromium depending on the very specific version of Alpine, so that Puppeteer and its dependencies always work well together.

For example, with FROM node:20.11.1-alpine3.19, I know that apk add chromium=122.0.6261.128-r0 is possible, and I can easily check the package by visiting https://pkgs.alpinelinux.org/packages?name=chromium&branch=v3.19&repo=&arch=&maintainer=

@pmbanugo
Copy link

+1

@JayPe69
Copy link

JayPe69 commented Nov 7, 2024

#14610

Lot of vulnerabilities on the bullseyes image :

Image

@paschun
Copy link

paschun commented Nov 7, 2024

I just copied and pasted the bun bullseye Dockerfile into bookworm and it worked. So not sure why the hesitation.

https://github.com/oven-sh/bun/blob/main/dockerhub/debian-slim/Dockerfile

@Jarred-Sumner
Copy link
Collaborator

Bullseye is necessary to support glibc 2.27, which is used by Amazon Linux 2 and Vercel (for Node v18).

@spiffytech
Copy link

Can you elaborate on how those platforms prevent the Docker image from being updated to Bookworm? I'm having trouble understanding, given Vercel doesn't support Docker, and the host doesn't care about the container's glibc anyway.

Doubly confused since Bullseye ships with glibc 2.31.

@JayPe69
Copy link

JayPe69 commented Nov 8, 2024

Bullseye is necessary to support glibc 2.27, which is used by Amazon Linux 2 and Vercel (for Node v18).

Ok but lot of users use Node v20+.
And AWS is not the only one cloud provider.

So they could create both images bookworm and bullseye

@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Nov 8, 2024

Can you elaborate on how those platforms prevent the Docker image from being updated to Bookworm? I'm having trouble understanding, given Vercel doesn't support Docker, and the host doesn't care about the container's glibc anyway.

Doubly confused since Bullseye ships with glibc 2.31.

oh, i misunderstood

this issue is about Bun's published Docker images, not about the Docker images we compile Bun itself with.

Yeah we should just update the published Docker images.

The ones we compile Bun with do need the oldstable version of Debian to support Node 18 & Amazon Linux 2. We get away with the lower minimum glibc requirement because we force the linker to use older versions of various symbols, and that workaround gets harder the more distant the actual glibc version used for linking is. The problem there is we need to use C++ 20 (WebKit minimum), but libc++ used in older glibc versions has an ABI-breaking change where std::span has pointer and length flipped. We're stuck on Clang 16 until we find a suitable workaround or manually compile glibc with the later version of libc++ and LLVM.

@notramo
Copy link

notramo commented Nov 29, 2024

Is there any update on this? It's literally just a replacement of 2 words in the Dockerfile.

@hw-rjuzak
Copy link

Would it also be possible to add an image base on gcr.io/distroless/base-nossl-debian12:nonroot ?

something like

  • oven/bun:1.2.2-distroless-debian11
  • oven/bun:1.2.2-distroless-debian11-nonroot
  • oven/bun:1.2.2-distroless-debian12
  • oven/bun:1.2.2-distroless-debian12-nonroot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker An issue that occurs when running in Docker enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants