1

I'm running Consul client agent inside a Docker container. I have created a docker-compose file as below:

agent:
   hostname: sample.host.com
   container_name: consul_agent
   image: privatedockerregistry/consul-agent:0.6.4
   restart: always
   environment:
     - SERVICE_IGNORE=always
   ports:
     - 8300:8300
     - 8301:8301
     - 8301:8301/udp
     - 8302:8302
     - 8302:8302/udp
     - 8400:8400
   command: --join 11.201.150.108 --join 11.201.342.203 -dc dc_consul -advertise 11.201.343.213 

Please let me know how can i pass the below options in the docker-compose:

  "enable_syslog": true,
  "disable_update_check": true,
  "domain": "consul.domain.com",


  "ports": {
    "dns": 8600,
    "rpc": 8400,
    "serf_lan": 8301,
    "serf_wan": 8302,
    "server": 8300,
    "https": -1,
    "http": 8700
  },
  "datacenter": "consul_dc",
  "acl_datacenter": "consul_dc",
  "acl_default_policy": "deny",
  "acl_master_token": "04asdsec-327d-rd4f-b277-d6a20b80f683"
meallhour
  • 13,921
  • 21
  • 60
  • 117

1 Answers1

0

Map them to environment variables?

environment:
    -PORTS_DNS=8600
    -PORTS_RPC=8400

Reconstruct them on the other side?

If you don't want to do that then perhaps you need to add a configuration server like zookeeper or spring cloud config server: https://blog.pivotal.io/pivotal-cloud-foundry/products/app-configuration-management-with-config-servers-in-cloud-foundry

Robert Moskal
  • 21,737
  • 8
  • 62
  • 86
  • I have mapped them to environment variables. But, when the i `cat` the config.json file within the docker container, I don't see ` "ports" : {       "dns" : 8600,     "http" : 8500,     "https" : -1,     "rpc" : 8400,     "serf_lan" : 8301,     "serf_wan" : 8302,     "server" : 8300   } ` – meallhour Jun 22 '16 at 06:16