|
1 | 1 | # Charm Box
|
2 | 2 |
|
3 | 3 | Charm box is a container project that provides a [Juju](https://jujucharms.com)
|
4 |
| -[Charm](https://jujucharms.com/docs/stable/charms) development environment. The |
5 |
| -charmbox container includes tools for building, testing, and reviewing Juju |
6 |
| -Charms. |
| 4 | +[Charm](https://docs.jujucharms.com/applications-and-charms) development |
| 5 | +environment. The charmbox container includes tools for building, testing, and |
| 6 | +reviewing Juju Charms. |
7 | 7 |
|
8 |
| -Juju is an open source, universal model for applications. Juju allows you to |
9 |
| -deploy, configure, manage, maintain, and scale cloud services quickly and |
| 8 | +Juju is an open source, universal model for applications. Juju allows you to |
| 9 | +deploy, configure, manage, maintain, and scale cloud services quickly and |
10 | 10 | efficiently on public clouds, as well as on physical servers.
|
11 | 11 |
|
12 | 12 | This container comes with the basic tools you need to get started with Juju and
|
13 |
| -Charms. It includes [charm-tools](https://github.com/juju/charm-tools) to |
| 13 | +Charms. It includes [charm-tools](https://github.com/juju/charm-tools) to |
14 | 14 | build charms and [bundletester](https://github.com/juju-solutions/bundletester)
|
15 | 15 | to test charms.
|
16 | 16 |
|
17 | 17 | This container is built on top of the
|
18 | 18 | [jujubox](https://github.com/juju-solutions/jujubox) container, adding tools
|
19 |
| -and functionality. Refer to the jujubox project for more information about the |
| 19 | +and functionality. Refer to the jujubox project for more information about the |
20 | 20 | options to run that container and the volumes available.
|
21 | 21 |
|
22 | 22 | To use this container you need to install Docker, download charmbox, and run
|
23 |
| -charmbox. |
| 23 | +charmbox. |
24 | 24 |
|
25 |
| -# Install Docker |
| 25 | +## Install Docker |
| 26 | + |
| 27 | +### Linux |
26 | 28 |
|
27 |
| -## Linux |
28 | 29 | Install Docker using the package manager for your Linux distribution, or
|
29 | 30 | [get.docker.com](https://get.docker.com/). We recommend Docker version 1.6 or
|
30 | 31 | greater.
|
31 | 32 |
|
32 |
| -## Mac OS X |
| 33 | +### Mac OS X |
33 | 34 |
|
34 | 35 | There are several ways to
|
35 |
| -[install Docker on Mac OS X](https://docs.docker.com/engine/installation/mac/). |
| 36 | +[install Docker on Mac OS X](https://docs.docker.com/engine/installation/mac/). |
36 | 37 | Consult the latest documentation on
|
37 | 38 | [Getting Started with Docker for Mac](https://docs.docker.com/docker-for-mac/).
|
38 | 39 |
|
39 |
| -# Download charmbox |
| 40 | +## Download charmbox |
40 | 41 |
|
41 | 42 | The easiest way to use charmbox is to simply pull the container from the
|
42 | 43 | [Docker hub](https://registry.hub.docker.com/u/jujusolutions/charmbox/).
|
43 | 44 |
|
44 |
| -``` |
| 45 | +```bash |
45 | 46 | docker pull jujusolutions/charmbox
|
46 | 47 | ```
|
47 | 48 |
|
48 |
| -If you want to see the code you can download the charmbox project from |
| 49 | +If you want to see the code you can download the charmbox project from |
49 | 50 | [github](https://github.com/juju-solutions/charmbox) and build it from source.
|
50 | 51 |
|
51 |
| -``` |
| 52 | +```bash |
52 | 53 | git clone https://github.com/juju-solutions/charmbox.git && cd charmbox
|
53 | 54 | docker build -t jujusolutions/charmbox ./
|
54 | 55 | ```
|
55 | 56 |
|
56 |
| -# Run charmbox |
| 57 | +## Run charmbox |
57 | 58 |
|
58 |
| -There are several different ways to run charmbox depending on what you are |
59 |
| -trying to accomplish. |
| 59 | +There are several different ways to run charmbox depending on what you are |
| 60 | +trying to accomplish. |
60 | 61 |
|
61 |
| -## Running charmbox to build Charms |
| 62 | +### Build Charms |
62 | 63 |
|
63 | 64 | The main use case for charm box is to build charms from layers and interfaces.
|
64 | 65 | By using charmbox you do not need to install and configure the tools.
|
65 | 66 |
|
66 |
| -As with jujubox you should volume mount (-v) `$JUJU_DATA` directory from the |
67 |
| -host to the charmbox container so you preserve the Juju information between |
| 67 | +As with jujubox you should volume mount (-v) `$JUJU_DATA` directory from the |
| 68 | +host to the charmbox container so you preserve the Juju information between |
68 | 69 | runs. The output from a charm build will be in `/home/ubuntu/charms/` so mount
|
69 |
| -the `$JUJU_REPOSITORY` directory to preserve the built artifacts. To have |
70 |
| -access to the layers and interfaces, mount the `$LAYER_PATH` and |
71 |
| -`$INTERFACE_PATH` from the host to the charmbox container. Remember the |
| 70 | +the `$JUJU_REPOSITORY` directory to preserve the built artifacts. To have |
| 71 | +access to the layers and interfaces, mount the `$CHARM_LAYERS_DIR` and |
| 72 | +`$CHARM_INTERFACES_DIR` from the host to the charmbox container. Remember the |
72 | 73 | charmbox file system is reset after you exit the container.
|
73 | 74 |
|
74 |
| -``` |
| 75 | +```bash |
75 | 76 | docker run --rm -it \
|
76 | 77 | -v $JUJU_DATA:/home/ubuntu/.local/share/juju \
|
77 | 78 | -v $JUJU_REPOSITORY:/home/ubuntu/charms \
|
78 |
| - -v $LAYER_PATH:/home/ubuntu/charms/layers \ |
79 |
| - -v $INTERFACE_PATH:/home/ubuntu/charms/interfaces \ |
| 79 | + -v $CHARM_LAYERS_DIR:/home/ubuntu/charms/layers \ |
| 80 | + -v $CHARM_INTERFACES_DIR:/home/ubuntu/charms/interfaces \ |
80 | 81 | jujusolutions/charmbox
|
81 | 82 | ```
|
82 | 83 |
|
83 |
| -## Running charmbox to test Charms |
| 84 | +### Test Charms |
84 | 85 |
|
85 | 86 | Another use case for charmbox is to use the test tools included. In this case
|
86 | 87 | you may need to mount the charm or bundle directory and run the `bundletester`
|
87 | 88 | tool. You can map the current workign directory into charmbox for testing
|
88 | 89 | a bundle or charm.
|
89 | 90 |
|
90 |
| -``` |
| 91 | +```bash |
91 | 92 | docker run --rm -it \
|
92 | 93 | -v $JUJU_DATA:/home/ubuntu/.local/share/juju \
|
93 | 94 | -v $JUJU_REPOSITORY:/home/ubuntu/charms \
|
94 | 95 | -v $PWD:/home/ubuntu/pwd \
|
95 | 96 | jujusolutions/charmbox
|
96 | 97 | ```
|
97 | 98 |
|
98 |
| -See the Environment Variables |
99 |
| -[reference](https://jujucharms.com/docs/2.0/reference-environment-variables) |
100 |
| -for more details on `$JUJU_DATA`, `$JUJU_REPOSITORY`, `$LAYER_PATH` and |
101 |
| -`$INTERFACE_PATH` . |
| 99 | +See the Environment Variables |
| 100 | +[reference](https://docs.jujucharms.com/juju-environment-variables) |
| 101 | +for more details on `$JUJU_DATA`, `$JUJU_REPOSITORY`, `$CHARM_LAYERS_DIR` and |
| 102 | +`$CHARM_INTERFACES_DIR`. |
102 | 103 |
|
103 | 104 | ## charmbox and the LXD provider
|
104 | 105 |
|
105 |
| -At this time you can not run charmbox on the LXD provider inside of Docker |
106 |
| -because of some nested container issues. If you want to use the LXD provider |
| 106 | +At this time you can not run charmbox with the LXD provider inside of Docker |
| 107 | +because of some nested container issues. If you want to use the LXD provider, |
107 | 108 | install Juju and LXD on the host system.
|
108 | 109 |
|
109 |
| -# More information |
| 110 | +## More information |
110 | 111 |
|
111 |
| -For more information about what you can do in charmbox check out the |
112 |
| -[Juju documenation](https://jujucharms.com/docs). |
| 112 | +For more information about what you can do in charmbox check out the |
| 113 | +[Juju documenation](https://docs.jujucharms.com/). |
113 | 114 |
|
114 |
| -If you find any bugs please create an issue in the |
115 |
| -[jujubox github repository](https://github.com/juju-solutions/charmbox/issues). |
| 115 | +If you find any bugs please create an issue in the |
| 116 | +[charmbox github repository](https://github.com/juju-solutions/charmbox/issues). |