Module docker — Inmanta 2017.2.1 documentation

# Module docker

Module to manage docker based containers

> - License: Apache 2.0
> - Version: 0.4.0
> - Author: Inmanta <code@inmanta.com>
> - Upstream project: https://github.com/inmanta/docker.git

## Entities

entity `docker::Container`

  Parents: `std::Entity`

  A docker container deployed on a container service

  attribute string `memory_limit`='0'

    RAM allocated to the container in human readable format (“128MB”)

  attribute string `entrypoint`=''

    The entrypoint of the container

  attribute bool `detach`=True

    Detach this container when started?

  attribute string `image`

    The image to base this container on

  attribute docker::container_state `state`='running'

    The state of the container

  attribute string `command`=''

    The command to execute

  attribute string `name`

    The name of the docker container

  relation docker::Port `ports` [0:*]

    other end: `docker::Port.container [1]`

  relation docker::Service `service` [1]

    other end: `docker::Service.containers [0:*]`

  relation docker::Volume `volumes` [0:*]

    other end: `docker::Volume.container [1]`

  The following implements statements select implementations for this entity:

  > - `std::none`

entity `docker::Port`

  Parents: `std::Entity`

  A portmapping between the container and the host

  attribute ip::port `host_port`
  attribute ip::port `container_port`
  attribute ip::ip `host_ip`='0.0.0.0'
  relation docker::Container `container` [1]

    other end: `docker::Container.ports [0:*]`

entity `docker::Registry`

  Parents: `ip::services::Server`

  Deploy a docker registry

  The following implementations are defined for this entity:

  > - `docker::dockerRegistry`

  The following implements statements select implementations for this entity:

  > - `docker::dockerRegistry`

entity `docker::Service`

  Parents: `ip::services::Server`

  A docker service

  attribute ip::cidr `bridge_ip`='172.17.0.1/16'
  relation docker::Container `containers` [0:*]

    other end: `docker::Container.service [1]`

  The following implementations are defined for this entity:

  > - `docker::docker`

  The following implements statements select implementations for this entity:

  > - `docker::docker`

entity `docker::Volume`

  Parents: `std::Entity`

  A volume mounted from the host into the container

  attribute string `host_path`
  attribute string `container_path`
  attribute string `options`='rw'
  relation docker::Container `container` [1]

    other end: `docker::Container.volumes [0:*]`

## Implementations

implementation `docker::docker`

implementation `docker::dockerRegistry`

## Resources

class `docker.` `Container`

  > This class represents a docker container

  - Resource for entity `docker::Container`
  - Id attribute `name`
  - Agent name `service.host.name`
  - Handlers `docker.ContainerHandler`

## Handlers

class `docker.` `ContainerHandler`
  - Handler name `docker`
  - Handler for entity `docker::Container`