chef-provisioning-docker
chef-provisioning-docker copied to clipboard
machine_image doesn't respect command
I am trying to create a new docker image with my command like this:
require 'chef/provisioning'
with_driver 'docker'
machine_image 'myimage' do
action :create
recipe 'mycookbook::default'
machine_options docker_options: {
base_image: {
name: 'ubuntu',
repository: 'ubuntu',
tag: '14.04'
},
:command => '/usr/bin/supervisord -c /etc/supervisord.conf',
}
end
but the final image is created with starting command /bin/sh -c 'while true..."
How to build a docker image with custom command?
I ran into the same issue. I have a pull request that I think might help.
@maxivak The pull request works for my use case, and I think it will cover most scenarios. It should respect :command
and :entrypoint
when creating an image.