Forge Home

docker_compose

Docker_compose is a module for simple patterns of docker container management and orchestration.

2,209 downloads

990 latest version

3.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.5.0 (latest)
  • 0.4.0
  • 0.3.0
  • 0.2.0
  • 0.1.0
released Apr 8th 2021
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'arrnorets-docker_compose', '0.5.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add arrnorets-docker_compose
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install arrnorets-docker_compose --version 0.5.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

arrnorets/docker_compose — version 0.5.0 Apr 8th 2021

Table of contents

  1. Common purpose
  2. Compatibility
  3. Installation
  4. Config example in Hiera and result files

1. Common purpose

Docker_compose is a module for simple patterns of docker container management ansd orchestration. See here

2. Compatibility

This module was tested on CentOS 7. It also should work on Fedora 19 and higher and RHEL 7, but no tests were performed.

3. Installation

mod 'docker_compose',
    :git => 'https://github.com/arrnorets/puppet-docker_compose.git',
    :ref => 'main'

4. Config example in Hiera and result files

This module follows the concept of so called "XaaH in Puppet". The principles are described here and here.

Here is the example of config in Hiera:

docker_compose:
  docker_compose_pkg_version: "1.8.0-2"
  docker_pkg_version: "5:19.03.12~3-0~raspbian-stretch"

  docker_username: "pi"

  enable: true

  # // Config.json data starts here
  docker_config_json:
    confdir: "/root/.docker" # Directory where config.json file is stored

    # The config definition itself - see https://docs.docker.com/engine/reference/commandline/cli/#configjson-properties for available options
    config:
      auths:
        "registry.local":
          auth: <Insert your auth data here - normally it is a token >
      HttpHeaders:
        "User-Agent": "Docker-Client/19.03.12 (linux)"
  # /* END BLOCK */

  config:
    home_resources:
      version: '2'
      services:
        memcached:
          image: alpine_memcached:1.0
          container_name: memcached

It will produce file /opt/docker-compose/home_resources/docker-compose.yml:

---
version: '2'
services:
  memcached:
    image: alpine_memcached:1.0
    container_name: memcached

Also it will produce /root/.docker/config.json file in the following format:

[root@dockertest ~]# cat /root/.docker/config.json | jq
{
  "auths": {
    "registry.local": {
      "auth": "<Insert your auth data here - normally it is a token >"
    }
  },
  "HttpHeaders": {
    "User-Agent": "Docker-Client/19.03.12 (linux)"
  }
}

also the corresponding docker-compose@home_resources.service will be enabled.