1 placeholder
placeholder is a tool that used to convert placeholder, like ${envName::defaultValue}, in config file with enviroment value. if convert happen, the original file name will be changed to append ‘bak’ surfix; otherwise keep the original file name.
语法:
placeholder [filename]
作用:
首先生成一个带.bak后缀的文件保存未替换前的文件内容,然后将文件中的${xx}变量替换成环境变量对应的实际值。
例子:
placeholder hdfs-site.xml
# 结果会生成两个文件,hdfs-site.xml.bak文件相当于原本hdfs-site.xml文件的备份,hdfs-site.xml是替换之后的文件。
2 set-hostname-as-ip
作用:
将/etc/hosts文件中当前容器的ip:域名映射转换成ip:ip映射。若无当前容器的ip:域名映射信息,文件不会有任何改变。
例子:
# /etc/hosts文件内容
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02: