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

Setting hostname for a container does not work. #106

Open
carguel opened this issue Dec 5, 2016 · 0 comments
Open

Setting hostname for a container does not work. #106

carguel opened this issue Dec 5, 2016 · 0 comments

Comments

@carguel
Copy link

carguel commented Dec 5, 2016

chef-provisionning-docker version : 0.10.0
Docker Engine Version : 1.12

Example:

with_machine_options(
  :docker_options => {
    :hostname => "myhostname"
  }
)

machine "mycontainer" do
  role "myrole"
end

When executing this, the hostname of the container is not changed to 'myhostname'.

It seems that Docker API recently changes.
The API option key to set the container hostname is now Hostname and no longer HostConfig/Hostname.
Modifying this in chef/provisioning/docker_driver/docker_run_options.rb, fixes the issue.

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

No branches or pull requests

1 participant