Skip to content

Conversation

@Ronitsabhaya75
Copy link
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Resolves #1033.

Alpine Linux containers (using musl libc) often encounter transient DNS errors ("DNS: transient error (try again later)") during builds, particularly when running apk update.

This change modifies SandboxService to explicitly read nameservers from the host's /etc/resolv.conf and append them to the container's DNS configuration as a fallback.

    private func getDefaultNameservers(attachmentConfigurations: [AttachmentConfiguration]) async throws -> [String] {
        var nameservers: [String] = []

        for attachmentConfiguration in attachmentConfigurations {

            nameservers.append(status.ipv4Gateway.description)
            break
        }

        let systemNameservers = self.getSystemNameservers()
        for ns in systemNameservers {
            if !nameservers.contains(ns) {
                nameservers.append(ns)
            }
        }
        return nameservers
    }

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: container build fails to connect to Alpine with DNS: transient error (try again later)

1 participant