<%
options = []

storage_driver = node['docker-grid']['engine']['storage-driver']
if !storage_driver.nil? && !storage_driver.empty?
  options.push("--storage-driver=#{storage_driver}")
end

userns_remap = node['docker-grid']['engine']['userns-remap']
if !userns_remap.nil? && !userns_remap.empty?
  options.push("--userns-remap=#{userns_remap}")
end

extra_options = node['docker-grid']['engine']['daemon_extra_options']
if !extra_options.nil? && !extra_options.empty?
  options.push(extra_options)
end
-%>
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon <%= options.join(' ') %>
