基础镜像中4大工具解析

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:
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值