Skip to content

Instantly share code, notes, and snippets.

@yankcrime
Created September 4, 2016 09:03
Show Gist options
  • Save yankcrime/2379735efc22373b855d673d9093fa06 to your computer and use it in GitHub Desktop.
Save yankcrime/2379735efc22373b855d673d9093fa06 to your computer and use it in GitHub Desktop.
A Dockerfile which uses Rocker to build an OpenStack Horizon image with Puppet
FROM ubuntu:16.04
MAINTAINER Nick Jones "[email protected]"
ENV DOCKER_BUILD_DOMAIN='sal01.datacentred.co.uk'
ENV FACTER_role='horizon'
ENV FACTER_domain=${DOCKER_BUILD_DOMAIN:-vagrant.test}
MOUNT /opt/puppetlabs /etc/puppetlabs /root/.gem
MOUNT ./puppet/hieradata:/hieradata
MOUNT ~/.config/keys:/keys
ENV PUPPET_AGENT_VERSION="1.5.0" UBUNTU_CODENAME="xenial" PATH=/opt/puppetlabs/server/bin:/opt/puppetlabs/puppet/bin:/opt/puppetlabs/bin:$PATH
RUN apt-get update && \
apt-get install -y lsb-release inetutils-ping vim git wget && \
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-"$UBUNTU_CODENAME".deb && \
dpkg -i puppetlabs-release-pc1-"$UBUNTU_CODENAME".deb && \
rm puppetlabs-release-pc1-"$UBUNTU_CODENAME".deb && \
apt-get update && \
apt-get install --no-install-recommends -y puppet-agent="$PUPPET_AGENT_VERSION"-1"$UBUNTU_CODENAME" && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN /opt/puppetlabs/puppet/bin/gem install hiera-eyaml deep_merge r10k:2.2.2 --no-ri --no-rdoc
COPY horizon/Puppetfile /
COPY puppet/modules/profile /profile
COPY puppet/default.pp /
RUN r10k puppetfile install --moduledir /etc/puppetlabs/code/modules && \
ln -s /profile /etc/puppetlabs/code/modules/profile && \
puppet apply /default.pp --verbose --show_diff --summarize --hiera_config=/hieradata/hiera.yaml && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
EXPOSE 80
CMD ["/usr/bin/supervisord", "-n"]
COPY Rockerfile /Dockerfile
TAG horizon
# vim:ts=4:sw=4:et:ft=Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment