在dockerfile中没有终止引用的string的语法错误
我创build了一个Dockerfile,如下所示:
FROM consul COPY config-file.json /consul/config ENTRYPOINT ["consul", "agent, "-config-file=/consul/config/config-file.json"]
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中缺less一个报价。
ENTRYPOINT ["consul", "agent", "-config-file=/consul/config/config-file.json"]
这个缺less的报价是什么导致未终止的报价信息,所以评估或执行的ENTRYPOINT作为总裁consul agent "-config-file=/consul/config/config-file.json
出现consul agent "-config-file=/consul/config/config-file.json
(缺less一个报价)