Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Add bun container definition #1614

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions containers/bun/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/base:0-bullseye

ENV BUN_INSTALL=/bun

RUN mkdir -p /bun \
&& curl https://bun.sh/install | bash \
&& chown -R vscode /bun

ENV PATH=${BUN_INSTALL}/bin:${PATH}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
14 changes: 14 additions & 0 deletions containers/bun/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Bun",
"build": {
"dockerfile": "Dockerfile"
},
"remoteUser": "vscode",
"customizations": {
"vscode": {
"extensions": [
"Pandy.bun"
]
}
}
}
2 changes: 2 additions & 0 deletions containers/bun/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
README.md
.npmignore
37 changes: 37 additions & 0 deletions containers/bun/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Bun (Community)

## Summary

[Bun](https://bun.sh/) is a fast all-in-one JavaScript runtime.

Bundle, transpile, install and run JavaScript & TypeScript projects — all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.

| Metadata | Value |
| --------------------------- | --------------------------------------------------- |
| _Contributors_ | [Semyon Radionov](https://github.com/Wobbly-Wibbly) |
| _Categories_ | Community, Languages |
| _Definition Type_ | Dockerfile |
| _Works in Codespaces_ | Yes |
| _Container host OS support_ | Linux, MacOS, Windows |
| _Container OS_ | Debian |
| _Languages, platforms_ | Bun, TypeScript, JavaScript |

## Using this definition

After container is started open up a terminal and run

```sh
bun init
```

this will create a startup template!

you can run it with

```sh
bun run ./index.ts
# or
bun run ./index.js
```

This will depend on what index file you have chosen