DEV Community

Cover image for Docker Image Bun + Node + Yarn
Railson Ferreira de Souza
Railson Ferreira de Souza

Posted on

Docker Image Bun + Node + Yarn

Hello there! ๐Ÿ‘‹

Recently, Bun 1.0 was released, and since it seems to follow the "node shape" of doing things, transitioning to Bun shouldn't be that difficult.

If you are a DevOps engineer, and your developer colleagues are quite excited to use Bun, what I have here could help you a bit. I've created a Docker Image based on Bun, which includes Node and Yarn. You can find it here:
https://hub.docker.com/r/bunlovesnode/bun

Here's a use case for it:

# Dockerfile
FROM bunlovesnode/bun:1.0.0-node18

RUN \
  if [ -f bun.lockb ]; then bun install --frozen-lockfile; \
  elif [ -f yarn.lock ]; then yarn --frozen-lockfile; \
  elif [ -f package-lock.json ]; then npm ci; \
  elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
  else echo "Lockfile not found." && exit 1; \
  fi
Enter fullscreen mode Exit fullscreen mode

I intend to keep this image updated initially, as we expect to replace everything if the intention is to use Bun.

I hope this can be of help.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay