Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support resolv.conf and --dns in --oci mode #1472

Closed
Tracked by #1467
dtrudg opened this issue Mar 24, 2023 · 0 comments · Fixed by #1551
Closed
Tracked by #1467

Support resolv.conf and --dns in --oci mode #1472

dtrudg opened this issue Mar 24, 2023 · 0 comments · Fixed by #1551
Assignees

Comments

@dtrudg
Copy link
Member

dtrudg commented Mar 24, 2023

In the native runtime, an /etc/resolv.conf file is prepared and mounted in to the container by default. If the --dns flag is not provided then the content of this file is the same as /etc/resolv.conf on the host.

The --dns flag allows custom dns servers to be set for the container. If specified, the /etc/resolv.conf that is bound into the container will be overridden to contain only nameserver entries for the specified DNS servers.

The experimental --oci mode currently has no resolv.conf handling, so DNS setup has to been done manually. The --oci mode should implement the same approach as the native runtime.

The implementation in the native runtime can be used for guidance. Note the utility function files.ResolvConf that is available.

func (c *container) addResolvConfMount(system *mount.System) error {

@dtrudg dtrudg changed the title Support --dns in --oci mode Support resolv.conf mount and --dns in --oci mode Apr 6, 2023
@dtrudg dtrudg changed the title Support resolv.conf mount and --dns in --oci mode Support resolv.conf and --dns in --oci mode Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants