Skip to content

Cannot start bash at run - fail the test #10

Description

@wibimaster

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 :

  1. 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 ;))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions