dockerfile中未终止引号字符串的语法错误

dockerfile中未终止引号字符串的语法错误,docker,consul,Docker,Consul,我创建了一个Dockerfile,如下所示: FROM consul COPY config-file.json /consul/config ENTRYPOINT ["consul", "agent, "-config-file=/consul/config/config-file.json"] { "datacenter": "microservices", "data_dir": "/opt/consul", "log_level": "INFO", "disable

我创建了一个Dockerfile,如下所示:

FROM consul

COPY config-file.json /consul/config

ENTRYPOINT ["consul", "agent, "-config-file=/consul/config/config-file.json"]
{
  "datacenter": "microservices",
  "data_dir": "/opt/consul",
  "log_level": "INFO",
  "disable_host_node_id" : true, 
  "server": true,
  "bootstrap_expect" : 2,
  "client_addr": "0.0.0.0",
  "ui": true,
  "bind_addr": "192.168.70.20"
}
config(config file.json)文件如下所示:

FROM consul

COPY config-file.json /consul/config

ENTRYPOINT ["consul", "agent, "-config-file=/consul/config/config-file.json"]
{
  "datacenter": "microservices",
  "data_dir": "/opt/consul",
  "log_level": "INFO",
  "disable_host_node_id" : true, 
  "server": true,
  "bootstrap_expect" : 2,
  "client_addr": "0.0.0.0",
  "ui": true,
  "bind_addr": "192.168.70.20"
}
然后运行容器并获得以下结果:

dockerizer@docker1:~/consul$ docker run --rm -ti --network=host servery
/bin/sh: syntax error: unterminated quoted string

我做错了什么?

您的入口点中“代理”一词后缺少一个引号

ENTRYPOINT[“consur”、“agent”、“-config file=/consur/config/config file.json”]

此缺少的引号是导致未终止引号消息的原因,因此评估或执行的入口点显示为
consur agent“-config file=/consur/config/config file.json
(缺少引号)