kitchen-dokken
kitchen-dokken copied to clipboard
dns issues
:speaking_head: Foreword
I can't for the life of me get DNS to work via the default nameserver of 127.0.0.11, overridding it with a dns setting deosnt change the value of the nameserver in /etc/resolv.conf
:ghost: Brief Description
I've tried overriding DNS with
platforms:
- name: centos-7
driver:
image: dokken/centos-7
pid_one_command: '/usr/sbin/init'
dns:
- 8.8.8.8
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
in .kitchen.yml, but /etc/resolv.conf still has 127.0.0.11
as its only nameserver. If I manually alter /etc/resolv.conf to hit 8.8.8.8 instead, name resolution works.
Version
2.17.0
Environment
docker 4.2.0 on macOS Monterey 12.3.1
Scenario
Be able to hit https://rubygems.org/ or any other site from the contianer via a dns nameserver provided in .kitchen.yml
Steps to Reproduce
---
driver:
name: dokken
chef_version: 14
transport:
name: dokken
provisioner:
name: dokken
platforms:
- name: centos-7
driver:
image: dokken/centos-7
pid_one_command: '/usr/sbin/init'
dns:
- 8.8.8.8
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
Expected Result
log into container and run cat /etc/resolv.conf
and see the set nameserver(8.8.8.8 in this example) nameserver 8.8.8.8
Actual Result
only see the default nameserver in /etc/resolv.conf nameserver 127.0.0.11
:heavy_plus_sign: Additional context
This is the same as the closed issue: https://github.com/test-kitchen/kitchen-dokken/issues/247
Definitly something wierd going on with dokken/dokker dns, in order for the dokken container to reach other docker containers i needed to:
- run
docker network inspect dokken
- grab the gateway address
- use the gateway adress and the port number of the other containter to reach it, it cant be directly reached by container name, only by 'gateway ip:port'
Same issue is observed when using podman - /etc/resolv.conf is not updated as per kitchen.yml dns section.