Last active
February 26, 2016 23:33
-
-
Save donaldguy/9c287c816dd355547499 to your computer and use it in GitHub Desktop.
Rockerfile for chef Policyfile cookbook ( https://github.com/grammarly/rocker )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ if .FromScratch }} | |
FROM ubuntu:trusty | |
{{ else }} | |
FROM your/cookbook:latest | |
{{ end }} | |
# use chefdk from host | |
MOUNT /opt/chefdk:/opt/chefdk | |
# use ssh environment from host | |
MOUNT {{ .Env.HOME }}/.ssh/known_hosts:/root/.ssh/known_hosts | |
MOUNT {{ .Env.SSH_AUTH_SOCK }}:{{ .Env.SSH_AUTH_SOCK }} | |
ENV SSH_AUTH_SOCK {{ .Env.SSH_AUTH_SOCK }} | |
RUN apt-get install git -y | |
ADD . /chef | |
WORKDIR /chef | |
RUN /opt/chefdk/bin/chef install \ | |
&& /opt/chefdk/bin/chef export bundle && cd bundle \ | |
&& /opt/chefdk/bin/chef-client -z -F doc \ | |
&& rm -rf /chef/bundle | |
TAG your/cookbook:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment