Open dimasyudhatech opened 11 months ago
Try something like this instead, distroless does not have a shell so you can't run RUN
commands.
FROM oven/bun:1.0.3-slim AS builder
WORKDIR /app
COPY ./package.json ./bun.lockb ./
RUN bun i --production \
--frozen-lockfile \
--verbose
FROM oven/bun:1.0.3-distroless
COPY /app /
WORKDIR /app
Try something like this instead, distroless does not have a shell so you can't run
RUN
commands.FROM oven/bun:1.0.3-slim AS builder WORKDIR /app COPY ./package.json ./bun.lockb ./ RUN bun i --production \ --frozen-lockfile \ --verbose FROM oven/bun:1.0.3-distroless COPY /app / WORKDIR /app
First of all, thank you so much for the response. I really appreciate it. Well, I understand that the distroless version of the image doesn’t have an in-built shell. Given this, what’s its primary use-case if users can’t utilize bun commands like bun install, bun add, etc. directly?
It looks like this can be changed with: https://docs.docker.com/engine/reference/builder/#shell
You can also use buildah in a shell script instead of writing a dockerfile. This is exactly the kind of situation where buildah run lets you avoid the annoying quirks of dockerfile syntax by not requiring a shell to run a command to build a layer.
What version of Bun is running?
1.0.3
What platform is your computer?
RockyLinux 9.2
What steps can reproduce the bug?
What is the expected behavior?
Upon executing the docker build command, I anticipate a successful build process, resulting in the creation of a Docker image named client-nayud:0.0.1 without any errors. The Bun command inside the Dockerfile should successfully install the necessary dependencies in production mode using the provided lockfile, and any subsequent Dockerfile commands should execute without errors.
What do you see instead?
Additional information
Hello folks,
First of all, I would like to express my utmost respect and admiration for this project. Your work has been game-changing, and I genuinely appreciate the value it brings to the community. I'm genuinely happy to contribute, even if it's just by raising this issue, and I hope to assist in the continued development and success of this incredible project. Thank you for all your hard work!
So, I recently attempted to build a Next.js project using Bun distroless images (version:
1.0.3-distroless
). I cloned the repository from https://github.com/dimasyudhatech/client-nayud and then executed the command:However, during the build process, I encountered the following error:
Here is a snippet of my Dockerfile that produced the error:
Environment:
Is there a workaround or fix for this issue? Thank you for your assistance.