docker
docker copied to clipboard
Changing log options doesn't restart container
Cookbook version
4.1.1
Chef-client version
Chef 12.18.31
Platform Details
Ubuntu 16.04
Scenario:
If you change the 'logging' options it does not reconfigure / restart the container
Steps to Reproduce:
- Create a docker container
docker_container 'nginx' do
action :run
end
Then change the log_driver or log_opts
docker_container 'nginx' do
log_driver 'splunk'
log_opts ['splunk-url=foobar.splunk.com:8088', 'splunk-token=123457890', 'splunk-source=docker', 'splunk-sourcetype=foobar']
action :run
end
Then run chef. Then run a docker inspect, you will find the 'splunk' logger isn't there
docker inspect nginx | grep splunk
Workaround
Deleting and recreating the container by hand fixes the issue
docker stop nginx
docker rm nginx
chef-client
Looking at docker inspect shows the splunk options now
docker inspect nginx | grep splunk
"LogConfig": {
"Type": "splunk",
"Config": {
"splunk-format": "json",
"splunk-source": "docker",
"splunk-token": "xxxxxxxx",
"splunk-url": "https://foobar.example.com:8088"
}
},
Expected Result:
Chef should restart the container just like it does if you change any other options (e,g, volumes, labels, tags)
Actual Result:
Chef does not restart or reconfigure the container on any logging changes
Confirmed issue to still be present, exactly as described above, as of July 2018
docker cookbook version: 4.4.0 platform: Ubuntu 16.04 chef-client: 14.3.37
Somebody is going to solve it? this is an issue from 2018...
Any updates?