LinuxContainer: Add /etc/hosts writing functionality (#207)

Closes #206 

Much like we have support for supplying DNS configurations and writing
out /etc/resolv.conf, this adds a way to write out /etc/hosts for a
given container.
This commit is contained in:
Danny Canter
2025-07-18 00:54:18 -07:00
committed by GitHub
parent 3cc638624f
commit c4b6b68ce7
11 changed files with 562 additions and 0 deletions
@@ -60,10 +60,15 @@ public protocol VirtualMachineAgent: Sendable {
func addressAdd(name: String, address: String) async throws
func routeAddDefault(name: String, gateway: String) async throws
func configureDNS(config: DNS, location: String) async throws
func configureHosts(config: Hosts, location: String) async throws
}
extension VirtualMachineAgent {
public func closeProcessStdin(id: String, containerID: String?) async throws {
throw ContainerizationError(.unsupported, message: "closeProcessStdin")
}
public func configureHosts(config: Hosts, location: String) async throws {
throw ContainerizationError(.unsupported, message: "configureHosts")
}
}