【发布时间】:2016-01-31 01:41:21
【问题描述】:
我想在 Dockerfile 中编写以下 RUN 命令。但是,docker 并没有保留新行。
RUN echo "[repo] \
name = YUM Repository \
baseurl = https://example.com/packages/ \
enabled = 1 \
gpgcheck = 0" > /etc/yum.repos.d/Repo.repoxyz
我知道每行末尾的\ 会转义新行。但是,有什么办法可以写多行来保留新行?
【问题讨论】:
-
您使用的是非 *nix 平台吗?因为这在 Linux 上对我来说很好。
-
@user,我使用的是 Linux。
标签: docker dockerfile