Skip to content

Get started

Baker script is the recipe for your virtual machine. The baker.yml file defines the configuration of your baker environment, for example the ammount of RAM you want to have in your virtual machine; as well as the tools, services, and languages you want installed in the environment.

baker.yml = Baker environment configuration

This configuration in written in YAML format, a human-readable data serialization language. Here is an example baker.yml:

1
2
3
name: baker-example
vm:
  memory: "1024"

By running baker bake, you can create this baker environment and interact with it through it baker ssh. Your current directly on your computer will be accessible inside the baker environment. This allows you to edit/code directly on your computer while still being able to run commands/services in a Baker environment.

Baker environments types

Baker supports several technologies for providing a computing environment; however, we will cover the two main ones here:

  • Baker virtual machines (vms): Baker will use Virtual Box to manage Baker environments. Use vm to enable this type of environment. Baker vms are recommended if you want dedicated resources for a heavy cpu/ram workload, or need access to usb, or other networking devices.

  • Baker containers: Baker will a create light-weight container to manage your Baker environment. Unlike other types of containers, Baker containers can be modified and treated much like a virtual machine. Use container to enable this type of environment. Baker containers with running services can be accessed through ports on your localhost.

Bakelets

Cool. But how do I get tools or programming languages installed in a Baker environment? Bakelets are modules that can be added to a baker environment. There are many modules available, and you can even add your own custom modules.

Here is an example Baker environment with the python bakelet.

1
2
3
4
5
name: baker-example
vm:
  memory: "1024"
lang:
  - python2

But can we do more?

Baker Commands

Imagine your project is using a tool, such as mkdocs, to manage your documentation for your site. You want a way to easy run commands in the Baker environment without having to directly ssh into the environment. With Baker commands, you can add a set of actions that can be performed inside the Baker environment. By default, baker commands will run with the shared project folder as the current working directory.

1
2
3
4
5
6
7
8
9
name: baker-docs
vm: 
  ip: 192.168.22.30
lang:
  - python2
commands:
  build: mkdocs build
  serve: mkdocs serve -a 0.0.0.0:8000
  gh-deploy: mkdocs gh-deploy

For example, by running baker run serve, you will be able to local edit and preview your live documentation site by visiting 192.168.22.30:8000 in your browser.

Check out more examples in the baker-examples github repo.