gpt4 book ai didi

docker - 在Docker容器内创建领事客户端代理时如何传递参数?

转载 作者:行者123 更新时间:2023-12-02 20:21:41 25 4
gpt4 key购买 nike

我在Docker容器中运行Consul客户端代理。
我创建了一个docker-compose文件,如下所示:

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

请让我知道如何在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"

最佳答案

将它们映射到环境变量?

environment:
-PORTS_DNS=8600
-PORTS_RPC=8400

在另一边重建它们?

如果您不想这样做,那么可能需要添加一个配置服务器,例如zookeeper或spring cloud配置服务器: https://blog.pivotal.io/pivotal-cloud-foundry/products/app-configuration-management-with-config-servers-in-cloud-foundry

关于docker - 在Docker容器内创建领事客户端代理时如何传递参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37956298/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com