본문 바로가기

좋아하는 것_매직IT/96.IT 핫이슈

Devbox - 격리 쉘/컨테이너를 쉽게 만들어주는 CLI도구를 소개합니다. (github.com/jetpack-io)

반응형

Devbox - 격리 쉘/컨테이너를 쉽게 만들어주는 CLI도구를 소개합니다.  

깃허브페이지에서는 아래와 같이 소개하고 있고요..
Instant, easy, and predictable shells and containers

Devbox is a command-line tool that lets you easily create isolated shells and containers. You start by defining the list of packages required by your development environment, and devbox uses that definition to create an isolated environment just for your application.

한마디로, Devbox 는 격리 쉘/컨테이너를 쉽게 만들어주는 CLI도구라고 머릿속에 넣어두시면 됩니다.

설치와 빠르게 시작하는 방법은 아래와 같고요..

Installing Devbox

In addition to installing Devbox itself, you will need to install nix and docker since Devbox depends on them:

  1. Install Nix Package Manager. (Don't worry, you don't need to learn Nix.)
  2. Install Docker Engine or Docker Desktop. Note that docker is only needed if you want to create containers – the shell functionality works without it.
  3. Install Devbox:
  4. curl -fsSL https://get.jetpack.io/devbox | bash

Quickstart: Fast, Deterministic Shell

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.

  1. Open a terminal in a new empty folder.
  2. Initialize Devbox:This creates a devbox.json file in the current directory. You should commit it to source control.
  3. devbox init
  4. Add command-line tools from Nix Packages. For example, to add Python 3.10:
  5. devbox add python310
  6. Your devbox.json file keeps track of the packages you've added, it should now look like this:
  7. {
       "packages": [
          "python310"
        ]
    }
  8. Start a new shell that has these tools installed:You can tell you’re in a Devbox shell (and not your regular terminal) because the shell prompt and directory changed.
  9. devbox shell
  10. Use your favorite tools.
    python --version
  11. In this example we installed Python 3.10, so let’s use it.
  12. Your regular tools are also available including environment variables and config settings.
  13. git config --get user.name
  14. To exit the Devbox shell and return to your regular shell:
  15. exit

Quickstart: Instant Docker Image

Devbox makes it easy to package your application into an OCI-compliant container image. Devbox analyzes your code, automatically identifies the right toolchain needed by your project, and builds it into a docker image.

  1. Initialize your project with devbox init if you haven't already.
  2. Build the image:The resulting image is named devbox.
  3. devbox build
  4. Tag the image with a more descriptive name:
  5. docker tag devbox my-image:v0.1

Auto-detected languages:

Devbox currently detects the following languages:

  • Go

주요 특징을 정리하자면 아래와 같습니다.

  • 필요한 도구들 리스트를 정하면 그 기반으로 isolated 된 환경을 만들어 줌
    → 내부적으로 Nix 패키지 매니저와 Docker를 활용
  • yarn 같은 패키지 관리자랑 비슷하지만 OS레벨 단위의 패키지를 관리해줌. (devbox.json에 패키지 리스트 저장)

 

그외의 자세한 내용은 아래 깃허브 페이지를 방문해 보시면 좋을것 같네요..

오늘의 블로그는 여기까지고요..
항상 믿고 봐주셔서 감사합니다. 

728x90
300x250