Test Kitchen, Docker and CentOS 7
16 Dec 2016 in Tech
Whilst trying to add some tests to some Chef cookbooks that run on CentOS 7, I ran into an issue where systemd
wouldn't start in a docker container (and so my services wouldn't start up). It was failing with the following error: Failed to get D-Bus connection: Operation not permitted
The solution was to make the container privileged and to set run_command
to /usr/sbin/init
. systemd
still shows that performance is degraded, but at least it starts my services now. Here's a complete .kitchen.yml
that solves the issue for me:
yaml
---driver:name: dockeruse_sudo: falseprivileged: truerun_command: /usr/sbin/initprovisioner:name: chef_zeroplatforms:- name: centosimage: centos:7suites:- name: defaultrun_list: []