NewFuture / DDNS

:triangular_flag_on_post: 自动更新域名解析到本机IP(支持dnspod,阿里DNS,CloudFlare,华为云,DNSCOM...)
https://ddns.newfuture.cc/
MIT License
4.23k stars 650 forks source link

[feature] Support environment variables in Docker image #276

Closed NN708 closed 2 years ago

NN708 commented 2 years ago

Very glad to see environment variables are supported in #269. However, currently environment variables defined from Docker can not be passed to cron jobs. A workaround is needed. This is related to #220 and #267.

NewFuture commented 2 years ago

加个 entrypoint.sh

  1. 有命令时执行输入命令
  2. 只有参数时('-'开头) 运行 /ddns + 参数
  3. 没有命令和参数说运行 cron -f https://stackoverflow.com/questions/27771781/how-can-i-access-docker-set-environment-variables-from-a-cron-job
NN708 commented 2 years ago

@NewFuture 十分感谢提供解决方案!

  1. 只有参数时('-'开头) 运行 /ddns + 参数

有可能有人会用参数来传递配置项,有参数时是不是也用 cron 来执行比较好一些?(但不知道好不好实现)

NewFuture commented 2 years ago

两点考虑

NN708 commented 2 years ago

Solved via 9cfdc14fbb07aeb020a255c370b93e3e0a026c6e.