#Installing bun inside a devcontainer

1 messages · Page 1 of 1 (latest)

ornate horizon
#

Hello, I would like to install bun inside an Alpine Linux devcontainer ... however, I don't seem to be having much luck.

I have the following setup inside the Dockerfile:

# Install Bun
RUN curl -fsSL https://bun.sh/install | bash

# Set the BUN_INSTALL environment variable
ENV $BUN_INSTALL="$HOME/.bun"

# Set the PATH to include Bun
ENV $PATH="$BUN_INSTALL/bin:$PATH"

# Configure Zsh with Bun
RUN echo 'export BUN_INSTALL="$HOME/.bun"' >> ~/.zshrc && echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> ~/.zshrc

Yet, alas, no luck (see screenshot). The bun command is not found.

I try installing manually inside the container, still no luck. (see screenshot) The bun command is not found.

Amy help would be amazing ... !

fallen slate
ornate horizon
#

Nope, unfortunately:

zsh: no such file or directory: /root/.bun/bin/bun
#

It's there though ...

fallen slate
#

i have like no knowledge of zsh but id assume it should work normally as its just linux

#

hopefully someone knows more on this

ornate horizon
#

So frustrating, zsh is the default on the bun website for documentation .... yet it doesn't work. I just don't get the hype I'm afraid 😭 I come back to bun every 3 months or so and there are always teething problems.

fallen slate
#

maybe npm has sanity: npm install -g bun , but like i havent had any of these issues that lots of people have before so thats sad

ornate horizon
#

I don't have npm inside of the devcontainer, and really don't want to install node to install bun 😄

fallen slate
#

honestly fair, i thought everything ships with some degreee of node/npm support lol

#

but this is designed to me more minimal i feel like

ornate horizon
#

If I install node, I may as well just use node ... although the commands run slower, I can get something working so much quicker haha

#

Stability over hype

fallen slate
#

yeah

#

i personaly think you should have node as good backup and to test when bun does weird things

#

also if you are doing docker file, why not use the bun docker :)

ornate horizon
#

I just wanted to create an SDK from some open api specs is all, it's a Go API project.

fallen slate
#

ye

#

i heard you can have multiple from which made me intrested thats all

ornate horizon
#

It's a devcontainer unfortunately, so wanted it purely for dev tooling

#

They're not runners

#

Thanks for your help, but I think for today I will abandon bun in my toolchain. Thank you nonetheless.

fallen slate
#

makes sense, hopefully when bun becomes more stable (ie these weird bugs sorted out) bun can reappear to you :)

sacred sigil
#

can you run
file ~/.bun/bin/bun
and
ldd ~/.bun/bin/bun

ornate horizon
#

Ok so file is not a default alpine command so I probably won't be able to run that. But ldd gives me this:

/lib/ld-linux-aarch64.so.1 (0xffffb6d84000)
        libc.so.6 => /lib/ld-linux-aarch64.so.1 (0xffffb6d84000)
        libpthread.so.0 => /lib/ld-linux-aarch64.so.1 (0xffffb6d84000)
        libdl.so.2 => /lib/ld-linux-aarch64.so.1 (0xffffb6d84000)
        libm.so.6 => /lib/ld-linux-aarch64.so.1 (0xffffb6d84000)
Error relocating /root/.bun/bin/bun: gnu_get_libc_version: symbol not found
Error relocating /root/.bun/bin/bun: __cxa_at_quick_exit: symbol not found
Error relocating /root/.bun/bin/bun: __register_atfork: symbol not found
Error relocating /root/.bun/bin/bun: backtrace: symbol not found
Error relocating /root/.bun/bin/bun: __strftime_l: symbol not found
Error relocating /root/.bun/bin/bun: backtrace_symbols: symbol not found
#

Looks to me like we need libc installed ...

#

Although I am using this:

RUN apk update && apk add --no-cache bash curl gcc libc-dev make openssh-client

In the Dockerfile ...

#

Ok looks like Alpine is not supported due to lack of MUSL support ... ok that makes sense

#

Thought I was going crazy

sacred sigil
#

unfortunately you can get the "no such file or directory" error if a library needed by the executable is not found, even if the executable exists

#

super unclear

#

i wonder how much work it'd be for us to support musl...