I want to write the following RUN command in the Dockerfile. But, docker is not preserving the new lines.
RUN echo \"[repo] \\ name = YUM Reposito
I ended up using a combination of the examples listed above since the new line \n did not work with echo.
\n
echo
RUN printf 'example \n\ text \n\ here' >> example.txt
It produces the following, as expected:
example text here