do not copy resolv.conf, but mount it
This commit is contained in:
@@ -29,3 +29,7 @@ nfs:
|
||||
mount options: defaults
|
||||
mount: false
|
||||
systemd name: nfs-server
|
||||
container mounts:
|
||||
- source: /etc/resolv.conf
|
||||
dest: /etc/resolv.conf
|
||||
readonly: true
|
||||
|
||||
@@ -192,12 +192,6 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf("Updating the container's /etc/resolv.conf\n")
|
||||
err = util.CopyFile("/etc/resolv.conf", path.Join(container.RootFsDir(cip.Name), "/etc/resolv.conf"))
|
||||
if err != nil {
|
||||
wwlog.Warn("Could not copy /etc/resolv.conf into container: %s", err)
|
||||
}
|
||||
|
||||
fmt.Printf("Building container: %s\n", cip.Name)
|
||||
err = container.Build(cip.Name, true)
|
||||
if err != nil {
|
||||
|
||||
@@ -197,12 +197,6 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin
|
||||
return
|
||||
}
|
||||
|
||||
wwlog.Info("Updating the container's /etc/resolv.conf")
|
||||
err = util.CopyFile("/etc/resolv.conf", path.Join(container.RootFsDir(cip.Name), "/etc/resolv.conf"))
|
||||
if err != nil {
|
||||
wwlog.Warn("Could not copy /etc/resolv.conf into container: %s", err)
|
||||
}
|
||||
|
||||
err = container.SyncUids(cip.Name, !cip.SyncUser)
|
||||
if err != nil && !cip.SyncUser {
|
||||
err = fmt.Errorf("error in user sync, fix error and run 'syncuser' manually: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user