Forge Home

docker

Handle docker containers as services in RHEL.

10,620 downloads

10,620 latest version

2.5 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.1.0 (latest)
released Oct 30th 2014
This version is compatible with:

Start using this module

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

Add this module to your Puppetfile:

mod 'akegata-docker', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add akegata-docker
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install akegata-docker --version 0.1.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

akegata/docker — version 0.1.0 Oct 30th 2014

docker

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with docker
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module
  8. Contact

Overview

Manage docker instances with hiera in RHEL/CentOS.

Module Description

Creates systemd or init services (depending on RHEL version) for containers specified in hiera.

Setup

What docker affects

On RHEL/CentOS 7, this module installs docker 1.3.0 from binary, since RHEL/CentOS 7 repos provide a very old docker version.

Beginning with docker

Install the docker module: puppet module install akegata-docker

Add the docker class in hiera: classes

  - docker

Usage

Set up docker containers in hiera: docker::container: apache: repository: 'akegata/apache2' envs:

      - 'APACHE_USER=apache'
    ports:
      - '8080:80'
    volumes:
      - '/var/www/httpd:/var/www/httpd/'

The following parameters are available:

  • repository - Name of the repository on docker hub to use (mandatory)
  • envs - Environmental variables (optional)
  • ports - Ports to publish to the host (optional)
  • volumes - Volumes to bind mount (optional)
  • options - Other options to pass to docker run (optional)

Reference

Contains a single class: docker. A define called docker::container is created, which can be called through hiera as described in Usage.

On RHEL/CentOS 7, the module copies the following folders onto the system (they are taken from the CentOS 6.5 docker RPM):

  • /usr/bin/docker
  • /usr/lib/systemd/system/docker.service
  • /usr/lib/systemd/system/docker.socket
  • /etc/bash_completion.d/docker.bash
  • /usr/share/vim/vimfiles/syntax/dockerfile.vim
  • /usr/share/vim/vimfiles/ftdetect/dockerfile.vim
  • /usr/share/vim/vimfiles/doc/dockerfile.txt

Limitations

Tested on puppet 3.7.1 with hiera 1.3.4 on CentOS 6 and 7.

Contact

Martin Hovmöller akegata@gmail.com