Thanks for that info. I wasn’t aware of that ability.
When I get into the container I get the following information:
bash-4.2# cat /etc/hosts
172.17.0.2 47d3dc9aac14
ff02::2 ip6-allrouters
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
bash-4.2# ohai hostname
/opt/chef/embedded/apps/ohai/lib/ohai/system.rb:189:in `attributes_print': I cannot find an attribute named hostname! (ArgumentError)
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:94:in `block in run_application'
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:93:in `each'
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:93:in `run_application'
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:70:in `run'
from /opt/chef/embedded/apps/ohai/bin/ohai:42:in `<top (required)>'
from /usr/bin/ohai:18:in `load'
from /usr/bin/ohai:18:in `<main>'
bash-4.2# ohai fqdn
/opt/chef/embedded/apps/ohai/lib/ohai/system.rb:189:in `attributes_print': I cannot find an attribute named fqdn! (ArgumentError)
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:94:in `block in run_application'
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:93:in `each'
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:93:in `run_application'
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:70:in `run'
from /opt/chef/embedded/apps/ohai/bin/ohai:42:in `<top (required)>'
from /usr/bin/ohai:18:in `load'
from /usr/bin/ohai:18:in `<main>'
bash-4.2# cat /etc/hostname
47d3dc9aac14
Why is a node-name not being set?
From:
Sent: Monday, October 27, 2014 8:55 PM
To:
Subject: [chef] Re: Re: Re: Chef-Container Unable to determine node name
start the container as normal and use nsenter or docker exec to get the shell.
On Mon, Oct 27, 2014 at 2:59 PM, Johnson, Austin <
" target="_blank">
> wrote:
Hello,
I¹m sorry for my ignorance in this matter but how would I access a shell
of that container?
Running docker run -it frontend/nginx bash results in:
You must pass in either the --onboot, --bootstrap, or --verify flag.
Thanks,
Austin
On 10/27/14, 3:47 PM, "AJ Christensen" <
> wrote:
>[2014-10-27T19:18:48+00:00] ERROR: Unable to determine node name:
>configure node_name or configure the system's hostname and fqdn
>
>`ohai hostname`
>`ohai fqdn`
>
>hostname -F
>
>echo foo > /etc/hostname
>echo 127.0.0.1 fqdn hostname >> /etc/hosts
>`ohai hostname`
>`ohai fqdn`
>
>start hostname (or equiv.)
>
>--aj
>
>
>On Mon, Oct 27, 2014 at 12:40 PM, Johnson, Austin
><
> wrote:
>> Hello all,
>>
>> I¹ve been trying to get chef-container to produce a container with a
>>custom
>> nginx cookbook. I began with the chef/centos-7 image, added a few
>> dependencies (openssl wget net-tools make automake bison gcc gcc-c++
>>unzip),
>> and then committed those change to a new base image.
>>
>> From there I did a knife container docker init followed by a knife
>> container docker build and successfully made a new container. However
>>when I
>> try to run the container it seems to be failing. The following is the
>>output
>> of the docker run it frontend/nginx ‹verify :
>>
>> S-C02NC26AG3QN:chef-repo user$ docker run -it frontend/nginx --verify
>> [2014-10-27T19:18:21+00:00] INFO: file '/opt/chef/embedded/bin/runsvdir'
>> exists: pass
>> [2014-10-27T19:18:21+00:00] INFO: file '/opt/chef/embedded/bin/sv'
>>exists:
>> pass
>> [2014-10-27T19:18:21+00:00] INFO: file '/opt/chef/bin/chef-init' exists:
>> pass
>> [2014-10-27T19:18:21+00:00] INFO: file '/usr/bin/chef-init' exists: pass
>> [2014-10-27T19:18:21+00:00] INFO: file '/opt/chef/bin/chef-client'
>>exists:
>> pass
>> [2014-10-27T19:18:21+00:00] INFO: file '/usr/bin/chef-client' exists:
>>pass
>> [2014-10-27T19:18:21+00:00] INFO: command `/opt/chef/bin/chef-init
>> --version` runs: pass
>> [2014-10-27T19:18:21+00:00] INFO: command `/usr/bin/chef-init --version`
>> runs: pass
>> [2014-10-27T19:18:22+00:00] INFO: command `/opt/chef/bin/chef-client
>> --version` runs: pass
>> [2014-10-27T19:18:23+00:00] INFO: command `/usr/bin/chef-client
>>--version`
>> runs: pass
>> [2014-10-27T19:18:36+00:00] INFO: bootstrap: failing chef-client exit
>>codes
>> are honored: pass
>> [2014-10-27T19:18:41+00:00] INFO: failing bootstrap - supervisor
>>processes
>> are cleaned up: pass
>> [2014-10-27T19:18:54+00:00] ERROR: bootstrap: passing chef-client exit
>>codes
>> are honored: fail
>> [2014-10-27T19:18:48+00:00] FATAL: Stacktrace dumped to
>> /.chef/local-mode-cache/cache/chef-stacktrace.out
>> [2014-10-27T19:18:48+00:00] ERROR: Unable to determine node name:
>>configure
>> node_name or configure the system's hostname and fqdn
>> [2014-10-27T19:18:48+00:00] FATAL: Chef::Exceptions::ChildConvergeError:
>> Chef run process exited unsuccessfully (exit code 1)
>> [2014-10-27T19:18:59+00:00] INFO: successful bootstrap - supervisor
>> processes are cleaned up: pass
>> [2014-10-27T19:19:19+00:00] INFO: runsvdir started: pass
>> [2014-10-27T19:19:19+00:00] ERROR: enabled services started: fail
>>
>> [2014-10-27T19:19:39+00:00] INFO: onboot - supervisor processes are
>>cleaned
>> up: pass
>> [2014-10-27T19:19:39+00:00] FATAL: Tests failed:
>> bootstrap: chef-init does not honor passing exit code from chef-client
>> onboot: services did not start
>>
>> Could anyone help point me in the right direction to start debugging
>>this
>> problem?
>>
>> Thanks,
>> Austin