8000 GitHub - Thesola10/box-direnv: direnv integration for Distrobox/Toolbx!
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Thesola10/box-direnv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

box-direnv

A wrapper around distrobox or toolbox to provide commands which exist in a dev container, in the host environment transparently.

Heavily inspired by nix-direnv.

Installation

Put the following lines in your .envrc:

if ! has box_direnv_version || ! box_direnv_version 0.1.0; then
  source_url "https://raw.githubusercontent.com/thesola10/box-direnv/0.1.0/direnvrc" "sha256-pznp4/w7UzNAqreaLuGgq4/CTFjMedC376xnIWr5s+U="
fi

Usage example

box-direnv supports a few scenarios, depending on the parameters given:

Distrobox's distrobox.ini (recommended)

Create a distrobox.ini file in your project root, which will describe the Distrobox container providing your environment, then add the line use distrobox:

$ echo "use distrobox" >> .envrc
$ direnv allow

Optionally, you can specify a box name:

$ echo "use distrobox my_box" >> .envrc
$ direnv allow

From image registry

Add the line use distrobox <image> or use toolbox <image> to tell box-direnv to create a container from that image. For example:

$ echo "use distrobox registry.fedoraproject.org/fedora-toolbox"
$ direnv allow

From local Dockerfile/Containerfile

You may wish to customize your container image before entering the environment. In this case, you can tell box-direnv to use a local build context directly.

Add the line use distrobox <path to Containerfile> or use toolbox <path to Containerfile> to tell box-direnv to build an image from that directory, then use it to create the container. For example:

$ echo "use toolbox ./docker"
$ direnv allow

About

direnv integration for Distrobox/Toolbx!

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0