Skip to content
This repository has been archived by the owner on Jul 6, 2018. It is now read-only.

Container.create missing cmd parameter? #22

Open
jeffgus opened this issue Feb 3, 2015 · 2 comments
Open

Container.create missing cmd parameter? #22

jeffgus opened this issue Feb 3, 2015 · 2 comments
Labels
Milestone

Comments

@jeffgus
Copy link

jeffgus commented Feb 3, 2015

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)

@marc-
Copy link
Contributor

marc- commented Feb 10, 2015

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)?

@jkeiser jkeiser added this to the 1.0 milestone Feb 21, 2015
@brionmoss
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

4 participants