chef-provisioning-docker icon indicating copy to clipboard operation
chef-provisioning-docker copied to clipboard

docker log-driver

Open aberrios85 opened this issue 9 years ago • 2 comments

Wondering how to set the log-driver for the container.

want this (docker inspect):

"LogConfig": {
            "Type": "syslog",
            "Config": {
                "syslog-address": "udp://10.0.10.19:35514",
                "syslog-facility": "local0"
            }
        },

always get this after a chef provision

"LogConfig": {
            "Type": "json-file",
            "Config": {
            }
        },

recipe:

require 'chef/provisioning'
require 'chef/provisioning/docker_driver'

with_driver 'docker'

with_machine_options({
  convergence_options: {
     ssl_verify_mode: :verify_none
  },
  docker_options: {
    base_image: {
     :name => 'centos',
     :repository => 'centos',
     :tag => 'latest'
    },
    logconfig: {
      :type => "syslog",
      config: {
        :syslog_address => 'udp://10.0.10.19:32512',
        :syslog_facility => 'local0'
      }
    },
    :ports => ["5060:5060","5060:5060/udp","10000-10009:10000-10009/udp","5038:5038","8088:8088","8089:8089"],
    :command => 'asterisk -v'
  }
})

aberrios85 avatar Nov 19 '15 11:11 aberrios85

There is limited number of docker options supported by CPD (you can see all of them in README.md). And LogConfig not in the list currently. If you can add it, go ahead and make a PR.

marc- avatar Nov 19 '15 11:11 marc-

@aberrios85 https://github.com/chef/chef-provisioning-docker/pull/83 adds all options, including this one. Mind giving it a whirl? docker_options: { log_driver: "syslog", log_config: [ "syslog_address=udp://10.0.10.19:32512", "syslog_facility=local0" ] } is what I expect to work. It's intended to mimick the docker command line.

jkeiser avatar Mar 15 '16 05:03 jkeiser