How to use custom DNS settings in Drone Docker plugin -
i using drone behind corporate proxy. when i'm building docker containers there, docker inserts correct search server dns addresses container's /etc/resolv.conf
. however, when using docker plugin, search server patched whileas nameservers set default google nameservers (8.8.8.8
resp. 8.8.4.4
).
this breaks build corporate proxy dns address cannot resolved associated ip address.
is behavior intended and/or there workaround allowing me connect internet through proxy?
this can resolved providing docker plugin configuration dns server address. note example below uses dummy ip addresses; please replace actual ip addresses.
pipeline: docker: image: plugins/docker custom_dns: [ 10.10.0.1, 10.10.0.2 ]
if using enterprise edition can configure following global environment variable:
- name: plugin_custom_dns value: 10.10.0.1,10.10.0.2
why necessary?
why issue surface configurations , not others? , in these instances, why dns configuration not propagate docker in docker? , why work default bridge not user-defined networks? unfortunately cannot provide root cause @ time, can provide information might explain behavior ...
it seems logic configuring dns different depending on version of docker, host machine configuration, etc.
the exact details of how docker manages dns configurations inside container can change 1 docker version next. should not assume way files such /etc/hosts, /etc/resolv.conf managed inside containers , leave files alone , use following docker options instead.
it seems default bridge network behave different user-defined bridge networks design:
in order maintain backward compatibility, dns configuration in default bridge network retained no behavioral change. please refer dns in default bridge network more information on dns configuration in default bridge network.
i wish provide detailed technical root cause issue, , hope can fill in blanks answer. in meantime, please use workaround documented above.
Comments
Post a Comment