forked from abiosoft/colima
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* core: add configurable dns * core: update nerdctl to 0.16.1 * fixes abiosoft#131: expose docker certs to vm * core: copy registry certs for all runtimes * containerd: bump nerdctl 0.16.1 → 0.17.0 * docs: update readme
- Loading branch information
Showing
6 changed files
with
130 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package lima | ||
|
||
import ( | ||
"fmt" | ||
"path/filepath" | ||
|
||
"github.com/abiosoft/colima/config" | ||
"github.com/abiosoft/colima/util" | ||
) | ||
|
||
func (l limaVM) copyCerts() error { | ||
log := l.Logger() | ||
err := func() error { | ||
dockerCertsDirHost := filepath.Join(util.HomeDir(), ".docker", "certs.d") | ||
dockerCertsDirGuest := "/etc/docker/certs.d" | ||
if _, err := l.host.Stat(dockerCertsDirHost); err != nil { | ||
// no certs found | ||
return nil | ||
} | ||
|
||
// we are utilising the host cache path as it is the only guaranteed mounted path. | ||
|
||
// copy to cache dir | ||
dockerCertsCacheDir := filepath.Join(config.CacheDir(), "docker-certs") | ||
if err := l.host.RunQuiet("mkdir", "-p", dockerCertsCacheDir); err != nil { | ||
return err | ||
} | ||
if err := l.host.RunQuiet("cp", "-R", dockerCertsDirHost+"/.", dockerCertsCacheDir); err != nil { | ||
return err | ||
} | ||
|
||
// copy from cache to vm | ||
if err := l.RunQuiet("sudo", "mkdir", "-p", dockerCertsDirGuest); err != nil { | ||
return err | ||
} | ||
return l.RunQuiet("sudo", "cp", "-R", dockerCertsCacheDir+"/.", dockerCertsDirGuest) | ||
}() | ||
|
||
// not a fatal error, a warning suffices. | ||
if err != nil { | ||
log.Warnln(fmt.Errorf("cannot copy registry certs to vm: %w", err)) | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters