docker-compose.yml 特殊字符转义

MYSQL_ROOT_PASSWORD等键值对,可能会有特殊字符的字符串。使用引号来包围含有特殊字符的字符串。如果含有符号$,使用$$来代表$

You can use a $$ (double-dollar sign) when your configuration needs a literal dollar sign. This also prevents Compose from interpolating a value, so a $$ allows you to refer to environment variables that you don’t want processed by Compose.

Compose file version 3 reference | Docker Documentation

引用:
How to escape # in docker-compose – Stack Overflow
escaping – How can I escape a $ dollar sign in a docker compose file? – Stack Overflow
MYSQL_ROOT_PASSWORD special character missing with docker-compose.yml configuration · Issue #123 · docker-library/mysql · GitHub
yml配置文件中有特殊字符解决方案_iamlzyoco的博客-CSDN博客

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据