• This repository has been archived on 23/Aug/2019
  • Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    Ruby
  • License
    Other
  • Created over 8 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dockerfiles and build toolchain for Puppet software

!! NOTE !! This repository is deprecated! We're still maintaining Puppetserver, PuppetDB, and r10k images, but the build information has moved to the individual project repos at:

Build Status

Puppet-in-Docker

A series of Dockerfiles, and the associated build toolchain, for building Docker images containing Puppet and related software.

Experimental

This approach to packaging Puppet software is experimental. The resulting images are not a supported way of running Puppet or Puppet Enterprise and are likely to change quickly based on feedback from users. Please do try them out and let us know what you think.

Description

You can copy the individual Dockerfiles in this repo and use them locally for your own purposes. They were created following current Docker best practices, and can be good starting points for custom images.

If you do find yourself customizing these images, please open issues describing why and whether your use is something that could be handled in these images.

You can find published versions of these images on Docker Hub:

Image usage

You can use the images for standing up various Puppet applications on Docker. For a complete set of examples see the Puppet in Docker examples repository.

As an example, first we'll create a Docker network. For the purposes of this demonstration, we're using the network and service discovery features added in Docker 1.11.

docker network create puppet

Then we can run a copy of Puppet Server. In the below code, standalone means that this image does not automatically connect to PuppetDB. That's fine for this simple demo, but in other cases you might prefer the puppet/puppetserver image.

docker run --net puppet --name puppet --hostname puppet puppet/puppetserver-standalone

This boots the container and, becuase we're running in the foreground, it prints lots of output to the console. After this is running, we can run a Puppet agent in another container.

docker run --net puppet puppet/puppet-agent-ubuntu

This connects to the Puppet Server, applies the resulting catalog, prints a summary, and then exits. That's not very useful apart from development purposes, but this is just a basic demonstration. See the above examples repository for fuller examples, or consider:

Running periodically

The above example runs with the onetime flag, which means that Puppet exits after the first run. The container can be run with any arbitrary Puppet commands, such as:

docker run --net puppet puppet/puppet-agent-ubuntu agent --verbose --no-daemonize --summarize

This container won't exit, and instead applies Puppet every 30 minutes based on the latest content from the Puppet Server.

Puppet resource

You can also use other Puppet commands, such as resource. For instance, the following command lists all of the packages installed on the image.

docker run puppet/puppet-agent-ubuntu resource package --param provider

To find out about the packages installed on the host, rather than in the container, mount in various folder from the host like so.

docker run --privileged -v /tmp:/tmp --net host -v /etc:/etc -v /var:/var -v /usr:/usr -v lib64:/lib64 puppet/puppet-agent-ubuntu resource package

The same approach works with the Facter image as well.

docker run --privileged -v /tmp:/tmp --net host -v /etc:/etc -v /var:/var -v /usr:/usr -v lib64:/lib64 puppet/facter os

API

The resulting images expose a label-based API for gathering information about the image or for use in further automation. For example:

$ docker inspect -f "{{json .Config.Labels }}" puppet/puppet-agent-ubuntu | jq
{
  "org.label-schema.dockerfile": "/Dockerfile",
  "org.label-schema.maintainer": "Puppet Release Team <[email protected]>",
  "org.label-schema.build-date": "2018-05-09T20:06:11Z",
  "org.label-schema.license": "Apache-2.0",
  "org.label-schema.name": "Puppet Agent (Ubuntu)",
  "org.label-schema.schema-version": "1.0",
  "org.label-schema.url": "https://github.com/puppetlabs/puppet-in-docker",
  "org.label-schema.vcs-ref": "b75674e1fbf52f7821f7900ab22a19f1a10cafdb",
  "org.label-schema.vcs-url": "https://github.com/puppetlabs/puppet-in-docker",
  "org.label-schema.vendor": "Puppet",
  "org.label-schema.version": "5.5.1"
}

Please suggest other standard fields for inclusion in the API. Over time, a formal specification may be created, along with further tooling, but this is an experimental feature.

Toolchain

The repository contains a range of tools for managing the set of Dockerfiles and the resulting images. For instance, you can list the images available.

Note that using the toolchain requires a Ruby environment and Bundler. You'll also need a local Docker installation.

$ bundle install
...
$ bundle exec rake list
NAME                    | VERSION | FROM                                 | SHA                                      | BUILD                | MAINTAINER
------------------------|---------|--------------------------------------|------------------------------------------|----------------------|-------------------------------------
facter                  | 1.5.0   | puppet/puppet-agent-ubuntu:1.5.0     | 97475979ffe252d33a9df67524b5aa313022cb05 | 2016-05-20T10:01:19Z | Gareth Rushgrove "[email protected]"
puppet-agent-alpine     | 4.4.2   | alpine:3.3                           | 97475979ffe252d33a9df67524b5aa313022cb05 | 2016-05-20T10:01:19Z | Gareth Rushgrove "[email protected]"
puppet-agent-ubuntu     | 1.5.0   | ubuntu:16.04                         | 97475979ffe252d33a9df67524b5aa313022cb05 | 2016-05-20T10:01:19Z | Gareth Rushgrove "[email protected]"
puppetboard             | 0.1.3   | alpine:3.3                           | 97475979ffe252d33a9df67524b5aa313022cb05 | 2016-05-20T10:01:19Z | Gareth Rushgrove "[email protected]"
puppetdb                | 4.1.0   | ubuntu:16.04                         | 97475979ffe252d33a9df67524b5aa313022cb05 | 2016-05-20T10:01:19Z | Gareth Rushgrove "[email protected]"
puppetdb-postgres       | 0.1.0   | postgres:9.5.2                       | 97475979ffe252d33a9df67524b5aa313022cb05 | 2016-05-20T10:01:19Z | Gareth Rushgrove "[email protected]"
puppetserver            | 2.3.2   | puppet/puppetserver-standalone:2.4.0 | 161bca4fed59997fd19581df38678caeefe813bc | 2016-05-16T08:05:27Z | Gareth Rushgrove "[email protected]"
puppetserver-standalone | 2.4.0   | ubuntu:16.04                         | 97475979ffe252d33a9df67524b5aa313022cb05 | 2016-05-20T10:01:19Z | Gareth Rushgrove "[email protected]"

Building images

The following command builds the puppet-agent-alpine image. You can find the relevant Dockerfile in the directory of the same name.

$ bundle exec rake puppet-agent-alpine:build

This is a simple interface to run docker build and creates both a latest and a versioned Docker image in your local repository.

Testing images

The repository provides two types of tests:

  1. Validation of the Dockerfile using Hadolint
  2. Acceptance tests of the image using ServerSpec

These can be run individually or together. To run them together, use the following command.

$ bundle exec rake puppet-agent-alpine:test

Additional commands

The included toolchain allows you to run lint checks, bump version information, run acceptance tests, build, and then publish the resulting Docker images. You can access the toolchain with rake.

$ bundle exec rake -T
rake all                          # Run all for all images in repository in parallel
rake build                        # Run build for all images in repository in parallel
rake lint                         # Run lint for all images in repository in parallel
rake publish                      # Run publish for all images in repository in parallel
rake puppet-agent-alpine:build    # Build docker image
rake puppet-agent-alpine:lint     # Run Hadolint against the Dockerfile
rake puppet-agent-alpine:publish  # Publish docker image
rake puppet-agent-alpine:rev      # Update Dockerfile label content for new version
rake puppet-agent-alpine:spec     # Run RSpec code examples
rake puppet-agent-ubuntu:build    # Build docker image
rake puppet-agent-ubuntu:lint     # Run Hadolint against the Dockerfile
rake puppet-agent-ubuntu:publish  # Publish docker image
rake puppet-agent-ubuntu:rev      # Update Dockerfile label content for new version
rake puppet-agent-ubuntu:spec     # Run RSpec code examples
...
rake test                         # Run test for all images in repository in parallel
rake rev                          # Run rev for all images in repository in parallel
rake rubocop                      # Run RuboCop
rake rubocop:auto_correct         # Auto-correct RuboCop offenses
rake spec                         # Run spec for all images in repository in parallel
rake test                         # Run test for all images in repository in parallel

Adding additional images

To add additional images to the repository, create a folder in the root of the repository and include in that folder a standard Dockerfile. The above commands should auto-discover the new image. We recommend that you also include a spec folder containing tests verifying the image's behavior. See examples in the other folders for help getting started. Please suggest new images via pull request.

Maintainers

This repository is maintained by the Puppet Release Engineering team [email protected].

Individual images may have separate maintainers as mentioned in the relevant Dockerfiles.

Issues

File issues and feature requests in the Community Package Repository (CPR) project with the 'Container' component.

More Repositories

1

razor-server

Razor is next generation provisioning software that handles bare metal hardware and virtual server provisioning
Ruby
512
star
2

lumogon

Get a complete picture of what your applications are made of *without* changing how you currently build and run containers. Just run and report.
Go
198
star
3

puppetlabs-aws

Puppet module for managing AWS resources to build out infrastructure
Ruby
188
star
4

wash

Wide Area SHell: a cloud-native shell for bringing remote infrastructure to your terminal.
Go
180
star
5

puppet-in-docker-examples

Examples to accompany the Puppet-in-Docker images
Ruby
136
star
6

puppetlabs-cloud_provisioner

Puppet Cloudpack
Ruby
105
star
7

puppet-module-tool

DEPRECATED: the tool has been moved into core as of Puppet 2.7.12 and will no longer be maintained here. Raise bugs for the new tool in the project below under the category 'module tool'.
Ruby
101
star
8

puppetlabs-openstack

Puppet Labs Reference and Testing Deployment Module for OpenStack (master tracks Kilo)
Puppet
91
star
9

puppetlabs-dsc

Puppet module for PowerShell Desired State Configuration (DSC) integration
C#
69
star
10

puppetlabs-image_build

Build Docker images from Puppet code
Ruby
67
star
11

libral

A native Resource Abstraction Layer
C++
59
star
12

geppetto

Geppetto is an integrated toolset for developing Puppet modules and manifests.
Java
58
star
13

puppetlabs-git

module for installing git
Ruby
48
star
14

puppetlabs-razor

Puppet module to install Razor.
Puppet
46
star
15

puppet-quest-guide

Quest Guide for the Puppet Learning VM
Ruby
44
star
16

puppetlabs-ruby

Ruby
38
star
17

razor-el-mk

The discovery kernel for razor-server
Ruby
37
star
18

puppetlabs-certregen

Regenerate expiring Puppet certificates
Ruby
35
star
19

puppetcpp

A prototype Puppet compiler written in C++
C++
34
star
20

puppetlabs-cloudformation

CoudFormation template for installing PE
Ruby
32
star
21

pe-razor-vagrant-stack

This is a vagrant stack for testing Razor in PE
Puppet
27
star
22

puppetlabs-passenger

Puppet Labs Module for Passenger
Puppet
27
star
23

puppetlabs-libvirt

libvirt Puppet Module
Ruby
24
star
24

puppetlabs-activemq

Puppet ActiveMQ Module
Shell
24
star
25

puppetlabs-opennebula

OpenNebula Puppet Module
Ruby
24
star
26

puppetlabs-node_openstack

puppet cloud provisioner support for openstack
Ruby
23
star
27

puppetlabs-remote_resource

A simple way of providing dependencies on remote resources
Ruby
23
star
28

quest

Quest-driven learning with RSpec
Ruby
21
star
29

pct

Puppet Content Templates
Go
20
star
30

puppetlabs-dism

Ruby
18
star
31

rspec-system-serverspec

Couplings for rspec-system and serverspec
Ruby
17
star
32

razor-client

Command line client for razor-server
Ruby
17
star
33

pltraining-classroom

Classroom module for Puppetlabs Training courses. Not intended for general use.
Puppet
17
star
34

ultipro-soap-python

Python wrapper for the UltiPro SOAP API
Python
17
star
35

puppetlabs-stunnel

A stunnel module.
Puppet
16
star
36

puppetlabs-havana

Multi-node deployment for OpenStack Havana
Puppet
16
star
37

puppetlabs-shell

Puppet Shell - this tool is pre-release - use at your own risk!
Ruby
16
star
38

puppetlabs-mount_providers

New mount types/providers splitting fstab and actual mounts into separate types.
Ruby
16
star
39

py-awsaudit

Custom Python library that we use to audit our EC2 usage
Python
16
star
40

puppetlabs-vcenter

VMware vCenter management
Ruby
16
star
41

puppetlabs-netscaler

Puppet module for automating the configuration of Citrix Netscaler devices
Ruby
16
star
42

puppetlabs-gce_compute

native types for managing google compute instances
Ruby
16
star
43

puppetlabs-tftp

Ruby
15
star
44

puppetlabs-catalog_preview

A Puppet module providing catalog preview and migration features
Ruby
15
star
45

puppet-webhooks

Sinatra service for GitHub WebHooks
Ruby
15
star
46

Naginator

A Ruby parser and generator for Nagios
Ruby
15
star
47

puppetlabs-rpmbuilder

Puppet module to quickly and painlessly equip a host to build RPM packages
HTML
15
star
48

puppetlabs-netapp

Ruby
14
star
49

puppetlabs-limits

Module for managing pam limits in /etc/security/limits.conf
Puppet
14
star
50

puppetlabs-debbuilder

Module to build a debian package builder
Puppet
14
star
51

puppetlabs-inventory

outputs a data structure describing properties of the system on which it's run
Ruby
12
star
52

puppetlabs-rancher

Puppet module for installing Rancher Server and Agent
Ruby
12
star
53

lein-ubersource

A leiningen plugin that attempts to download all of the source code for all of a project's (transitive) dependencies
Clojure
12
star
54

puppetlabs-package_updates

Package update discovery Puppet Face and custom Facter fact
Ruby
12
star
55

pdk-planning

A repository of roadmaps, feature proposals, and other planning resources for the Puppet Development Kit
PowerShell
11
star
56

puppetlabs-sqlite

SQLite module to manage sqlite installation and database management
Puppet
10
star
57

puppetlabs-logentries

Installs the logentries agent
Puppet
9
star
58

puppetlabs-azure

Types and Providers to manage Azure resources with Puppet
Ruby
9
star
59

cljs-dashboard-widgets

A library of clojurescript widgets and utility code, intended for use in building developer / metrics dashboards.
Clojure
8
star
60

vmpooler-client

Python
7
star
61

beaker-testmode_switcher

run your puppet module tests in master/agent, apply or local mode
Ruby
7
star
62

crossfader

Project to provide pre-compiled ruby versions for developers
C
7
star
63

puppetdb-javaclient

new Java client for PuppetDB
Java
6
star
64

puppetlabs-cve20113872

Puppet Module to help fix and migrate a Puppet deployment (CVE-2011-3872)
Ruby
6
star
65

puppetlabs-vswitch

RedHat-OpenStack VSwitch Module
Ruby
6
star
66

puppetlabs-ldap_entry

Manages the creation, deletion, and synchronization of entries in an LDAP database.
Ruby
6
star
67

mcollective-zeromq-connector

0MQ connector for MCollective
Ruby
5
star
68

puppetlabs-openstack_admin

Administrative wrapper for the openstack module
Puppet
5
star
69

trapperkeeper-ruby

Ruby
5
star
70

puppetlabs-denyhosts

A module to provide basic DenyHosts capability
HTML
5
star
71

puppetlabs-apacheds

Puppet
5
star
72

puppet_community_data

Metrics and Graphs for Puppet Community Pull Requests: http://pullrequestmetrics.herokuapp.com/
JavaScript
5
star
73

mq

A simple clojure library to embed an ActiveMQ instance in your application
Clojure
5
star
74

puppetwash

A Wash plugin for puppet
Ruby
4
star
75

puppet-reporter

A web-based reports application for Puppet
JavaScript
4
star
76

puppetlabs-tempest

Module for configuring the OpenStack test suite Tempest
Puppet
4
star
77

maintainers

A gem for maintaining MAINTAINERS files
Ruby
4
star
78

action-litmus_spec

JavaScript
4
star
79

puppetlabs-windows_puppet_certificates

A Puppet module to import the puppet certificates into the machine certificate store in Windows
PowerShell
4
star
80

puppetlabs-pe_bulk_agent_install

A module for bulk installation of puppet agents on Linux and Windows hosts
Ruby
3
star
81

boltwash

Navigate your Bolt inventory in Wash
Ruby
3
star
82

trapperkeeper-lein-template

Clojure
3
star
83

vmwr

Ruby
3
star
84

horsehead

Useful libraries for Go projects
Go
3
star
85

pltraining-bootstrap

Bootstrap files for Puppetlabs Training VMs
Shell
3
star
86

pl-clojure-style

Emacs Lisp
3
star
87

puppet-cloud_connection

A type for storing cloud credential information in the catalog.
Ruby
3
star
88

puppetserver-memmeasure

Clojure
3
star
89

clamps

Ruby
3
star
90

puppetlabs-ldconfig

ldconfig Puppet module. Provides ability to model ldconfig configuration files
3
star
91

prm

Puppet Runtime Manager
Go
3
star
92

trapperkeeper-rpc

RPC service and implementation library for TrapperKeeper services.
Clojure
3
star
93

velocity_puppet_workshop_2009

Velocity Puppet Workshop 2009
Ruby
3
star
94

puppetlabs-puppetserver_gem

This module provides management of Ruby gems for Puppet Server.
Ruby
3
star
95

puppetlabs-azure_agent

The Azure module installs and configures the Windows Azure Linux agent
Ruby
2
star
96

rust-kitchensink

Rust
2
star
97

bdcisco-module-evpn_vxlan

Puppet
2
star
98

chloride

Simple abstraction layer around NetSSH: For all of your SSH-in-a-for-loop needs!
Ruby
2
star
99

openrobby

Robby helps you find people and places
Elixir
2
star
100

detect_wannacry

PowerShell
2
star