ファイル構造
- docker-compose.yml
- Dockerfile
- volumes
- config
- Corefile
- hosts
- config
docker-compose.yml
version: '3.1'
services:
coredns:
build: .
container_name: coredns
restart: always
expose:
- '53'
- '53/udp'
ports:
- '53:53'
- '53:53/udp'
volumes:
- './volumes/config:/etc/coredns'
Dockerfile
FROM coredns/coredns:1.7.0
EXPOSE 53
EXPOSE 53/udp
ADD volumes/config/ /etc/coredns/
ENTRYPOINT ["/coredns"]
CMD ["-conf", "/etc/coredns/Corefile"]
Corefile
. {
whoami
forward . 172.24.2.51:53
errors
log . "{proto} {remote} is Request: {name} {type} {>id}"
hosts /etc/coredns/hosts {
fallthrough
}
reload
}
hosts
172.24.20.25 kakocloud.tmcit.sho