下面是我正在运行的命令:
docker run --rm --add-host foo:11.12.13.14 alpine nslookup foo下面是我得到的输出:
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
9981e73032c8: Pull complete
Digest: sha256:4edbd2beb5f78b1014028f4fbb99f3237d9561100b6881aabbf5acce2c4f9454
Status: Downloaded newer image for alpine:latest
Server: 192.168.65.5
Address: 192.168.65.5:53
Non-authoritative answer:
Non-authoritative answer:虽然我希望在输出中看到11.12.13.14,因为这是添加--add-host标志后的nslookup foo操作的结果。那么,为什么容器不能将foo解析为其IP地址呢?
发布于 2022-05-08 19:15:34
更改
docker run --rm --add-host foo:11.12.13.14 alpine nslookup foo
发送到
docker run --rm --add-host foo:11.12.13.14 alpine:3.8 nslookup foo
产生了预期的结果。因此,在较新版本的alpine中存在这个问题。
https://stackoverflow.com/questions/72164207
复制相似问题