Bun is a modern JavaScript runtime that can be utilized within Docker containers. Here are the key points regarding its Docker integration:
Docker Image Availability
- Official Docker Image: Bun has an official Docker image available at `oven/bun`. This image can be pulled from Docker Hub and is designed for running Bun applications efficiently[4][5].
- Usage: You can build and run a Bun application using Docker. A typical command to run a Bun container would be:
docker run -d -p 3000:3000 oven/bun
This command starts the container in detached mode and maps port 3000 of the container to port 3000 on your local machine[3].
Dockerfile Example
- The Dockerfile for Bun is primarily used in continuous integration (CI) workflows and is not intended for general development or as a base image for other projects. It includes commands to install dependencies and compile the Bun runtime[1].
Additional Resources
- For those looking to containerize their Bun applications, there are guides available that provide step-by-step instructions on setting up a Docker environment with Bun, including how to initialize the container, copy project files, and manage dependencies[3].
Overall, Bun's integration with Docker allows developers to easily deploy applications in a consistent environment, leveraging the benefits of containerization.
Citations:[1] https://github.com/oven-sh/bun/blob/main/Dockerfile
[2] https://github.com/oven-sh/bun/discussions/1040
[3] https://bun.sh/guides/ecosystem/docker
[4] https://hub.docker.com/r/oven/bun
[5] https://hub.docker.com/r/oven/bun/tags
[6] https://hub.docker.com/layers/oven/bun/latest/images/sha256-fe1845932215816ee150a60ab0f3b529ac80af3e17f9e9fdb089c772910457ae?context=explore
[7] https://hub.docker.com/layers/oven/bun/0.7.2/images/sha256-53bc3e77ab6fda1488b880d2ca7d17826a8465dd55c2f1e5d9d0022f82f79cda?context=explore
[8] https://hub.docker.com/layers/oven/bun/latest/images/sha256-96ae5d400b552c372c377062c582785e2d816f49d3af5959fb0b5ec8dbdc0da5?context=explore