chef-boneyard / chef-provisioning-docker

Docker provisioner for chef-provisioning
Apache License 2.0
92 stars 40 forks source link

docker log-driver #72

Open aberrios85 opened 9 years ago

aberrios85 commented 9 years ago

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'
  }
})
marc- commented 9 years ago

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.

jkeiser commented 8 years ago

@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.