Closed chrisduong closed 10 years ago
This is not an issue with chef-container or chef-client, but instead a symptom of your docker run
command. knife-container generates a Dockerfile that configures chef-init
to be your ENTRYPOINT. chef-init is anticipating specific values (--onboot, --bootstrap or --verify) and you are passing in /bin/bash
, hence the failure you are seeing. To understand this further, I would encourage you to check out the Docker Run reference materials: http://docs.docker.com/reference/run/#cmd-default-command-or-options
Containers that are running chef-init are not meant to be launched in interactive mode. If you wish to enter into the container, I recommend launching it in detached mode and accessing it using nsenter: https://github.com/jpetazzo/nsenter.
I'm going to close this issue since there hasnt been any more activity on it.
Hi,
I successfully built an image by using these commands: $ knife container docker init chef/laz_staging_nginx -f chef/ubuntu-14.04:latest --include-credentials \ -r "recipe[nginx]" --validation-key .chef/chef-validator.pem
$ knife container docker build chef/laz_staging_nginx
2014-08-30T16:03:22+00:00] INFO: template[nginx.conf] sending reload action to servicenginx [2014-08-30T16:03:22+00:00] INFO: Processing service[nginx] action reload (nginx::default line 24) [2014-08-30T16:03:22+00:00] INFO: service[nginx] reloaded [2014-08-30T16:03:24+00:00] INFO: Chef Run complete in 285.684786063 seconds [2014-08-30T16:03:24+00:00] INFO: Running report handlers [2014-08-30T16:03:24+00:00] INFO: Report handlers complete [2014-08-30T16:03:24+00:00] INFO: Deleting client key... ---> 8a7922970b1c Removing intermediate container e11a16834572 Step 3 : ENTRYPOINT ["chef-init"] ---> Running in 5efd6cda8f3b ---> f68ddebcbfa4 Removing intermediate container 5efd6cda8f3b Step 4 : CMD ["--onboot"] ---> Running in 16a5b95dbd7e ---> 6bba994b9bc2 Removing intermediate container 16a5b95dbd7e Successfully built 6bba994b9bc2 WARNING: Deleted node chef-laz_staging_nginx-build WARNING: Deleted client chef-laz_staging_nginx-build
*However, whenever I start the container: $ ➜ chef-cookbook docker run -i -t -h trusty-cont01 --name trusty-cont01 chef/laz_staging_nginx /bin/bash You must pass in either the --onboot, --bootstrap, or --verify flag.
$ ➜ chef-cookbook docker start -a trusty-cont01 trusty-cont01 You must pass in either the --onboot, --bootstrap, or --verify flag.
Look like sth wrong with chef-client within the container. Please take a look, thanks