Dockerfile:
1 | FROM clickhouse-client:latest |
运行命令:
1 | docker run -it --rm --name clickhouse-client -e HOST="10.185.xx.xx" -e USER="user" -e PASSWORD="xxxx" -e DATABASE="db" clickhouse-client:param |
遇到问题:
当ENTRYPOINT使用方括号并且里面的参数是明文而不是环境变量时,是可以运行的,如
1 | ENTRYPOINT ["/usr/bin/clickhouse-client","-h","10.185.xx.xx","-u","user","--password","xxx"] |
但是形如:
1 | ENTRYPOINT ["/usr/bin/clickhouse-client","-h",$HOST,"-u",$USER,"--password",$PASSWORD] |
就会报:
1 | /bin/sh 1 [/usr/bin/clickhouse-client,-h,10.185.xx.xx,-u,user,--password,password] not found |