谁在 Alpinelinux 中的 docker 下创建了 /etc/resolv.conf 文件

谁在 Alpinelinux 中的 docker 下创建了 /etc/resolv.conf 文件

我使用适当的文件准备了我的 Alpinelinux docker 镜像/etc/resolv.conf,但是当我启动它时,我发现它的内容已更改为:

$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 2607:fe...

我搜索并列出了我所有的 Alpinelinux 软件包,但我确定没有安装任何接近systemd或未resolved安装的软件包。

那么/etc/resolv.conf文件是由docker host创建的吗?

无论如何,这就是我提出这个问题的真正原因——

% cp /etc/resolv.conf.good /etc/resolv.conf
cp: can't create '/etc/resolv.conf': File exists

% ls /etc/resolv.conf -l
-rw-r--r--    1 root     root           615 May  5 12:45 /etc/resolv.conf

即,为什么/etc/resolv.conf文件如此特殊以至于cp会失败?
以前从未见过。有什么提示吗?

相关内容