快速部署
第一种 运行从当前容器拷贝文件
docker run --rm -name coredns -d clibing/alpine-coredns
docker cp coredns:/etc/coredns/core.hosts ./
docker cp coredns:/etc/coredns/Corefile ./
第二种 复制粘贴保存文件
Corefile
.:53 {
cache 300
hosts /etc/coredns/core.hosts {
ttl 60
reload 1m
fallthrough
}
health
forward . 114.114.114.114 8.8.8.8 9.9.9.9
reload 6s
errors
log . "{remote} - [{when}] {>id} {type} {class} {name} {proto} {size} {>do} {>bufsize} {rcode} {>rflags} {rsize} {duration}"
}
core.hosts
127.0.0.1 localhost
使用docker-compose运行
version: "3"
services:
coredns:
image: clibing/alpine-coredns
container_name: coredns
ports:
- 53:53/udp
volumes:
- ./Corefile:/etc/coredns/Corefile
- ./core.hosts:/etc/coredns/core.hosts
Content type
Image
Digest
sha256:fd6528d1a…
Size
38.3 MB
Last updated
over 3 years ago
docker pull clibing/alpine-coredns