How can I pass a multi-line variable to a docker container?
According to this comment, multi-line variables are supported with
environment: KEY: |- line1 line2
However, when I execute
echo $KEY in the container, it has replaced the newline with spaces:
Am I missing something? My docker version is 1.12.1.
2 Solutions collect form web for “How can I pass a multi-line variable to a docker container?”
The YAML syntax is correct. The shell command wasn’t:
prints the string with newlines.
Had the same problem a couple of days ago and solved it via:
Hope that helps in your case as well.