New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set "ENV container docker" for CentOS and friends #192
Conversation
related to issue test-kitchen#109 this setting is documented at https://developerblog.redhat.com/2014/05/05/running-systemd-within-docker-container/ and https://hub.docker.com/_/centos/
@mmckinst Thanks for the fix. I had a similar problem. My centos7 docker container was running fine on an Ubuntu host but not on a Centos host. The container is being started but it's missing sshd. Would love to see it merged into master and released! |
set "ENV container docker" for CentOS and friends
@mmckinst: This is excellent! Just having it in the main Trying to band-aid patch this myself manually just to set an |
With recent debian:stretch containers, it is necessary to set container=docker as well. It might be an idea to reopen #192 and extend the fix similarly to debian and ubuntu. I have tested with ubuntu and it does not seem to hurt. |
When running /sbin/init from systemd in debian:stretch (recent, unable to determine since when), it is necessary to include the enviroment variable container=docker in the Dockerfiles. This is essentially the same as for recent CentOSes as previously fixed in test-kitchen#192. Tests with ubuntu-14.04 have shown no hurts and I strongly suspect the same for other debian-based images. modified: lib/kitchen/driver/docker.rb
env container=docker for debians, ext #192
I was having similar problems to issue #109 where I'm using kitchen-docker to do acceptance testing for puppet modules on centos 7 with systemd. EG after running a puppet module, run serverspec or bats to ensure the module actually installed, configured, and started the service correctly.
With this patch and the below config, you can get systemd running on the centos7 docker container.
https://developerblog.redhat.com/2014/05/05/running-systemd-within-docker-container/ and https://hub.docker.com/_/centos/ have a bunch of other things you might have to do regarding /sys/fs/cgroup and deleting some systemd "wants" files but I've found I don't have to do that. Someone else's mileage may vary.