Dockerspec Version
0.4.1
Ruby Version
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux]
Platform Details
Alpine Linux v3.4
Scenario
Try to build and test a Dockerfile with Node installed - the image does not start any service, so it's killed before the test can run
Steps to Reproduce
Create a Docker file with NodeJS installed and no CMD
Start a little test :
require 'dockerspec/serverspec'
describe 'My Dockerfile' do
describe docker_build('../.') do
it { should have_user 'nobody' }
describe docker_run(described_image) do
describe package('nodejs') do
it { should be_installed }
end
end
end
end
Expected Result
nodejs IS installed
Actual Result
Got an error because docker not running :
- My Dockerfile Docker Build from path: "/projectfiles" Serverspec on tag: "94b3e9e391dc" Package "nodejs" should be installed
Failure/Error: it { should be_installed }
Docker::Error::NotFoundError:
No such exec instance '27f4a7b4131e13343f0654fc2a3f38596209271e55cffa6c687aedd5e45a5823' found in daemon
So the real question is :
How to start a bash in container to keep it alive when the test run ? (and kill all after ;))
Dockerspec Version
0.4.1
Ruby Version
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux]
Platform Details
Alpine Linux v3.4
Scenario
Try to build and test a Dockerfile with Node installed - the image does not start any service, so it's killed before the test can run
Steps to Reproduce
Create a Docker file with NodeJS installed and no CMD
Start a little test :
Expected Result
nodejs IS installed
Actual Result
Got an error because docker not running :
So the real question is :
How to start a bash in container to keep it alive when the test run ? (and kill all after ;))