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

Add bun devcontainer #1526

Closed
wants to merge 1 commit into from
Closed
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
15 changes: 15 additions & 0 deletions containers/bun/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# [Choice] Debian OS version: bullseye, buster
ARG VARIANT=bullseye
FROM --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

ENV BUN_INSTALL=/bun
RUN mkdir -p /bun \
&& curl -fsSL https://bun.sh/install | sh \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think sh would start to fail since bun.sh changed the curl command to bash.
Refer the working devcontainer from @alertbox/vscode-remote-try-bun

&& chown -R vscode /bun

ENV PATH=${BUN_INSTALL}/bin:${PATH} \
BUN_DIR=${BUN_INSTALL}/.cache/bun

# [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>
11 changes: 11 additions & 0 deletions containers/bun/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Bun",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Debian OS version: bullseye, buster
"args": {
"VARIANT": "bullseye"
}
},
"remoteUser": "vscode"
}
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
70 changes: 70 additions & 0 deletions containers/bun/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Bun (Community)

## Summary

_Develop Bun applications. Includes the latest Bun runtime and extension._

| Metadata | Value |
| --------------------------- | ---------------------------- |
| _Contributors_ | @bherbruck |
| _Categories_ | Community, Languages |
| _Definition type_ | Dockerfile |
| _Supported architecture(s)_ | x86-64 |
| _Works in Codespaces_ | Yes |
| _Container host OS support_ | Linux, macOS, Windows |
| _Container OS_ | Debian |
| _Languages, platforms_ | Bun, TypeScript, JavaScript |

## Using this definition

1. If this is your first time using a development container, please see getting
started information on
[setting up](https://aka.ms/vscode-remote/containers/getting-started)
Remote-Containers or
[creating a codespace](https://aka.ms/ghcs-open-codespace) using GitHub
Codespaces.

2. Start VS Code and open your project folder or connect to a codespace.

3. Press <kbd>F1</kbd> select and **Add Development Container Configuration
Files...** command for **Remote-Containers** or **Codespaces**.

> **Note:** If needed, you can drag-and-drop the `.devcontainer` folder from
> this sub-folder in a locally cloned copy of this repository into the VS
> Code file explorer instead of using the command.

4. Select this definition. You may also need to select **Show All
Definitions...** for it to appear.

5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in
Container** or **Codespaces: Rebuild Container** to start using the
definition.

## Testing the definition

To verify the definition is working as expected on your system. Follow these
steps:

1. If this is your first time using a development container, please follow the
[getting started steps](https://aka.ms/vscode-remote/containers/getting-started)
to set up your machine.
1. Clone this repository.
1. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open
Folder in Container...**
1. Select the `containers/bun` folder.
1. After the folder has opened in the container, press <kbd>Ctrl-Shift-`</kbd>
to open a new terminal.
1. Run the following command to execute a simple application.

```bash
bun
```

1. You should see "bun: a fast bundler, transpiler, JavaScript Runtime and package manager for web software." in the terminal.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See
[LICENSE](https://github.com/microsoft/vscode-dev-containers/blob/main/LICENSE).