docker
docker copied to clipboard
-g and --graph flags on dockerd are deprecated in favor of --data-root
Cookbook version
3.0.0
Chef-client version
12.18
Platform Details
Ubuntu 16.04.3 LTS
Scenario:
Remove warnings of deprecated features from dockerd minimum version 17.05. Disabled by default in version 17.10
See: https://docs.docker.com/engine/deprecated/#-g-and---graph-flags-on-dockerd
Steps to Reproduce:
Install the docker service on the host with a graph
value defined.
docker_service 'default' do
graph '/opt/docker-graph'
action [:create, :start]
end
On the converged host, login, use the command journalctl -xe | grep deprecated
Expected Result:
No warnings from dockerd.
Actual Result:
Entry in systemd journal with the message from the dockerd
"The \"-g / --graph\" flag is deprecated. Please use \"--data-root\" instead"
Fixed in https://github.com/chef-cookbooks/docker/pull/958/commits/72edd8dbcd8321aff76031c2c1acedd6668e0d48
The removal of --graph has broken the docker version that is provided by RHEL/CentOS 7, I'd suggest some logic in there instead of just dropping the flag. Unless the intent is not to support the built in version of docker on CentOS.
Still broken for CentOS 7, any work around?
This also breaks any RHEL 6 installations, since the latest Docker version for this is 1.7.1 which only supports "--graph". As a workaround I use this:
if node['platform_version'].start_with?('7')
data_root '/docker'
elsif node['platform_version'].start_with?('6')
misc_opts '--graph=/docker'
end