-
Notifications
You must be signed in to change notification settings - Fork 31
Description
I’ve encountered an issue with your Docker image when trying to pass a MESSAGE variable through a docker-compose.yml file. Special characters like <, >, ', /, and & in MESSAGE cause issues due to YAML parsing limitations and the lack of proper escaping in the sed command within your entrypoint script. For example, the following setup results in either YAML parsing errors or {{message}} not being replaced in index.html:
environment:
MESSAGE: "We’re working hard to resolve issues. Please contact us at <a href='mailto:example@example.com'>contact us</a>."Additionally, if you escape / with \/ to make it work with sed, YAML itself breaks. To improve usability, consider pre-escaping special characters in the entrypoint script (e.g., using sed 's/[&/]/\&/g') or documenting that the image isn’t designed for complex environment variables via Docker Compose. This would save users significant troubleshooting time.