<commit_before><%# Pull in the base image. %>
FROM <%= @image %>
<%# Pass through proxy settings from Test Kitchen or the system. %>
<% http_proxy = @http_proxy || ENV['http_proxy'] || ENV['HTTP_PROXY'] %>
<% https_proxy = @https_proxy || ENV['https_proxy'] || ENV['HTTPS_PROXY'] %>
<% no_proxy = @no_proxy || ENV['no_proxy'] || ENV['NO_PROXY'] %>
<% if http_proxy %>
ENV http_proxy <%= http_proxy %>
ENV HTTP_PROXY <%= http_proxy %>
<% end %>
<% if https_proxy %>
ENV https_proxy <%= https_proxy %>
ENV HTTPS_PROXY <%= https_proxy %>
<% end %>
<% if no_proxy %>
ENV no_proxy <%= no_proxy %>
ENV NO_PROXY <%= no_proxy %>
<% end %>
<%# Per-platform initializations. %>
<% case @platform; when 'debian', 'ubuntu' %>
<% if @disable_upstart %>
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
<% end %>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -o dockercachebust=<%= Date.today %>
RUN apt-get install -y sudo openssh-server curl lsb-release net-tools rsync
<% when 'rhel', 'centos', 'fedora' %>
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients which curl net-tools iproute rsync passwd
<%# CentOS 7 does not install hostname by default, but EL6 has no hostname package. %>
RUN yum install -y hostname || true
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
<% when 'arch' %>
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm openssh sudo curl
RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
<% when 'gentoo' %>
RUN emerge sync
RUN emerge net-misc/openssh app-admin/sudo
RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
<% when 'gentoo-paludis' %>
RUN cave sync
RUN cave resolve -zx net-misc/openssh app-admin/sudo
RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
<% when 'freebsd' %>
<%# SUPER UN-TESTED BULLSHIT %>
RUN echo "nameserver 8.8.8.8" >> /etc/resolv.conf \
  && env ASSUME_ALWAYS_YES=true pkg install sudo curl bash
RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
<% end %>
<%# Create the kitchen user, give it sudo, and create and authorized keys. %>
<% homedir = @username == 'root' ? '/root' : "/home/#{@username}" %>
RUN if ! getent passwd <%= @username %>; then \
  <% if @platform == 'freebsd' %>pw <% end %>useradd <%= @username %> -d <%= homedir %> -m -s /bin/<%= @platform == 'freebsd' ? 'csh' : 'bash' %>; \
fi
<% if @password && !@password.empty? %>
RUN echo <%= @username %>:<%= @password %> | chpasswd
<% else %>
RUN passwd -d <%= @username %>
<% end %>
RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN mkdir -p /etc/sudoers.d
RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/<%= @username %>
RUN chmod 0440 /etc/sudoers.d/<%= @username %>
RUN mkdir -p <%= homedir %>/.ssh
RUN chown -R <%= @username %> <%= homedir %>/.ssh
RUN chmod 0700 <%= homedir %>/.ssh
RUN touch <%= homedir %>/.ssh/authorized_keys
RUN chown <%= @username %> <%= homedir %>/.ssh/authorized_keys
RUN chmod 0600 <%= homedir %>/.ssh/authorized_keys
<%# Install Chef and Test Kitchen-related gems. %>
RUN curl -L https://chef.io/chef/install.sh | bash -s --<%= ENV['POISE_MASTER_BUILD'] ? " -n -- #{Date.today}" : PoiseBoiler::Kitchen.instance.chef_version ? " -v #{PoiseBoiler::Kitchen.instance.chef_version}" : '' %>
<%# Custom provisioning commands. %>
<% Array(@provision_command).each do |cmd| %>
RUN <%= cmd %><commit_msg>Forgot this in the last push.<commit_after><%# Pull in the base image. %>
FROM <%= @image %>
<%# Pass through proxy settings from Test Kitchen or the system. %>
<% http_proxy = @http_proxy || ENV['http_proxy'] || ENV['HTTP_PROXY'] %>
<% https_proxy = @https_proxy || ENV['https_proxy'] || ENV['HTTPS_PROXY'] %>
<% no_proxy = @no_proxy || ENV['no_proxy'] || ENV['NO_PROXY'] %>
<% if http_proxy %>
ENV http_proxy <%= http_proxy %>
ENV HTTP_PROXY <%= http_proxy %>
<% end %>
<% if https_proxy %>
ENV https_proxy <%= https_proxy %>
ENV HTTPS_PROXY <%= https_proxy %>
<% end %>
<% if no_proxy %>
ENV no_proxy <%= no_proxy %>
ENV NO_PROXY <%= no_proxy %>
<% end %>
<%# Per-platform initializations. %>
<% case @platform; when 'debian', 'ubuntu' %>
<% if @disable_upstart %>
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
<% end %>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -o dockercachebust=<%= Date.today %>
RUN apt-get install -y sudo openssh-server curl lsb-release net-tools rsync
<% when 'rhel', 'centos', 'fedora' %>
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients which curl net-tools iproute rsync passwd
<%# CentOS 7 does not install hostname by default, but EL6 has no hostname package. %>
RUN yum install -y hostname || true
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
<% when 'arch' %>
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm openssh sudo curl
RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
<% when 'gentoo' %>
RUN emerge sync
RUN emerge net-misc/openssh app-admin/sudo
RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
<% when 'gentoo-paludis' %>
RUN cave sync
RUN cave resolve -zx net-misc/openssh app-admin/sudo
RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
<% when 'freebsd' %>
<%# SUPER UN-TESTED BULLSHIT %>
RUN echo "nameserver 8.8.8.8" >> /etc/resolv.conf \
  && env ASSUME_ALWAYS_YES=true pkg install sudo curl bash
RUN ssh-keygen -A -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -A -t dsa -f /etc/ssh/ssh_host_dsa_key
<% end %>
<%# Create the kitchen user, give it sudo, and create and authorized keys. %>
<% homedir = @username == 'root' ? '/root' : "/home/#{@username}" %>
RUN if ! getent passwd <%= @username %>; then \
  <% if @platform == 'freebsd' %>pw <% end %>useradd <%= @username %> -d <%= homedir %> -m -s /bin/<%= @platform == 'freebsd' ? 'csh' : 'bash' %>; \
fi
<% if @password && !@password.empty? %>
RUN echo <%= @username %>:<%= @password %> | chpasswd
<% else %>
RUN passwd -d <%= @username %>
<% end %>
RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN mkdir -p /etc/sudoers.d
RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/<%= @username %>
RUN chmod 0440 /etc/sudoers.d/<%= @username %>
RUN mkdir -p <%= homedir %>/.ssh
RUN chown -R <%= @username %> <%= homedir %>/.ssh
RUN chmod 0700 <%= homedir %>/.ssh
RUN touch <%= homedir %>/.ssh/authorized_keys
RUN chown <%= @username %> <%= homedir %>/.ssh/authorized_keys
RUN chmod 0600 <%= homedir %>/.ssh/authorized_keys
<%# Install Chef and Test Kitchen-related gems. %>
RUN curl -L https://chef.io/chef/install.sh | bash -s --<%= ENV['POISE_MASTER_BUILD'] ? " -n -- #{Date.today}" : PoiseBoiler::Kitchen.instance.chef_version ? " -v #{PoiseBoiler::Kitchen.instance.chef_version}" : '' %> \
    env GEM_HOME=/tmp/verifier/gems GEM_PATH=/tmp/verifier/gems GEM_CACHE=/tmp/verifier/gems/cache /opt/chef/embedded/bin/gem install --no-rdoc --no-ri --bindir /tmp/verifier/bin thor busser busser-serverspec serverspec \
    env GEM_HOME=/tmp/verifier/gems GEM_PATH=/tmp/verifier/gems GEM_CACHE=/tmp/verifier/gems/cache /opt/chef/embedded/bin/gem install --no-rdoc --no-ri bundler \
    chown -R <%= @username %> /tmp/verifier
<%# Custom provisioning commands. %>
<% Array(@provision_command).each do |cmd| %>
RUN <%= cmd %>
{'fraction_non_alphanumeric': 0.1809831824062096, 'fraction_numerical': 0.004657179818887452, 'mean_word_length': 3.9023462270133162, 'pattern_counts': {'":': 0, '<': 128, '<?xml version=': 0, '>': 140, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2132925', 'n_tokens_mistral': 3307, 'n_tokens_neox': 2861, 'n_words': 814}