chef-provisioning-docker icon indicating copy to clipboard operation
chef-provisioning-docker copied to clipboard

Container.create missing cmd parameter?

Open jeffgus opened this issue 10 years ago • 2 comments

I tried to run a simple test, but it fails because Container.create is missing the cmd parameter.

This did not work: container = Docker::Container.create('Image' => image.id, 'name' => container_name)

This works: container = Docker::Container.create('Cmd' => :command, 'Image' => image.id, 'name' => container_name)

jeffgus avatar Feb 03 '15 01:02 jeffgus

Get same issue with CentOS docker images, which supplied without default command: Docker::Error::ServerError: No command specified

Can you guys please put some default command there (like /bin/bash)?

marc- avatar Feb 10 '15 16:02 marc-

I get Docker::Error::ServerError -------------------------- No command specified as well.

If I edit line 200 of /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-docker-0.5.2/lib/chef/provisioning/docker_driver/driver.rb to change container = Docker::Container.create('Image' => image.id, 'name' => container_name) to container = Docker::Container.create('Image' => image.id, 'name' => container_name, 'Cmd' => docker_options[:command])

then it works.

brionmoss avatar Apr 18 '15 01:04 brionmoss