devlx
devlx is a development tool that provisions temporary development environments. It uses lxd and zfs to make efficient, copy-on-write, workspaces from a user-provided template.
Watch this slightly outdated DEMO VIDEO
Getting Started
- Install LXD
$ snap install lxd- Install devlx
You can install from source by cloning this repo (or your own fork). Alternatively, you can use a pre-built binary available on the releases page.
Create initial configuration
$ devlx initThese commands write $HOME/.config/devlx/devlx.yaml and $HOME/.config/devlx/profiles/*.yaml, which are configuration files and templates and container relation store for your containers for your containers.
Create base LXC Profiles
=======
$ devlx profile -w gui
$ devlx profile -w cliThese commands create the base LXC profiles that devlx needs to provision containers with access to the host.
Create Templates
$ devlx template create guitemplate --profile gui --provisioners vscode
$ devlx template create clitemplate --profile cli --provisioners go,yadmLet's unwrap that:
The name of the template {guitemplate,clitemplate} is totally up to you. These are base images that will be used later to create your containers. You "provision" them by passing in a comma separated list of provisioners, which are bash scripts that install things or otherwise modify the base image. Provisioners live in the ~/.config/devlx/provision directory in your $HOME. They're created once and never again modified by devlx unless you remove the directory and run devlx init again.
The guibase and clibase provisioning templates are automatically applied to gui and cli profiles, you do not need to specify them separately. Use caution in editing these provisioners, as it is possible features installed in these provisioners are expected by devlx.
You can, and should, modify the existing provisioners or create new ones based on your needs.
The profile {gui,cli} is an lxc profile that's stored in ~/.config/devlx/profiles. They're standard lxc profiles that are applied when you create a template, then inherited by every container that's instantiated from those templates.
Create your first container
$ devlx create myproject --template guitemplateThis creates a container called myproject from the template guitemplate, which has X11 and audio support by default.
Connect to your container
$ devlx shell myprojectWhen using the shell (or its alias connect) command, you get dropped into a login shell in the container. You can run commands just like it was an SSH session, and you can open X11 apps which will be displayed on your host's X session. (I KNOW RIGHT??)
Prerequisites
You need a Linux development system, with LXD at a recent version. Developed and tested on Ubuntu 18.10, but LXD targets any Linux installation with a modern kernel.
Installing
Download a Release
When there is one, you can download a release from GitHub.
Build From Source
Requires Go, tested with 1.12beta2.
$ git clone https://github.com/bketelsen/devlx
$ make deps // install dependencies
$ make test // run tests
$ make install // build and install the devlx tool into your pathRunning the tests
$ make testBuilt With
- cobra - The easiest way to make command line tools in Go
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Brian Ketelsen - Initial work - BrianKetelsen.com
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
See SHOULDERS for acknowledgments and thanks to the other projects that devlx was built with.
Special thanks to Simos Xenitellis for the tireless blogging. I learned nearly everything about this process from those posts.