I wrote:
> It should be possible to manually override the resolv.conf
> now by bind mounting an empty file on /etc/resolv.conf in
> the chroot. I've been meaning to play with this, but have
> not made time to do it until just now.
>
> I thought something like this would work:
>
> touch /etc/mock/empty
> echo
> "config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/etc/mock/empty',
> '/etc/resolv.conf'))" >> /etc/mock/site-defaults.cfg
>
> But testing this briefly, the host resolv.conf still ends up
> in the chroot. I'm probably overlooking something obvious.
> At least, I hope I am.
This works:
touch /etc/mock/empty
echo "config_opts['nspawn_args'] = ['--bind=/etc/mock/empty:/etc/resolv.conf']"
\
>> /etc/mock/site-defaults.cfg
<mock-chroot> sh-4.4# time curl http://example.com/
curl: (6) Could not resolve host: example.com
real 0m0.016s
user 0m0.005s
sys 0m0.008s
A proper patch for mock will pass the --bind option to
systemd-nspawn automatically when use_host_resolv is not
set.
--
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The worst thing about history is that every time it repeats itself,
the price goes up.
-- Pillar
signature.asc
Description: PGP signature
_______________________________________________ devel mailing list -- [email protected] To unsubscribe send an email to [email protected] Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/[email protected]/message/CAILPALQSLLZBABJPYYXMEW25X4WHC2B/
