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

machine_image doesn't respect command

Open maxivak opened this issue 8 years ago • 2 comments

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?

maxivak avatar Jun 09 '16 19:06 maxivak

I ran into the same issue. I have a pull request that I think might help.

monkey1016 avatar Jul 06 '16 15:07 monkey1016

@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.

monkey1016 avatar Jul 13 '16 12:07 monkey1016