Skip to content

Instantly share code, notes, and snippets.

@spheromak
Last active March 4, 2016 15:47
Show Gist options
  • Save spheromak/3b1a8fb4fda1718fd436 to your computer and use it in GitHub Desktop.
Save spheromak/3b1a8fb4fda1718fd436 to your computer and use it in GitHub Desktop.
kitchen-docker
---
driver:
name: docker
use_sudo: false
socket: <%= ENV['DOCKER_HOST'] %>
# may have to set this
# privileged: true
run_command: /sbin/init
# this is here as an example of using environments
provisioner:
name: chef_zero
require_chef_omnibus: 11.16.4-1
environments_path: 'test/environments'
platforms:
- name: centos-5
- name: centos-6
# Centos7 default has fake systemd, and isn't good for kitchen testing. We use custom base container with systemd setup
- name: centos7
driver:
dockerfile: test/cent7-dockerfile
platform: centos
run_command: /usr/sbin/init
suites:
- name: base-prod
provisioner:
client_rb:
environment: prod
run_list:
- recipe[proxy_test_setup::etcd]
- recipe[proxy::default]
- recipe[proxy_integration_setup]
---
driver:
name: docker
use_sudo: false
socket: <%= ENV['DOCKER_HOST'] %>
FROM milcom/centos7-systemd
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients which curl tar chpasswd hostname passwd
RUN mkdir -p /var/run/sshd
RUN useradd -d /home/<%= @username %> -m -s /bin/bash <%= @username %>
RUN echo <%= "#{@username}:#{@password}" %> | chpasswd
RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN sed -i.kitchen '/UsePAM/d' /etc/ssh/sshd_config
RUN echo 'UsePrivilegeSeparation no' >> /etc/ssh/sshd_config
RUN echo 'UsePAM no' >> /etc/ssh/sshd_config
RUN ssh-keygen -A
RUN systemctl enable sshd.service
---
driver:
name: docker
use_sudo: false
socket: <%= ENV['DOCKER_HOST'] %>
# privileged: true
run_command: /sbin/init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment