1
# Charm Layer for Docker
3
This repository contains the Charm layer for docker, which can be used as a
4
base layer for other Charms that use docker. Please refer to the
5
[Juju composer docs](https://jujucharms.com/docs/devel/authors-charm-composing).
9
In a charm that wants to use docker, the integration can be as simple as placing
10
the following in your charm's `compose.yaml`:
12
includes: ['layer:docker']
14
From here, you simply amend any hooks/reactive patterns you require to deliver
15
and manage the lifecycle of your applications docker image.
19
The docker layer raises a few synthetic events:
27
When docker.ready is set, this event is before we signify to other
28
layers that we are ready to start workloads, which should allow for
29
docker extensions to be installed free of disrupting active workloads.
31
For example, installing SDN support and getting the daemon configured
36
def start_flannel_networking():
40
##### docker.available
42
When docker.available is set, the daemon is considered fully configured
43
and ready to accept workloads.
46
@when('docker.available')
47
def start_my_workload():
48
# do something with docker
53
This layer installs the 'docker-compose' python package from pypi. So
54
once the Docker layer is installed you have the ability to use [Docker
55
Compose](https://docs.docker.com/compose/) functionality such as control files,
59
The charm supports altering the GRUB2 options enabling CGROUPS and memory
60
accounting. Changing this value will reboot the host, and any running workloads
61
are at the mercy of the charm author inheriting from this charm. Please use
62
`--restart=always` on your container runs that need to be persistent.
66
This layer also includes a wheelhouse of `charms.docker` a python library to make
67
charming with docker, and configuring the docker daemon much easier, and syntactically
68
enjoyable. For more information about this library see the [project](http://github.com/juju-solutions/charms.docker)
72
This charm contains a slightly modified copy of the script contained at:
73
[https://get.docker.io](https://get.docker.io)
75
The modifications were raising status messages for Juju so its apparent what is
76
happening to the end user following along with Juju's extended status feature.