Bakerx is a front-end for creating and managing (micro) virtual environments. With bakerx you can quickly create a development environments to run you code.
See a running demo below:
$ npm install ottomatica/bakerx -g
Or, for local dev:
git clone https://github.com/ottomatica/bakerx
cd bakerx
npm install
npm link
First, you need to pull an existing virtual machine image from a registry. Registries are basically the assets in a GitHub repository releases. Then you can pull an image by running the following commands:
bakerx pull alpine3.9-simple ottomatica/slim#images
See slim for instructions on how to create and publish an image.
After pulling images, you can create VMs that run those images. Simply run the command below:
bakerx run example_alpine_vm alpine3.9-simple --memory 2048
--memory | -m <AMOUNT>
: set the amount of shared memory with your virtual machine.--ip <IP_ADDRESS>
: configure a host-only interface for the virtual machine, with the specified IP address--sync
: mount a shared folder from your current working directory in/bakerx
inside the virtual machine--up <PATH_TO_SCRIPT>
: execute specified shell script inside the virtual machine after provisioned
Note: you can run
bakerx run --help
to see all CLI arguments and their description.
Finally, after creating the VM, you can ssh to it by running the command below:
bakerx ssh example_alpine_vm
Instead of specifying CLI arguments when creating a VM, you can specify the details in a file called bakerx.yml
, which is useful for storing in SCM:
name: example_alpine_vm
image: alpine3.9-simple
up: | # <--- optional
apk update
apk add ansible
Then from same directory you can run bakerx run
to create you VM.
You can also add multiple Bakerx VMs in bakerx.yml
file, and running bakerx run
will create them for you:
servers:
- name: vm1
image: alpine3.9-simple
- name: vm2
image: alpine3.9-simple