Skip to content

Commit a1821f2

Browse files
authored
New Devbox README.md (#2536)
1 parent 9053c85 commit a1821f2

File tree

1 file changed

+107
-31
lines changed

1 file changed

+107
-31
lines changed

README.md

Lines changed: 107 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,120 @@
1-
# Devbox: Instant development environments and containers using `nix`.
1+
# Devbox: instant, easy and predictable development environments.
22

3-
Devbox is a tool that lets you easily manage development environments.
3+
[![release](https://github.com/jetpack-io/devbox/actions/workflows/release.yml/badge.svg)](https://github.com/jetpack-io/devbox/actions/workflows/release.yml)
4+
![Apache 2.0](https://img.shields.io/github/license/jetpack-io/devbox)
45

5-
## Prerequisites
6-
* [Nix Package Manager](https://nixos.org/download.html) (Don't worry, you don't need to learn Nix)
7-
* [Docker](https://docs.docker.com/engine/install/)
6+
With Devbox, you can easily create deterministic shells with preinstalled utilities without polluting your machine with contradictory versions.
87

9-
## Quickstart
8+
Want to try out a tool but don’t want the mess? Add it to a Devbox shell.
109

11-
Initialize Devbox for your project
12-
```bash
13-
devbox init
14-
```
10+
<iframe width="560" height="315" src="https://www.youtube.com/embed/WMBaXQZmDoA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
1511

16-
Add [Nix Packages](https://search.nixos.org/packages) to your project
17-
```bash
18-
devbox add goreleaser
19-
```
12+
## Compatibility
2013

21-
Start a local development shell with your project and packages
22-
```bash
23-
devbox shell
24-
```
14+
Devbox works on:
2515

26-
Build a Docker image of your project
27-
```bash
28-
devbox build
29-
```
30-
## Language Support
16+
- Linux
17+
- macOS
18+
- Windows via WSL2
3119

32-
Devbox can detect and automatically configure shells + Docker containers for your language.
3320

34-
To view the current plan for your project run:
35-
```bash
36-
devbox plan
37-
```
38-
Currently supported languages include:
39-
* Go
21+
## Setup
22+
23+
1. Install [Nix Package Manager](https://nixos.org/download.html). (Don't worry, you don't need to learn Nix.)
24+
25+
2. Install [Docker Engine](https://docs.docker.com/engine/install/) or [Docker Desktop](https://www.docker.com/get-started/).
26+
27+
3. Install [Devbox binaries](https://github.com/jetpack-io/devbox/releases) and ensure `devbox` is in the `PATH`. For Windows, install the Linux binaries into WSL.
28+
29+
30+
## Quickstart: Fast, Deterministic Shell
31+
32+
In this quickstart we’ll create a development shell with specific tools installed. These tools will only be available when using this Devbox shell, ensuring we don’t pollute your machine.
33+
34+
1. Open a terminal in a new empty folder.
35+
36+
2. Initialize Devbox:
37+
38+
```bash
39+
devbox init
40+
```
41+
42+
This creates `devbox.json`. You should commit this file.
43+
44+
3. Add command-line tools from [Nix Packages](https://search.nixos.org/packages). For example, to add Python 3.10:
45+
46+
```bash
47+
devbox add python310
48+
```
49+
50+
4. Start a new shell that has these tools installed:
51+
52+
```bash
53+
devbox shell
54+
```
55+
56+
You can tell you’re in a Devbox shell (and not your regular terminal) because the shell prompt and directory changed.
57+
58+
5. Use your favorite tools.
59+
60+
In this example we installed Python 3.10, so let’s use it.
61+
62+
```bash
63+
python --version
64+
```
65+
66+
6. Your regular tools are also available including environment variables and config settings.
67+
68+
```bash
69+
git config --get user.name
70+
```
71+
72+
7. To exit the Devbox shell and return to your regular shell:
73+
74+
```bash
75+
exit
76+
```
77+
78+
79+
## Quickstart: Automatic Docker Image
80+
81+
With a Devbox environment, it’s simple to build the codebase into an OCI-compliant container image. Devbox will automatically detect your toolchain and pull in the correct Dockerfile.
82+
83+
1. Open a terminal in a Devbox folder (see above).
84+
85+
2. Build the image:
86+
87+
```bash
88+
devbox build
89+
```
90+
91+
The resulting image is named `devbox`.
92+
93+
3. Tag the image with a more descriptive name:
94+
95+
```
96+
docker tag devbox my-image:v0.1
97+
```
98+
99+
### Auto-detected languages:
100+
101+
- Go
102+
103+
Want more languages? [Ask for a new Language](https://jetpack-io.canny.io/devbox) or [Contribute one via Pull Request](https://github.com/jetpack-io/devbox/tree/main/tmpl)
104+
105+
106+
## Additional commands
107+
108+
`devbox –help` - see all commands
109+
110+
`devbox plan` - see the configuration and steps Devbox will use to generate a container
40111

41112

42113
## Related Work
43114

44-
- [nix](https://nixos.org/)
115+
Thanks to [Nix](https://nixos.org/) for providing isolated shells. Devbox is not affiliated with the NixOS project.
116+
117+
118+
## License
119+
120+
This project is proudly open-source under the [Apache 2.0 License](https://github.com/jetpack-io/devbox/blob/main/LICENSE) Copyright Jetpack Technologies, Inc.

0 commit comments

Comments
 (0)