Charm box is a container project that provides a Juju Charm development environment. The charmbox container includes tools for building, testing, and reviewing Juju Charms.
Juju is an open source, universal model for applications. Juju allows you to deploy, configure, manage, maintain, and scale cloud services quickly and efficiently on public clouds, as well as on physical servers.
This container comes with the basic tools you need to get started with Juju and Charms. It includes charm-tools to build charms and bundletester to test charms.
This container is built on top of the jujubox container, adding tools and functionality. Refer to the jujubox project for more information about the options to run that container and the volumes available.
To use this container you need to install Docker, download charmbox, and run charmbox.
Install Docker using the package manager for your Linux distribution, or get.docker.com. We recommend Docker version 1.6 or greater.
There are several ways to install Docker on Mac OS X. Consult the latest documentation on Getting Started with Docker for Mac.
The easiest way to use charmbox is to simply pull the container from the Docker hub.
docker pull jujusolutions/charmbox
If you want to see the code you can download the charmbox project from github and build it from source.
git clone https://github.com/juju-solutions/charmbox.git && cd charmbox
docker build -t jujusolutions/charmbox ./
There are several different ways to run charmbox depending on what you are trying to accomplish.
The main use case for charm box is to build charms from layers and interfaces. By using charmbox you do not need to install and configure the tools.
As with jujubox you should volume mount (-v) $JUJU_DATA
directory from the
host to the charmbox container so you preserve the Juju information between
runs. The output from a charm build will be in /home/ubuntu/charms/
so mount
the $JUJU_REPOSITORY
directory to preserve the built artifacts. To have
access to the layers and interfaces, mount the $CHARM_LAYERS_DIR
and
$CHARM_INTERFACES_DIR
from the host to the charmbox container. Remember the
charmbox file system is reset after you exit the container.
docker run --rm -it \
-v $JUJU_DATA:/home/ubuntu/.local/share/juju \
-v $JUJU_REPOSITORY:/home/ubuntu/charms \
-v $CHARM_LAYERS_DIR:/home/ubuntu/charms/layers \
-v $CHARM_INTERFACES_DIR:/home/ubuntu/charms/interfaces \
jujusolutions/charmbox
Another use case for charmbox is to use the test tools included. In this case
you may need to mount the charm or bundle directory and run the bundletester
tool. You can map the current workign directory into charmbox for testing
a bundle or charm.
docker run --rm -it \
-v $JUJU_DATA:/home/ubuntu/.local/share/juju \
-v $JUJU_REPOSITORY:/home/ubuntu/charms \
-v $PWD:/home/ubuntu/pwd \
jujusolutions/charmbox
See the Environment Variables
reference
for more details on $JUJU_DATA
, $JUJU_REPOSITORY
, $CHARM_LAYERS_DIR
and
$CHARM_INTERFACES_DIR
.
At this time you can not run charmbox with the LXD provider inside of Docker because of some nested container issues. If you want to use the LXD provider, install Juju and LXD on the host system.
For more information about what you can do in charmbox check out the Juju documenation.
If you find any bugs please create an issue in the charmbox github repository.