Ask Your Question
0

Using Puppet Apply with Hiera for building Docker images

asked 2016-01-09 21:56:35 -0500

Imesh gravatar image

I'm trying to build a docker image with Puppet Apply and Hiera. The puppet module can be found here [1], hiera data files can be found here [2] and Dockerfile is as follows:

FROM ubuntu:15.10
MAINTAINER imesh@abc.org

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get -y update
RUN apt-get -y install puppet

COPY puppet/ /etc/puppet/

ENV FACTER_product_name: wso2esb
ENV FACTER_product_version: 4.9.0
ENV FACTER_product_profile: default
ENV FACTER_environment: dev
ENV FACTER_vm_type: docker

RUN puppet apply --modulepath=/etc/puppet/manifests/site.pp --hiera_config /etc/puppet/hieradata/hiera.yaml --verbose --detailed-exitcodes || [ $? -eq 2 ]

# Servlet and pass-through transport ports
EXPOSE 9763 9443 8280 8243

ENTRYPOINT /usr/local/bin/init.sh

Question Once I run the Docker build command I get the following error:

Step 15 : RUN puppet apply --modulepath=/etc/puppet/manifests/site.pp --hiera_config /etc/puppet/hieradata/hiera.yaml --verbose --detailed-exitcodes || [ $? -eq 2 ]
---> Running in 771731292a99
Error: Could not find data item classes in any Hiera data file and no default supplied at /etc/puppet/manifests/site.pp:20 on node ca5fd9ca11dc
Error: Could not find data item classes in any Hiera data file and no default supplied at /etc/puppet/manifests/site.pp:20 on node ca5fd9ca11dc
The command '/bin/sh -c puppet apply --modulepath=/etc/puppet/manifests/site.pp --hiera_config /etc/puppet/hieradata/hiera.yaml --verbose --detailed-exitcodes || [ $? -eq 2 ]' returned a non-zero code: 1

Appreciate any thoughts on this!

[1] https://github.com/wso2/puppet-module... [2] https://github.com/wso2/puppet-module...

edit retag flag offensive close merge delete

Comments

beforce you use puppet apply you need first to copy the files inside container, anyway I think is better to use docker-compose for archive what you are doing.

c4f4t0r gravatar imagec4f4t0r ( 2016-01-11 05:18:38 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-03-29 17:21:42 -0500

jagadeesh gravatar image

Since you have your Hiera on a github repository. RUN a command to clone hiera repo. Its more maintainable than copying the files.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-01-09 21:56:35 -0500

Seen: 373 times

Last updated: Jan 09 '16