Yes, Puppet has a module called puppetlabs/image_build that can be downloaded from Puppet forge.
The basic purpose of image_build is to enable building various images, including Docker images, from Puppet code. There are two main cases where this can be useful:
-
You have an existing Puppet codebase and you're moving some of your services to using containers. By sharing the same code between container and non-container based infrastructure you can cut down on duplication of effort, and take advantage of work you've already done.
-
You're building a lot of images, but scaling Dockerfile means either a complex hierachy of images or copy-and-pasting snippets between many individual Dockerfiles. image_build allows for sharing common functionality as Puppet modules, and Puppet itself provides a rich domain-specific language for declarative composition of images.
Setup:
puppetlabs/image_build is a Puppet Module and is available on the Forge.
The following should work in most cases:
puppet module install puppetlabs/image_build
You don't need any additional gems installed unless you are looking to work on developing the module. All you need is a working Docker environment or acbuild, for which I'd recommend Docker for Mac or Docker for Windows or just installing Docker if you're on Linux.
For further understanding refer to: https://forge.puppet.com/puppetlabs/image_build