厨师testing厨房validation文件存在于Docker容器内

我尝试使用厨师testing厨房运行简单的testing:

describe file('/opt/test_file.txt') do it { should exist } end 

我可以使用厨房validation轻松地在我的厨房机器(virtualBox / centos-7.2)上运行这个testing。

如何在我的厨房机器中安装的Docker容器内运行此testing?

一般来说,将尝试处理docker容器规格testing作为图像构build过程的一部分,但是,我想你可以运行这样的东西:

 describe bash('docker exec -it YOUR_CONTAINER test -f /opt/test_file.txt') do its('exit_status') { should eq 0 } end