You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
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.
The text was updated successfully, but these errors were encountered: