|
1 |
| -# Devbox: Instant development environments and containers using `nix`. |
| 1 | +# Devbox: instant, easy and predictable development environments. |
2 | 2 |
|
3 |
| -Devbox is a tool that lets you easily manage development environments. |
| 3 | +[](https://github.com/jetpack-io/devbox/actions/workflows/release.yml) |
| 4 | + |
4 | 5 |
|
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. |
8 | 7 |
|
9 |
| -## Quickstart |
| 8 | +Want to try out a tool but don’t want the mess? Add it to a Devbox shell. |
10 | 9 |
|
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> |
15 | 11 |
|
16 |
| -Add [Nix Packages](https://search.nixos.org/packages) to your project |
17 |
| -```bash |
18 |
| -devbox add goreleaser |
19 |
| -``` |
| 12 | +## Compatibility |
20 | 13 |
|
21 |
| -Start a local development shell with your project and packages |
22 |
| -```bash |
23 |
| -devbox shell |
24 |
| -``` |
| 14 | +Devbox works on: |
25 | 15 |
|
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 |
31 | 19 |
|
32 |
| -Devbox can detect and automatically configure shells + Docker containers for your language. |
33 | 20 |
|
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 |
40 | 111 |
|
41 | 112 |
|
42 | 113 | ## Related Work
|
43 | 114 |
|
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