编写 Dockerfile 时,有时候需要向文件中插入内容,可以直接在里面通过 echo 命令写入
RUN echo $'\n\
********** \n\
***1234*** \n\
********** ' >> /tmp/file
参考:stackoverflow-How to output a multiline string in Dockerfile with a single command
RUN echo $'\n\
********** \n\
***1234*** \n\
********** ' >> /tmp/file
参考:stackoverflow-How to output a multiline string in Dockerfile with a single command